Information flow display method and device, computer equipment and readable storage medium
By pre-generating and configuring barrage controls, combining object pool design and hardware accelerated rendering, the memory fluctuations and performance degradation of barrage implementation solutions in the existing technology are solved, and efficient and stable barrage display is achieved, improving user experience.
Patent Information
- Application Number
- CN202510513519.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-25
AI Technical Summary
The existing barrage implementation solution has problems such as difficult development, poor cross-platform compatibility, large memory fluctuations and degradation of performance under the desktop client graphics framework, making it difficult to achieve efficient and stable barrage functions.
By pre-creating multiple barrage controls and configuring animation effects for each control, binding them to the idle control when there is barrage content, starting the animation effect, using object pool design mode and hardware accelerated rendering, supporting dynamic display and rapid recycling of barrage content.
It reduces memory usage, improves barrage display efficiency, reduces code volume, realizes efficient and stable barrage content display, and improves user participation and conversion rate.
Smart Images

Figure CN120371298A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of front-end design technology, and in particular to an information flow display method, device, computer equipment and readable storage medium. Background Art
[0002] With the development of Internet technology, client functions are becoming more and more diverse. Displaying different types of information streams in the form of information stream cards on the client homepage can enhance the attractiveness of the client and provide users with a better browsing experience. Information streams can usually contain dynamic content such as pictures, texts, and interactive elements. Displaying these dynamic contents in the form of bullet screens can increase users' click-through rate and willingness to interact with information stream cards.
[0003] However, the current bullet screen implementation technology under the desktop client graphics framework mainly relies on two types of solutions: one is the self-drawing rendering mode based on the underlying graphics interface, which is difficult to develop and requires manual management of drawing logic, animation, collision detection, etc., poor cross-platform compatibility, high maintenance costs, and difficult to adapt to dynamic content (such as advertisements and mixed text and graphics); the other is the dynamic creation mode based on UI controls. This mode frequently creates and destroys controls, causing memory fluctuations, and is prone to memory fragmentation during long-term operation. When a large number of controls exist at the same time, performance degrades significantly. These technical limitations make it difficult to implement efficient and stable bullet screen functions in information flow cards. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an information flow display method, device, computer equipment and readable storage medium, which are used to provide a highly stable and memory-saving way to dynamically display bullet comments in the information flow. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present invention provides a method for displaying an information flow, the method comprising: generating a preset number of barrage controls, and configuring an animation effect for each of the barrage controls; when there is barrage content in the information flow, binding the barrage content to an idle target barrage control; starting the animation effect of the target barrage control to present the process of the barrage content moving within a preset active area.
[0006] In an optional implementation, the method further includes: when the barrage content moves out of the active area, releasing the binding relationship between the barrage content and the target barrage control; and inserting the target barrage control to the end of the idle barrage control sequence.
[0007] In an alternative embodiment, an animation effect of the target bullet screen control is started to present the process of the bullet screen content moving within a preset active area, including: determining the active area according to the container size of the information stream and the size of the bullet screen control; wherein, the active area includes a starting position, an ending position, and a staying area.
[0008] An incoming animation is started at the starting position to present the process of the bullet screen content moving from the starting position to the starting point of the staying area; when the bullet screen content reaches the starting point of the staying area, the bullet screen content is made to stay and be displayed; when the staying duration reaches a preset duration, the bullet screen content is made to move to the ending point of the staying area, and then the incoming animation is executed in reverse to present the process of the bullet screen content moving from the ending point of the staying area to the ending position.
[0009] In an alternative embodiment, generating a preset number of bullet screen controls includes: initializing a preset number of control instances; and configuring a container corresponding to different types of bullet screen content and an event binding layer for each of the control instances to obtain the bullet screen controls.
[0010] In an alternative embodiment, the method further includes: if there is an interaction event in the bullet screen content, then attaching an event listener corresponding to the interaction event to the target bullet screen control.
[0011] In an alternative embodiment, the method further includes: when the information background updates the bullet screen content, updating the bullet screen content bound to the target bullet screen control through a global control pool manager.
[0012] In an alternative embodiment, the method further includes: when there is a specific visual element in the bullet screen content, setting the caching mode of the target bullet screen control to a bitmap caching mode to pre-render the visual element as a bitmap.
[0013] In a second aspect, the present invention provides an information stream display device, including: a generation module, a binding module, and a display module; the generation module is configured to generate a preset number of bullet screen controls and configure an animation effect for each of the bullet screen controls; the binding module is configured to, when there is bullet screen content in the information stream, bind the bullet screen content to an idle target bullet screen control; the display module is configured to start the animation effect of the target bullet screen control to present the process of the dynamic content moving within a preset active area.
[0014] In a third aspect, the present invention provides a computer device, including a processor and a memory, where the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the information stream display method according to any one of the foregoing embodiments.
[0015] Fourthly, the present invention provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the information flow display method described in any one of the foregoing embodiments is implemented.
[0016] The information flow display method, device, computer device and readable storage medium provided by the embodiments of the present invention pre-generate a plurality of bullet screen controls and configure an animation effect for each bullet screen control, providing a basis for subsequent dynamic display of bullet screen content. When receiving an information flow and determining that there is bullet screen content, the bullet screen content is bound to an idle bullet screen control to ensure that the bullet screen content can be dynamically displayed subsequently. After the binding is completed, the animation effect of the bullet screen control can be started to present the process of the bullet screen content moving within the active area. The embodiments of the present invention first generate bullet screen controls statically, which can reduce the memory occupancy rate compared with the traditional dynamic creation scheme. These bullet screen controls support recycling and can quickly release resources. Secondly, by pre-configuring the animation effect, the bullet screen display efficiency can be improved, and the code amount can be reduced compared with the traditional self-drawn animation scheme. The whole scheme can efficiently and stably display bullet screen content dynamically.
[0017] To make the above objects, features and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 is a schematic diagram of an information flow card provided by an embodiment of the present invention;
[0020] Figure 2 is a schematic flowchart of an information flow display method provided by an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of the effect of an information flow display method provided by an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of an information flow display process provided by an embodiment of the present invention;
[0023] Figure 5 is a functional module diagram of an information flow display device provided by an embodiment of the present invention;
[0024] Figure 6It is a structural block diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.
[0026] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0027] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0028] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an information flow card provided by an embodiment of the present invention. Various types of information can be intuitively recommended to users in the form of cards. These information can involve various content forms such as games, education, food, tourism, etc. For example, as Figure 1 shown, game-related videos uploaded by users can be displayed in Card 1, and certain advertising information can be displayed in Card 2. The information can be displayed in the form of an information flow large card, an information flow small card as shown in Card 2, a recommendation on the playback page, etc.
[0029] In the process of research, the inventor found that: the exposure volume of information flow cards on the current PC side has been continuously decreasing, and the overall click-through rate (CTR) has also shown an obvious downward trend. At the same time, the proportion of QR code scanning style information has increased, but its click conversion rate is significantly lower than that of picture and text type information. Especially in the game industry where revenue is dominant, the CTR of information flow cards has been continuously decreasing. Behind these phenomena, it reflects the weakening of users' interaction willingness due to aesthetic fatigue.
[0030] Combined with the above phenomena, through analyzing user behavior and some existing reference cases of bullet screen effects, the inventor found that: innovative interaction methods can effectively improve this situation. For example, adopting the display form of browser bullet screen style has been proven to increase the CTR by 20%. This data shows that by optimizing the information flow display form and interaction experience, the user participation and conversion rate can be significantly improved.
[0031] In view of this, the embodiment of the present invention intends to add a bullet screen function to the information flow card, that is, while displaying the information flow, cooperate with the display of bullet screen content related to this information, which can not only enhance the user's sense of participation and interactivity, but also deepen the user's impression of the information, thereby improving the conversion rate and effect.
[0032] However, as can be seen from the background technology: there are many defects in the existing bullet screen implementation solutions. The embodiment of the present invention intends to provide an efficient and stable bullet screen implementation solution, which can realize the dynamic display effect of the bullet screen, attract the user's attention through dynamic content, and improve the click-through rate and user participation.
[0033] To achieve the above purpose, please refer to Figure 2 , Figure 2 is a schematic flowchart of the information flow display method provided by the embodiment of the present invention. The execution subject of this method can be a server or a PC side. Taking the PC side as an example below, this method is introduced, including steps S201 to S203, which are described as follows:
[0034] S201: Generate a preset number of bullet screen controls and configure an animation effect for each bullet screen control;
[0035] S202: When there is bullet screen content in the information flow, bind the bullet screen content to the idle target bullet screen control;
[0036] S203: Start the animation effect of the target bullet screen control to present the process of the bullet screen content moving within the preset activity area.
[0037] Steps S201 to S203 provided by the embodiments of the present invention generate multiple bullet screen controls in advance and configure animation effects for each bullet screen control, providing a basis for subsequent dynamic display of bullet screen content. When an information stream is received and it is determined that there is bullet screen content, the bullet screen content is bound to the idle bullet screen controls to ensure that the bullet screen content can be dynamically displayed subsequently. After the binding is completed, the animation effects of the bullet screen controls can be started to present the process of the bullet screen content moving within the active area. The embodiments of the present invention first generate bullet screen controls in a static manner. Compared with the traditional dynamic creation scheme, it can reduce the memory occupancy rate. These bullet screen controls support recycling and can quickly release resources. Secondly, by pre-configuring the animation effects, the bullet screen display efficiency can be improved, and the amount of code can be reduced compared with the traditional self-drawn animation scheme. The entire scheme can efficiently and stably display bullet screen content dynamically.
[0038] Next, the embodiments of the present invention will clearly and detailedly introduce the above-mentioned information stream display processes in combination with relevant drawings.
[0039] In step S201, in order to implement the bullet screen carousel function during the information stream display process, the embodiments of the present invention generate multiple bullet screen controls in advance and configure animation effects for each bullet screen control, which provides a guarantee for subsequent dynamic display of the bullet screen content in the information stream. When there are multiple bullet screen contents, the carousel effect of multiple bullet screen contents on the screen can be displayed through multiple bullet screen controls.
[0040] In the embodiments of the present invention, the number n of bullet screen controls can be flexibly set by relevant personnel according to actual needs. For example, n = 3. Each bullet screen control can carry a piece of bullet screen content in the information stream. The types of bullet screen content can be images, texts, interactive elements, etc. Steps a1 to a2 give an implementation manner of generating n bullet screen controls:
[0041] Step a1: Initialize a preset number of control instances;
[0042] Step a2: Configure containers corresponding to different types of bullet screen content and event binding layers for each control instance to obtain bullet screen controls.
[0043] It is understandable that the PC side can generate a preset number of control instances when the barrage container is initialized. Each control instance can contain containers corresponding to different types of barrage content, such as text containers, image containers, etc., and can also include event binding layers, such as mouse pointer event entry and mouse pointer exit events. The event binding layer is a mechanism for handling user interaction events in user interface controls, allowing developers to associate specific user operations (such as mouse entry, mouse exit, click, etc.) with corresponding processing functions or code blocks, thereby realizing the function of dynamically responding to user behavior. The event binding layer supports barrage click events and their penetration processing to ensure that the underlying information buttons and barrage interaction logic do not conflict with each other.
[0044] In the implementation of the present invention, all the bullet screen controls used can be registered to the global control pool manager for unified management. The global control pool manager can set all bullet screen controls to display under visibility. When the information background sends the information flow and needs to display dynamic content, the visibility is set to display.
[0045] Next, the PC side can configure animation effects for each bullet screen control to achieve the purpose of displaying the dynamic effect of the bullet screen content. In an embodiment of the present invention, the PC side can set three stages for the movement of the bullet screen control: the moving-in stage, the staying stage, and the removing stage. In the moving-in stage, the moving-in effect of the bullet screen control can be set, such as the gradual-in effect. In the staying stage, the bullet screen control is set to stay displayed for a period of time, and the moving-out effect in the moving-out stage is opposite to the moving-in effect in the moving-in stage, such as the gradual-out effect.
[0046] In order to achieve the above three-stage animation effect configuration, the PC side can use declarative combined animation to define the animation sequence of each moving stage to achieve the purpose of changing the state of the bullet screen control such as position, color, size and other attributes. You can also configure the duration of each stage and the visibility and movement status of the bullet screen control in each stage.
[0047] As an optional implementation, the present invention can configure the following animation effects for each of the above stages:
[0048] Gradual animation effect in the moving-in phase: The embodiment of the present invention can synchronously control two animation effects of the bullet screen control: one is the transparency change and duration of the bullet screen control. For example, the transparency of the bullet screen control will gradually change from completely transparent to completely transparent, and this change process will last for 0.5 seconds. The other is the movement process of the bullet screen control from one position to another along the Y axis and the duration of the movement. The two animations will start at the same time, and the easing function can also be used to make the animation effect more natural and smooth.
[0049] The pause display effect in the pause phase: add a pause time in the animation sequence, during which the current state of the bullet screen control (including visibility and position) remains unchanged. For example, insert a blank timeline, the duration of this blank timeline can be adjusted between 2 and 3 seconds, and the specific duration can be configured as needed to adapt to different application scenarios.
[0050] Fade-out effect in the exit phase: The fade-out effect is achieved by executing the fade-in animation in reverse. For example, continuing with the example of the entry phase, the transparency state can be changed from 0 to 1 for 0.5 seconds, and the duration of the movement from the end of the stay area to the end of the movement is defined as 2 seconds.
[0051] In order to understand the above animation effect configuration process as a whole, the above example can be summarized as follows: In the moving-in phase, the transparency of the bullet screen control changes from 0 to 1, which lasts for 0.5 seconds. At the same time, the bullet screen control moves along the Y axis from the initial position of the movement to the starting position of the "staying area", and this process lasts for 2 seconds. In the stay phase, a blank timeline is inserted, which lasts for 2-3 seconds. During this period, the transparency and position of the control remain unchanged. In the moving-out phase, the transparency of the bullet screen control changes from 1 to 0, and this process lasts for 2 seconds. At the same time, the bullet screen control moves along the Y axis from the end position of the "staying area" to the end position of the movement, and this process lasts for 2 seconds.
[0052] It should be noted that the above animation effect configuration method is only an example. In the actual implementation process, developers can flexibly configure the animation effect according to actual needs. For example, the bullet screen can be moved directly from the starting position to the ending position without configuring the effects of fading in and out. More moving stages can also be set and richer animation effects can be configured. The embodiments of the present invention are not limited to this.
[0053] By configuring the animation effects of the bullet chat control at different stages in the above way, the bullet chat control can gradually disappear from the screen and return from the display state to the hidden state, thereby providing a natural and smooth visual effect. When there are multiple bullet chat contents, the effect of multiple bullet chat contents being rotated on the screen can be displayed.
[0054] From the above content, it can be seen that in the process of configuring the animation effects of each moving stage, the animation effect of moving the bullet screen control from one position to another along the Y axis is involved. This shows that: the embodiment of the present invention also needs to calibrate the active area of the bullet screen control, and set the corresponding moving ranges of the moving-in stage, the staying stage and the moving-out stage in the secondary active area. In this regard, the embodiment of the present invention proposes an implementation method for determining the active area based on the container size of the information flow and the size of the bullet screen control, which is described as follows:
[0055] In the embodiments of the present invention, the active area includes a starting position, an ending position, and a staying area. The Y-axis coordinates of each position under the screen coordinates are defined as follows:
[0056] The Y-axis coordinate of the starting position is the height of the card container of the information stream plus the height of the bullet screen control. This means that initially, the bullet screen control is located below the card container and is completely invisible. When the animation starts, the bullet screen control will gradually move upward from this position into the visible range of the card container. For example, if the height of the card container is 500 pixels and the height of the bullet screen control is 100 pixels, then the initial Y-axis coordinate of the bullet screen control will be 600 pixels (500 + 100).
[0057] The coordinate range of the staying area is the centered area on the Y-axis, that is, within a preset proportion of the height of the card container. For example, from 40% to 60%, which means the top of the bullet screen control will start from the 40% position of the height of the card container and end at the 60% position of the container height, ensuring that the control is displayed in the middle part of the container. For example, if the height of the card container is 500 pixels, then the Y-axis range of the staying area is from 200 pixels (500×0.4) to 300 pixels (500×0.6).
[0058] The Y-axis coordinate of the ending position is - the height of the control, defining the ending position where the bullet screen control completely moves out of the top of the card container. This means that when the animation ends, the bullet screen control will disappear from the visible range of the card container. For example, if the height of the bullet screen control is 100 pixels, then the Y-axis coordinate of the ending position will be -100 pixels.
[0059] Based on the above regional position calibration, in step S203, when the PC terminal receives the information stream, if there is bullet screen content in the information stream, the dynamic movement process of the bullet screen content can be implemented in the following manner:
[0060] First step, start the moving-in animation at the starting position to present the process of the bullet screen content moving from the starting position to the starting point of the staying area;
[0061] Second step, when the bullet screen content reaches the starting point of the staying area, make the bullet screen content stay and be displayed;
[0062] Third step, when the staying duration reaches the preset duration, make the bullet screen content move to the ending point of the staying area, and then reverse the moving-in animation to present the process of the bullet screen content moving from the ending point of the staying area to the ending position.
[0063] Through the above implementation manner, the process of the bullet screen content entering, being displayed, and exiting the visible range of the information stream card can be made more smooth and beautiful. When there are multiple bullet screen contents, the carousel effect of multiple bullet screen contents can be shown through multiple bullet screen controls on the screen.
[0064] To facilitate the understanding of the above animation effect, taking an advertisement as an example, please refer to Figure 3 , Figure 3 which is a schematic diagram of the effect of the information flow display method provided by the embodiment of the present invention. In Figure 3 , the activity area and the advertisement graphic information display area are shown, which are used to display advertisement graphic information and bullet screen content respectively. The termination position, the stay area and the starting position are marked in the activity area. At the starting position, it can be seen that a bullet screen content "Very good and beautiful. Buy, buy, buy" has appeared at the starting position, and another bullet screen content "Discount. Rush, rush, rush" is displayed in the stay area. When the stay duration reaches the set duration, this bullet screen content leaves the stay area and moves towards the termination position until it slowly disappears. And the bullet screen content "Very good and beautiful. Buy, buy, buy" has moved to the stay area at this time, and the next bullet screen content "Give a thumbs up. It's so useful!" has started to move into the view range from the starting position, thus realizing the effect of carousel of multiple bullet screen contents.
[0065] In the embodiment of the present invention, the bullet screen control used in the above process is the currently idle bullet screen control. That is to say, in step S202, when the PC terminal receives the information flow and determines that there is bullet screen content, it can first judge whether there is an idle bullet screen control. This process can be executed by calling the global control pool manager mentioned in the foregoing content. It can obtain the idle bullet screen control from the head of the control queue. If the queue is empty, it will wait until a bullet screen control is released and then obtain it.
[0066] After obtaining the idle bullet screen control, it is necessary to bind the bullet screen content to the bullet screen control, that is, map the bullet screen content of types such as copywriting and picture URL to the sub-elements of the bullet screen control through data binding, so as to realize the effect of the bullet screen control carrying the bullet screen content and moving dynamically on the screen.
[0067] In an embodiment of the present invention, if the bullet screen content also contains interaction events (such as click to jump), corresponding event listeners can also be mounted in the bullet screen control to realize the response to the interaction events, thereby significantly enhancing the user's sense of participation and usage experience.
[0068] In an embodiment of the present invention, the information background can configure a bullet screen library for different types of information, and the bullet screen fields support dynamic distribution (compatible with fixed copywriting and real-time updates). When the information background sends a certain type of information (such as an advertisement) to the PC terminal, it can send the bullet screen content in the bullet screen library corresponding to this type of information to the PC terminal. After receiving the bullet screen content, the PC terminal can selectively extract several bullet screen contents for dynamic display. For example, the PC terminal can randomly extract less than or equal to 10 bullet screen contents for circular scrolling display.
[0069] In one embodiment of the present invention, the PC side can also realize the two-way binding of the bullet content in the bullet control and the bullet content in the bullet library through the property change notification interface in the desktop client graphics framework. In this way, when the information background updates the bullet library, the global control pool manager can actively refresh the bound bullet content in the bullet control without restarting the component or re-instantiating the control.
[0070] In one embodiment of the present invention, when the bullet-screen content moves out of the active area, the PC can unbind the bullet-screen content from the target bullet-screen control; insert the target bullet-screen control into the end of the idle bullet-screen control sequence, wait for the next scheduling, and realize control recycling for the next information flow display. In addition, when recycling the bullet-screen control, the transparency and initial position of the bullet-screen control can also be reset to the initial value, and the visibility can be set to hidden.
[0071] In one embodiment of the present invention, when there are specific visual elements (such as gradient background, shadow effect) in the bullet-screen content, the PC can also set the cache mode of the target bullet-screen control to the bitmap cache mode to pre-render the visual elements into a bitmap to reduce real-time rendering overhead. If there are no specific visual elements, hardware accelerated rendering can be used, that is, the visual tree of the bullet-screen control is compiled into GPU instructions for rendering through the graphics rendering pipeline of the desktop client graphics framework.
[0072] In one embodiment of the present invention, the PC side can also monitor the status and scheduling of each bullet screen control in real time. For example, the control can be run outside the UI thread for monitoring. The property can also be updated through the asynchronous execution control in the desktop client graphics framework to avoid the frame rate drop caused by the main thread blocking.
[0073] To understand the information flow display process provided by the embodiment of the present invention as a whole, please refer to Figure 4 , Figure 4 A schematic diagram of the information flow display process provided by an embodiment of the present invention, combined with Figure 4 From the above embodiments, it can be concluded that the embodiments of the present invention have the following advantages:
[0074] First, the object pool design pattern is adopted to pre-instantiate multiple bullet screen controls and permanently reside in memory. Compared with the traditional dynamic creation scheme, the embodiment of the present invention can reduce the memory usage by more than 87%, the measured peak memory is reduced from 15MB to 2MB, and the memory curve is smooth without sawtooth fluctuations, completely avoiding the jamming problem caused by the frequent triggering of the garbage collection mechanism (Garbage Collection, referred to as GC) (GC pause time is reduced by 95%). In addition, the bullet screen control natively supports the UI event bubbling mechanism, and can nest complex interactive elements, for example: hovering (Hover) triggers the QR code floating layer, and non-modal dynamic expansion is achieved through the pop-up window (Popup) and the scaling transformation function in the desktop client graphics framework; in addition, the control pool life cycle is bound to the card container window, without relying on the automatic memory management mechanism of the framework. After long-term operation (such as 7×24 hours), the memory heap state analysis shows that the memory fragmentation rate is less than 0.3%, reducing the risk of fragmentation.
[0075] Secondly, the embodiment of the present invention can adopt hardware accelerated rendering, that is, through the rendering pipeline based on graphics hardware acceleration technology in the desktop client graphics framework, the control visual tree is compiled into GPU instructions, combined with bitmap cache optimization technology, so that the information flow display requirements in complex mixed graphics and text scenarios can still maintain a frame rate of more than 60fps.
[0076] Furthermore, the animation configuration method of the embodiment of the present invention can significantly improve development efficiency. The amount of code required to achieve the same animation effect is reduced by 60% compared with the self-drawing solution. For example, the existing technology requires more lines of backend code to configure animation parameters, while the embodiment of the present invention only requires a small number of lines of declarative markup through declarative UI markup language configuration, and modifying animation parameters does not require recompiling the project.
[0077] In addition, the embodiments of the present invention can strictly constrain the moving path of the barrage control through area calibration, by accurately calculating the starting position, ending position and staying position of each stage, and coordinating the animation effects of each stage, so that the barrage can slide strictly in the vertical direction, avoiding the problem of information being blocked due to random paths in traditional solutions.
[0078] Finally, the embodiment of the present invention can also bind the event interaction layer in the bullet screen control, support the bullet screen click event and its penetration processing, and ensure that the underlying information button and the bullet screen interaction logic do not conflict with each other.
[0079] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the information flow display device is given below. Figure 5 , Figure 5Functional module diagram of the information flow display device provided in the embodiment of the present invention. It should be noted that the basic principle and technical effects of the information flow display device provided in this embodiment are the same as those in the above embodiment. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiment. The information flow display device 50 includes: a generation module 501, a binding module 502 and a display module 503.
[0080] A generation module 501 is used to generate a preset number of bullet screen controls and configure an animation effect for each bullet screen control;
[0081] The binding module 502 is used to bind the barrage content to an idle target barrage control when there is barrage content in the information stream;
[0082] The display module 503 is used to start the animation effect of the target bullet screen control to present the process of the dynamic content moving in the preset active area.
[0083] It is understandable that the generation module 501, the binding module 502 and the display module 503 can be executed in coordination. Figure 2 Each step in the process is performed to achieve the corresponding technical effect.
[0084] In an optional implementation, the binding module 502 is further configured to release the binding relationship between the barrage content and the target barrage control when the barrage content moves out of the active area; and insert the target barrage control into the end of the idle barrage control sequence.
[0085] In an optional embodiment, the display module 503 is specifically used to determine the active area according to the container size of the information flow and the size of the barrage control; wherein the active area includes a starting position, an ending position and a staying area; starting the moving-in animation at the starting position to present the process of the barrage content moving from the starting position to the starting point of the staying area; when the barrage content reaches the starting point of the staying area, the barrage content stops for display; when the staying time reaches a preset time, the barrage content moves to the end point of the staying area, and then the moving-in animation is executed in reverse to present the process of the barrage content moving from the end point of the staying area to the ending position.
[0086] In an optional implementation, the generation module 501 is specifically used to initialize a preset number of control instances; configure a container and an event binding layer corresponding to different types of bullet screen content for each control instance to obtain a bullet screen control.
[0087] In an optional implementation, the binding module 502 is also used to mount an event listener corresponding to the interactive event for the target barrage control if there is an interactive event in the barrage content.
[0088] In an alternative embodiment, the information flow display device 50 further includes an update module, configured to update the barrage content bound to the target barrage control through the global control pool manager when the barrage content is updated in the information background.
[0089] In an alternative embodiment, the information flow display device 50 further includes a rendering module, configured to set the caching mode of the target barrage control to a bitmap caching mode when there are specific visual elements in the barrage content, so as to pre-render the visual elements as bitmaps.
[0090] It should be noted that the division of modules in the above embodiments of the present application is illustrative, only a logical function division. In actual implementation, there may be other division methods. In addition, in each embodiment of the present application, each functional unit may be integrated in a processing unit, may exist independently physically, or two or more units may be integrated in one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional units.
[0091] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., which can store program executable codes.
[0092] The embodiment of the present invention further provides a computer device. Please refer to Figure 6 , Figure 6 which is a structural block diagram of the computer device provided by the embodiment of the present invention, including: a memory 601, a processor 602, and a communication interface 603. The memory 601, the processor 602, and the communication interface 603 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components may be electrically connected to each other through one or more communication buses or signal lines.
[0093] Optionally, the bus can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 only a thick line is used in Figure 6 , but it does not mean that there is only one bus or one type of bus.
[0094] In an embodiment of the present invention, the processor 602 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The software module can be located in the memory 601, and the processor 602 reads the program instructions in the memory 601 and combines its hardware to complete the steps of the above method.
[0095] In an embodiment of the present invention, the memory 601 can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., and can also be a volatile memory, such as RAM. The memory can also be any other medium that can be used to carry or store the desired program executable code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiments of the present invention can also be a circuit or any other device capable of implementing a storage function, for storing instructions and / or data.
[0096] The memory 601 can be used to store software programs and modules, such as the instructions / modules of the information flow display device 50 provided in the embodiments of the present invention, and can be stored in the memory 601 in the form of software or firmware, or solidified in the operating system (OS) of the computer device 60. The processor 602 executes various functional applications and data processing by executing the software programs and modules stored in the memory 601. The communication interface 603 can be used for signaling or data communication with other node devices.
[0097] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working processes of the devices and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0098] It can be understood that Figure 6 The structure shown is only schematic, and the computer device 60 may further include more or fewer components than those shown in Figure 6 or have a different configuration from that shown in Figure 6 shown. Figure 6 Each of the components shown may be implemented by hardware, software, or a combination thereof.
[0099] Based on the above embodiments, the present application further provides a storage medium. A computer program is stored in the computer storage medium. When the computer program is executed by a computer, the computer is caused to execute the information flow display method provided in the above embodiments.
[0100] Based on the above embodiments, the embodiments of the present invention further provide a computer program. When the computer program runs on a computer, the computer is caused to execute the information flow display method provided in the above embodiments.
[0101] Based on the above embodiments, the embodiments of the present invention further provide a chip. The chip is used to read the computer program stored in the memory and is used to execute the information flow display method provided in the above embodiments.
[0102] The embodiments of the present invention further provide a computer program product, including instructions. When the instructions run on a computer, the computer is caused to execute the information flow display method provided in the above embodiments.
[0103] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by instructions. These instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0104] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions in the process Figure 1one process or multiple processes and / or boxes Figure 1 the functions specified in one box or multiple boxes.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process or multiple processes and / or boxes Figure 1 one process or multiple processes and / or boxes Figure 1 the steps of the functions specified in one box or multiple boxes.
[0106] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for displaying information flow, characterized in that, The method comprises: Generate a preset number of bullet screen controls, and configure an animation effect for each of the bullet screen controls; When there is barrage content in the information stream, the barrage content is bound to an idle target barrage control; Start the animation effect of the target bullet screen control to present the process of the bullet screen content moving within the preset active area.
2. The information flow display method according to claim 1, wherein The method further comprises: When the bullet screen content moves out of the active area, releasing the binding relationship between the bullet screen content and the target bullet screen control; The target bullet screen control is inserted into the tail of the idle bullet screen control sequence.
3. The information flow display method according to claim 1, wherein Starting the animation effect of the target bullet screen control to present the process of the bullet screen content moving in a preset active area includes: Determine the active area according to the container size of the information stream and the size of the bullet screen control; wherein the active area includes a starting position, an ending position and a stay area; Starting a moving-in animation at the starting position to present a process in which the bullet screen content moves from the starting position to the starting point of the stay area; When the bullet screen content reaches the starting point of the stop area, the bullet screen content is stopped for display; When the stay time reaches the preset time, the bullet screen content is moved to the end of the stay area, and then the moving animation is executed in reverse to present the process of the bullet screen content moving from the end of the stay area to the end position.
4. The information flow display method according to claim 1, wherein Generate a preset number of bullet screen controls, including: Initialize a preset number of control instances; A container and an event binding layer corresponding to different types of bullet-screen content are configured for each of the control instances to obtain the bullet-screen control.
5. The information flow display method according to any one of claims 1 to 4, characterized in that The method further comprises: If there is an interactive event in the bullet screen content, an event listener corresponding to the interactive event is mounted for the target bullet screen control.
6. The information flow display method according to any one of claims 1 to 4, characterized in that The method further comprises: When the information background updates the barrage content, the barrage content bound to the target barrage control is updated through the global control pool manager.
7. The information flow display method according to any one of claims 1 to 4, characterized in that The method further comprises: When there are specific visual elements in the bullet-screen content, the cache mode of the target bullet-screen control is set to a bitmap cache mode to pre-render the visual elements into a bitmap.
8. An information flow display device, characterized in that, include: Generate module, bind module and display module; The generating module is used to generate a preset number of bullet screen controls and configure an animation effect for each of the bullet screen controls; The binding module is used to bind the barrage content to an idle target barrage control when there is barrage content in the information stream; The display module is used to start the animation effect of the target bullet screen control to present the process of the bullet screen content moving in a preset active area.
9. A computer device, characterized in that, It includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the information flow display method described in any one of claims 1 to 7.
10. A readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, the information flow display method according to any one of claims 1 to 7 is implemented.