Direct broadcasting room switching method and device
By requesting in advance in network live broadcast and temporarily storing preload data from adjacent live broadcast rooms, the problem of slow switching of live broadcast rooms is solved, achieving a smoother switching experience and higher user participation.
Patent Information
- Application Number
- CN202411259927.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-03
AI Technical Summary
In online live broadcast, the live broadcast room switching is slow, time-consuming and severe lag, making it difficult to meet the requirements of real-time switching, affecting the user's viewing experience.
When displaying the first live broadcast room on the live broadcast page, the preload data of multiple adjacent live broadcast rooms is requested in advance and temporarily stored into the cache area. In response to the sliding switching operation, the preload data of the second live broadcast room is quickly obtained and displayed from the cache area. , optimize loading speed and switch response speed.
It significantly reduces the time-consuming first frame, improves the smoothness and user experience of live broadcast room switching, improves user participation and retention rate, and meets users' personalized needs.
Smart Images

Figure CN119065572A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of network live broadcast technology, and in particular, to a live broadcast room switching method, device, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid popularization of Internet technology, online live broadcasting is being accepted and loved by more and more people. Online live broadcasting involves: live broadcasting platform, anchor terminal and audience terminal. The anchor terminal can provide multimedia content (such as video and audio) to the audience terminal through the live broadcasting platform, and can also receive multimedia content (such as bullet screen and gifts) provided by the audience terminal through the live broadcasting platform, so as to achieve the effect of live broadcast and interaction.
[0003] During the live broadcast process, the live broadcast platform can recommend multiple live broadcast rooms to users. For the audience terminal, it can switch from one live broadcast room to another based on user gestures.
[0004] However, the above switching still has the following problems: the live broadcast room switched to has a slow loading speed, takes a long time, and has serious lags, which makes it difficult to meet the requirements of real-time switching and greatly affects the viewing experience.
[0005] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention
[0006] The embodiments of the present application provide a live broadcast room switching method, apparatus, computer equipment, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.
[0007] One aspect of an embodiment of the present application provides a method for switching between live broadcast rooms, the method comprising:
[0008] When the live broadcast page displays the first live broadcast room, pre-loaded data of multiple first adjacent live broadcast rooms are temporarily stored in the cache area;
[0009] In response to a sliding switching operation on the live broadcast page, determining a second live broadcast room, and switching the first live broadcast room in the live broadcast page to the second live broadcast room, where the second live broadcast room is one of the plurality of first adjacent live broadcast rooms;
[0010] Among them, in a first time period in response to the sliding switching operation, the preloaded data of the second live broadcast room is obtained from the cache area, and the preloaded data of the second live broadcast room is pre-displayed on the live broadcast page.
[0011] Optionally, the sliding switching operation includes a pressing operation, a dragging operation and a lifting operation performed continuously on the touch screen;
[0012] Correspondingly, in the first time period in response to the sliding switching operation, obtaining the preloaded data of the second live broadcast room from the cache area includes:
[0013] The time point when the lifting operation is performed is taken as the starting time point of the first time period, and the preloaded data of the second live broadcast room is obtained from the cache area.
[0014] Optionally, temporarily storing the preloaded data of the plurality of first adjacent live broadcast rooms in a cache area includes:
[0015] Determine a live broadcast room list, wherein the live broadcast room list includes a first live broadcast room and a plurality of other live broadcast rooms;
[0016] According to the position of the first live broadcast room in the live broadcast room list, the plurality of first adjacent live broadcast rooms are selected from the plurality of other live broadcast rooms according to a preset rule;
[0017] Determine the preloading priority of each first adjacent live broadcast room according to the distance between each first adjacent live broadcast room and the first live broadcast room;
[0018] Based on the preloading priority of each first adjacent live broadcast room, the preloading data of the multiple first adjacent live broadcast rooms are obtained in sequence.
[0019] Optionally, the live broadcast room switching method further includes:
[0020] In a case where the second live broadcast room is displayed on the live broadcast page, determining a plurality of second adjacent live broadcast rooms of the second live broadcast room;
[0021] Temporarily storing the preloaded data of the plurality of second adjacent live broadcast rooms in the cache area;
[0022] Among them, the preloaded data of some live broadcast rooms among the multiple first adjacent live broadcast rooms are deleted from the cache area; the part of the live broadcast rooms whose preloaded data are deleted are not the second adjacent live broadcast rooms.
[0023] Optionally, the live broadcast room switching method further includes:
[0024] In response to an exit operation on the live broadcast page, the preloaded data of each live broadcast room in the cache area is deleted.
[0025] Optionally, the preloaded data includes video data;
[0026] Correspondingly, switching the first live broadcast room in the live broadcast page to the second live broadcast room includes:
[0027] Switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page;
[0028] Among them, during the scrolling of the page: the live broadcast component of the first live broadcast room is released and the associated tasks of the first live broadcast room are canceled, the live broadcast component includes a playback component and an interactive component; the playback component of the second live broadcast room is created, and based on the playback component, the video data of the second live broadcast room is displayed.
[0029] Optionally, the preloaded data includes video data;
[0030] Correspondingly, switching the first live broadcast room in the live broadcast page to the second live broadcast room includes:
[0031] Switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page;
[0032] Among them, during the scrolling of the page: releasing the interactive components of the first live broadcast room and canceling the associated tasks of the first live broadcast room; initializing the playback components of the first live broadcast room; based on the initialized playback components, displaying the video data of the second live broadcast room.
[0033] Optionally, the live broadcast room switching method further includes:
[0034] After the page scrolling is completed, creating an interactive component of the second live broadcast room in the live broadcast page;
[0035] Among them, the interactive components include one or more of the barrage area, anchor information area, tool area, widget area, and gift animation area.
[0036] Optionally, creating an interactive component of the second live broadcast room in the live broadcast page includes:
[0037] Configure the priority or trigger conditions for each interactive component according to preset rules;
[0038] According to the priority or triggering condition of each interactive component, multiple interactive components are created in the live broadcast page in sequence.
[0039] Optionally, canceling the associated task of the first live broadcast room includes:
[0040] Acquire multiple task modules associated with the first live broadcast room, each task module including one or more tasks;
[0041] A cancel operation is performed on the plurality of task modules.
[0042] Optionally, canceling the associated task of the first live broadcast room includes:
[0043] Obtaining a task management module associated with the first live broadcast room, wherein the task management module includes a plurality of task modules, and each task module includes one or more tasks;
[0044] Each task module in the task management module is traversed, and a reset operation is performed on each task module.
[0045] Optionally, canceling the associated task of the first live broadcast room includes:
[0046] When the main thread receives the processing result of the asynchronous task, checking whether the asynchronous task has executed the cancellation operation;
[0047] If the asynchronous task does not perform a cancellation operation, verifying and converting the processing result of the asynchronous task;
[0048] In the case that the asynchronous task has executed a cancellation operation, the processing result of the asynchronous task is deleted.
[0049] Optionally, the live broadcast page includes a bullet screen area of the first live broadcast room, and the method further includes:
[0050] Obtaining a sliding operation on the live broadcast page, and determining whether the sliding operation is located in the bullet screen area;
[0051] When the sliding area is located in the bullet screen area, obtaining a state of the bullet screen area;
[0052] In the case where the bullet screen area has scrolled to a boundary, determining the sliding operation as the sliding switching operation;
[0053] When the bullet screen area has not scrolled to the boundary: in response to the sliding operation, the bullet screen area is scrolled and displayed until the bullet screen area scrolls to the boundary; when the bullet screen area scrolls to the boundary, the elastic special effects of the bullet screen area are displayed.
[0054] Another aspect of an embodiment of the present application provides a live broadcast room switching device, the device comprising:
[0055] A preloading module, used for temporarily storing preloaded data of a plurality of first adjacent live broadcast rooms in a cache area when the live broadcast page displays the first live broadcast room;
[0056] A switching module, configured to determine a second live broadcast room in response to a sliding switching operation on the live broadcast page, and switch the first live broadcast room in the live broadcast page to the second live broadcast room, where the second live broadcast room is one of the plurality of first adjacent live broadcast rooms;
[0057] Among them, in a first time period in response to the sliding switching operation, the preloaded data of the second live broadcast room is obtained from the cache area, and the preloaded data of the second live broadcast room is pre-displayed on the live broadcast page.
[0058] Another aspect of an embodiment of the present application provides a computer device, including:
[0059] at least one processor; and
[0060] a memory communicatively coupled to the at least one processor;
[0061] Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0062] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0063] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the above-mentioned method when executed by a processor.
[0064] The above technical solution adopted in the embodiment of the present application may have the following advantages:
[0065] When the first live broadcast room is displayed on the live broadcast page, preloaded data of multiple live broadcast rooms adjacent to the first live broadcast room (first adjacent live broadcast rooms) are requested in advance and temporarily stored in the cache area. In this way, in the first time period of switching the live broadcast room, the preloaded data of the second live broadcast room (one of the multiple first adjacent live broadcast rooms) can be quickly obtained and displayed on the live broadcast page. It can be seen that the embodiment of the present application can optimize the loading speed and the response speed of the live broadcast room switching by preloading data and adjusting the playback timing, quickly display the content of the live broadcast room being switched to, and significantly improve the smoothness of the live broadcast room switching, effectively improving the user viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0067] Figure 1 The operating environment diagram of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0068] Figure 2 The flowchart of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0069] Figure 3 Schematically shows Figure 2 Flow chart of sub-steps of step S200;
[0070] Figure 4 A newly added flow chart of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0071] Figure 5 A live broadcast room list diagram according to the live broadcast room switching method of the first embodiment of the present application is schematically shown;
[0072] Figure 6 A schematic diagram showing a comparison of the playback timing before and after adjustment of the live broadcast room switching method according to the first embodiment of the present application;
[0073] Figure 7 The live broadcast component loading flow chart of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0074] Figure 8 The task management module of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0075] Fig. 9 A newly added flow chart of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0076] Fig.10 The asynchronous task processing flow of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0077] Fig.11 Another asynchronous task processing flow of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0078] Fig.12 A player multiplexing diagram of a live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0079] Fig.13 A newly added flow chart of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0080] Fig.14 The bullet screen area in the live broadcast interface of the live broadcast room switching method according to the first embodiment of the present application is schematically shown;
[0081] Fig.15 The following schematically shows the application effect diagram of the live broadcast room switching method according to the first embodiment of the present application;
[0082] Fig.16 The following schematically shows the application effect diagram of the live broadcast room switching method according to the first embodiment of the present application;
[0083] Fig.17 A block diagram of a live broadcast room switching device according to Embodiment 2 of the present application is schematically shown; and
[0084] Fig.18 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0085] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0086] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0087] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.
[0088] First, the following terms are explained:
[0089] UI (User Interface): User interface.
[0090] Story on demand: Users select and play short videos, audio and other media content stored on the server according to their needs.
[0091] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below:
[0092] During the live broadcast process, the live broadcast platform can recommend multiple live broadcast rooms to users. For the audience terminal, it can switch from one live broadcast room to another based on user gestures (such as sliding up and down).
[0093] However, the applicant has learned that compared with Story on-demand switching, the switching between live broadcast rooms still has the following problems: the live broadcast room switched to loads slowly, takes a long time, and has serious lags, which makes it difficult to meet the requirements of real-time switching and greatly affects the viewing experience.
[0094] To this end, the embodiment of the present application provides a technical solution for switching between live broadcast rooms. In this technical solution: (1) The time consumption of the first frame (entering the room for the first time and sliding up and down to enter the room) is reduced by 52%, and the time consumption of the first frame of sliding up and down is reduced from 544ms to 334ms, a decrease of 38%, with obvious effects; (2) The proportion of entering the live broadcast room by sliding up and down is increased by 40%+, which increases user participation and improves user retention rate. The platform can recommend high-quality live broadcast rooms based on the user's sliding behavior to better meet the user's personalized needs; (3) The fluency and display effect of switching between live broadcast rooms by sliding up and down have been significantly improved and enhanced, and the user's interactive experience is smoother and freer. See below for details.
[0095] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0096] like Figure 1 As shown, the operating environment diagram may include: service platform 2, anchor terminals (4A, 4B, ..., 4M), and audience terminals (6A, 6B, ..., 6N). In the live broadcast scenario, the anchor terminal (4A, 4B, ..., 4M) logs in to the service platform 2, and the service platform 2 pushes the live broadcast data to the audience terminal (6A, 6B, ..., 6N) in real time.
[0097] Service platform 2 can provide live broadcast service, which can be a single server, a server cluster or a cloud computing service center.
[0098] The anchor terminal (4A, 4B, ..., 4M) is used to generate live broadcast data in real time and perform streaming operations on the live broadcast data. The live broadcast data may include audio data or video data. The anchor terminal may be an electronic device such as a smart phone or a tablet computer. Of course, the anchor terminal may be a virtual computing instance in the service platform 2.
[0099] The audience terminal (6A, 6B, ..., 6N) can be configured to receive the live broadcast data of the anchor terminal in real time. The audience terminal (6A, 6B, ..., 6N) can be any type of computing device, such as a smart phone, a tablet device, a laptop computer, a smart TV, a car terminal, etc. The audience terminal (6A, 6B, ..., 6N) can have a built-in browser or a special program, and receive the live broadcast data through the browser or the special program to output content to the user. The content may include video, audio, comments, text data and / or the like.
[0100] The audience terminal (6A, 6B, ..., 6N) may include a player. The player outputs (e.g., displays, presents) content to the user. The content may include video, audio, comments, text data and / or the like. The audience terminal (6A, 6B, ..., 6N) may include an interface, which may include an input element (touch screen). For example, the input element may be configured to receive user instructions, which may enable the audience terminal (6A, 6B, ..., 6N) to perform various operations, such as sending a bullet screen, entering a comment, giving a gift, etc.
[0101] The anchor terminals (4A, 4B, ..., 4M), the audience terminals (6A, 6B, ..., 6N) and the service platform 2 may be connected via a network. The network may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls and / or proxy devices, etc. The network may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof and / or the like. The network may include wireless links, such as cellular links, satellite links, Wi-Fi links and / or the like.
[0102] It should be noted that the number of the host terminals and the audience terminals in the figure is only for illustration and is not used to limit the scope of patent protection of this application. According to actual conditions, there can be any number of host terminals and audience terminals.
[0103] The following uses the viewer terminal (such as 4A) as the execution subject to introduce the technical solution of the present application through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be interpreted as being limited to the embodiments described here.
[0104] Embodiment 1
[0105] Figure 2 The flowchart of the live broadcast room switching method according to the first embodiment of the present application is schematically shown.
[0106] like Figure 2 As shown, the live room switching method may include steps S200 to S202, wherein:
[0107] Step S200, when the live broadcast page displays the first live broadcast room, the preloaded data of multiple first adjacent live broadcast rooms are temporarily stored in the cache area.
[0108] Step S202: In response to a sliding switch operation on the live page, a second live room is determined, and the first live room in the live page is switched to the second live room, where the second live room is one of the plurality of first adjacent live rooms. In the first time period in response to the sliding switch operation, preloaded data of the second live room is obtained from the cache area, and the preloaded data of the second live room is pre-displayed on the live page.
[0109] The live room switching method provided in this embodiment requests the preloaded data of multiple live rooms adjacent to the first live room (first adjacent live rooms) in advance when the live page displays the first live room, and temporarily stores them in the cache area. In this way, in the first time period of switching the live room, the preloaded data of the second live room (one of the multiple first adjacent live rooms) can be quickly obtained and displayed on the live page. It can be seen that the embodiment of the present application can optimize the loading speed and the response speed of the live room switching by preloading data and adjusting the playback timing, quickly display the content of the live room being switched to, and significantly improve the smoothness of the live room switching, effectively improving the user viewing experience.
[0110] The following combination Figure 2 , each step in steps S200 to S202 and other optional steps are described in detail.
[0111] Step S200 , when the live broadcast page displays the first live broadcast room, the preloaded data of multiple first adjacent live broadcast rooms are temporarily stored in the cache area.
[0112] The live page can display multiple live rooms in a waterfall flow or other predetermined manner, and the audience can quickly browse multiple live rooms continuously by sliding (such as sliding up and down) the live page. Among them, the first live room can refer to the live room currently being displayed on the live page. Figure 5 As shown, the data of multiple live broadcast rooms can be requested from the live broadcast platform in advance to form a live broadcast room list. The live broadcast room list can include the data of the first live broadcast room and the data of the first adjacent live broadcast room. In the live broadcast room list, the data of the first adjacent live broadcast room can be the first m and the last n of the data of the first live broadcast room. Among them, m and n can be set dynamically.
[0113] The preloaded data can be video data, audio data or other data. In actual applications, when switching live rooms, the display time of the first video frame of the next live room will directly affect the user experience. The first frame time is determined according to the processes of requesting the playback address, data downloading, and data parsing. Exemplarily, before switching the live room, the playback address can be requested in advance to load and cache part of the video data of the next live room to reduce the first frame time and achieve the purpose of fast start. Based on the actual situation (the switching direction, the switched live room, the number of executions of the sliding switching operation, etc. are unknown), multiple first adjacent live rooms can also be determined based on the live room list, and the preloaded data of multiple first adjacent live rooms can be temporarily stored in the cache area, thereby further improving the smoothness and response speed of the live room switching.
[0114] Preloading can adopt a variety of strategies, such as synchronous loading, hierarchical loading, etc., to further optimize the viewing experience. Several exemplary solutions are provided below.
[0115] In an optional embodiment, if Figure 3 As shown, step S200 may include:
[0116] Step S300, determining a live broadcast room list, wherein the live broadcast room list includes a first live broadcast room and multiple other live broadcast rooms.
[0117] Step S302: According to the position of the first live broadcast room in the live broadcast room list, the plurality of first adjacent live broadcast rooms are selected from the plurality of other live broadcast rooms according to a preset rule.
[0118] Step S304: determining the preloading priority of each first adjacent live broadcast room according to the distance between each first adjacent live broadcast room and the first live broadcast room.
[0119] Step S306: based on the preloading priority of each first adjacent live broadcast room, the preloading data of the multiple first adjacent live broadcast rooms are obtained in sequence.
[0120] Exemplarily, a live broadcast room list can be determined, which includes data of the first live broadcast room and multiple other live broadcast rooms, such as x live broadcast rooms above the first live broadcast room and y live broadcast rooms below the first live broadcast room, and x and y can be set by yourself. According to the position of the first live broadcast room in the live broadcast room list, based on the user switching frequency, bandwidth limitation, network environment, system load, etc., multiple first adjacent live broadcast rooms are selected from multiple other live broadcast rooms, such as m live broadcast rooms above and n live broadcast rooms below. It is also possible to configure a preloading priority for each first adjacent live broadcast room according to the distance between each first adjacent live broadcast room and the first live broadcast room. For example: the higher the preloading priority of the directly adjacent live broadcast room, the lower the preloading priority of other live broadcast rooms, which is more in line with the user's switching habits. According to the preloading priority of each first adjacent live broadcast room, the preloading data of multiple first adjacent live broadcast rooms are obtained in turn and temporarily stored in the cache area. Exemplarily, Figure 5 The sequence number in can represent the preloading priority of the first adjacent live broadcast room.
[0121] In this embodiment, some live broadcast rooms are selected from the live broadcast room list for preloading, which can save resources and reduce the impact on the first live broadcast room currently being played, so as to avoid freezing in the live broadcast room currently being watched. Priority is configured for some selected live broadcast rooms, and hierarchical preloading can further optimize the smoothness and response speed of live broadcast room switching.
[0122] In an optional embodiment, if Figure 4 As shown, the live room switching method may also include:
[0123] Step S400, when the live broadcast page displays the second live broadcast room, determine a plurality of second adjacent live broadcast rooms of the second live broadcast room.
[0124] Step S402, temporarily storing the preloaded data of the plurality of second adjacent live broadcast rooms in the cache area. The preloaded data of some of the plurality of first adjacent live broadcast rooms are deleted from the cache area; the part of the live broadcast rooms whose preloaded data are deleted are not the second adjacent live broadcast rooms.
[0125] Exemplarily, when the live broadcast page displays the second live broadcast room, multiple second adjacent live broadcast rooms can also be selected according to the position of the second live broadcast room in the live broadcast room list. The specific selection rules can refer to the above-mentioned method for selecting the first adjacent live broadcast room. After selecting the second adjacent live broadcast room, each first adjacent live broadcast room can be compared to see whether it belongs to the second adjacent live broadcast room. If it does, the pre-loaded data of this type of first adjacent live broadcast room in the cache area is retained and used as the cache data corresponding to the second adjacent live broadcast room to achieve cache reuse. The data of the first adjacent live broadcast room that does not belong to the second adjacent live broadcast room is deleted from the cache area to reduce resource usage. It is also possible to request the playback address to load the data of the second adjacent live broadcast room that is not in the cache area, or the pre-loaded data of multiple second adjacent live broadcast rooms.
[0126] In this embodiment, each time the live broadcast room is switched, the cache within the upper m and lower n of the second live broadcast room can be retained, and the cache outside the upper m and lower n can be cancelled to achieve cache reuse, further improving loading efficiency and switching speed.
[0127] In an optional embodiment, the live broadcast room switching method may further include: in response to an exit operation on the live broadcast page, deleting the preloaded data of each live broadcast room in the cache area.
[0128] In this embodiment, all preloading can be canceled when exiting the live broadcast room to prevent bandwidth waste, avoid data accumulation, reduce memory usage, and optimize performance.
[0129] In some embodiments, the preloading strategy can be further optimized, for example: preloading timing, preloading data size, etc. For example, after the playback process of the live broadcast room (first live broadcast room) currently displayed on the live broadcast page is completed, preloading can be turned on to avoid the current live broadcast room being stuck due to network speed competition caused by loading too early, and at the same time avoid the preloading mechanism being almost ineffective due to loading too late. The playback process may include: player creation, obtaining playback address, network connection, audio and video data download, data decoding, rendering, etc. The playback process may also include UI services, such as: UI component creation, room state interface request, user state interface request, business data processing, UI component refresh, etc. For example, the amount of preloaded data can also be controlled, such as preloading video data of about 4s to reduce resource usage.
[0130] Step S202In response to a sliding switch operation on the live page, a second live room is determined, and the first live room in the live page is switched to the second live room, where the second live room is one of the plurality of first adjacent live rooms. In a first time period in response to the sliding switch operation, preloaded data of the second live room is obtained from the cache area, and the preloaded data of the second live room is pre-displayed on the live page.
[0131] The sliding switching operation can be an up and down slide or a left and right slide on the live broadcast page, which is used to switch the current live broadcast room in the live broadcast page to the next live broadcast room. Among them, the second live broadcast room can be used to refer to the next live broadcast room (switching target). The second live broadcast room can be one of multiple first adjacent live broadcast rooms. Exemplarily, if the sliding switching operation is once, the second live broadcast room can be a live broadcast room directly adjacent to the first live broadcast room, that is, the live broadcast room above the first live broadcast room or the live broadcast room below the first live broadcast room. If the sliding switching operation is continuous for multiple times, the second live broadcast room can be a live broadcast room that is separated from the first live broadcast room in the live broadcast room list, such as the kth live broadcast room above the first live broadcast room or the kth live broadcast room below the first live broadcast room, where k is determined according to the number of sliding switching operations.
[0132] In actual applications, the sliding switching operation may include a pressing operation, a dragging operation, and a lifting operation continuously performed by the audience on the touch screen of the audience terminal. The first time period is equivalent to the playback time of the second live broadcast room. When the first time period is turned on, the preloaded data of the second live broadcast room can be loaded from the cache area and displayed on the live broadcast page. The first time period can have multiple settings, for example: when performing a drag operation, obtain the drag direction of the drag operation (up or down), and the drag direction can be used to determine the next live broadcast room (the second live broadcast room). After determining the drag direction, the first time period can be started. The first time period can also be started after the lift operation is performed or the page scrolling ends. An exemplary scheme will be provided below.
[0133] In an optional embodiment, the step S202 may include: taking the time point when the lifting operation is performed as the starting time point of the first time period, and obtaining the preloaded data of the second live broadcast room from the cache area.
[0134] like Figure 6As shown, in the scene of sliding up and down to switch between live broadcast rooms, the data of the next live broadcast room can be loaded after the page stops scrolling. The time point of performing the lifting operation can also be used as the starting time point of the first time period, that is, when the finger is lifted, the next live broadcast room (the second live broadcast room) can be calculated, and the pre-loaded data of the second live broadcast room can be obtained from the cache area and displayed on the live broadcast page. This embodiment adjusts the playback timing from the page scrolling stop to the finger lifting, which can save about 300ms of the first frame time, faster loading speed, and smoother switching sensation.
[0135] In this embodiment, by preloading data and adjusting the playback timing, the loading speed of the next live broadcast room and the response speed of the live broadcast room switching can be improved. The first frame of the live broadcast room switched to can be quickly displayed, the switching smoothness is significantly improved, and the user viewing experience is greatly improved.
[0136] The above-mentioned multiple embodiments optimize the response speed of live room switching by preloading data and adjusting the playback timing. In the following, multiple exemplary embodiments will be provided to systematically optimize the switching of live rooms in combination with multiple processes of the live broadcast service.
[0137] In an optional embodiment, step S202 may include: switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page. In the process of scrolling the page: releasing the live broadcast component of the first live broadcast room and canceling the associated tasks of the first live broadcast room, the live broadcast component includes a playback component and an interactive component; creating a playback component of the second live broadcast room, and displaying the video data of the second live broadcast room based on the playback component.
[0138] In the live broadcast page, displaying the live broadcast room involves multiple live broadcast components. Exemplarily, the live broadcast components may include playback components (players) and interactive components (business UI components). Among them, the interactive components may include one or more of the anchor information area, tool area, widget area, barrage area (interactive barrage area / floating barrage area), and gift animation area. In order to switch between live broadcast rooms, during the scrolling of the page, it is necessary to destroy the previous live broadcast room (the first live broadcast room) and prepare the next live broadcast room (the second live broadcast room). Therefore, during the scrolling of the page, the live broadcast components of the first live broadcast room can be uninstalled and destroyed, and the live broadcast components of the second live broadcast room can be created. Due to the large number of live broadcast components and the complex view hierarchy, one-time loading will occupy the main thread for a long time, resulting in the smoothness of sliding switching being affected. Therefore, if Figure 7 As shown, in order to further improve the smoothness of sliding switching, the playback component of the second live broadcast room can be created first, that is, the player is loaded first. At the same time, the preloaded data of the second live broadcast room is obtained from the cache area and displayed through the playback component.
[0139] In the above method, a new player needs to be created when the first live broadcast room switches to the second live broadcast room. This solution has further room for optimization. In an optional embodiment, during the scrolling of the page: the interactive components of the first live broadcast room are released and the associated tasks of the first live broadcast room are canceled; the playback components of the first live broadcast room are initialized; based on the initialized playback components, the video data of the second live broadcast room is displayed.
[0140] like Fig.12 As shown, when the first live broadcast room is destroyed, the playback component of the first live broadcast room may not be released. The playback component is initialized, and the initialized playback component is directly used to play the next video, that is, directly used as the playback component of the second live broadcast room, so as to achieve player reuse. In this embodiment, the time-consuming creation of the player can be saved during the up and down sliding process through player reuse, reducing the impact on the smoothness of sliding switching.
[0141] In an optional embodiment, step S202 may further include: step S500, creating an interactive component of the second live broadcast room in the live broadcast page after the page scrolling is completed. Exemplarily, other components (such as interactive components) can be loaded after the page scrolling is completed. In this embodiment, the player and other view components are loaded separately, which can reduce the time consumed in displaying the first frame of the second live broadcast room and provide users with a better experience. The loading strategy of other components can be set according to actual conditions, for example: one-time loading or batch loading. An exemplary solution is provided below.
[0142] In an optional embodiment, step S500 may include:
[0143] Step S600: configuring a priority or trigger condition for each interactive component according to a preset rule.
[0144] Step S602: Create multiple interactive components in the live broadcast page in sequence according to the priority or trigger condition of each interactive component.
[0145] In actual applications, the interactive components can be loaded at one time after the page scrolling is completed. In the case where some interactive components need to be triggered by specific conditions, a one-time loading will affect the display time of other interactive components, occupy the main thread for a long time, and affect the smoothness of sliding switching. This embodiment can adopt a progressive loading scheme for interactive components, configure priorities or trigger conditions for each interactive component, and create multiple interactive components in the live page in sequence according to the priorities or trigger conditions. For example: let the components with high priority load first, so that the main view (component) can be loaded first, then the secondary view can be loaded, and finally the view that is triggered by specific conditions can be loaded, breaking up the timing of view loading, reducing the pressure on the main thread, and further optimizing the sliding switching experience.
[0146] In actual business, the first live broadcast room will also have a large number of asynchronous, delayed, and scheduled tasks, as well as delayed or specific scenario-triggered interface requests. Most of these tasks need to be executed in the main thread, which affects the smoothness of the sliding switch, resulting in long sliding switching time, severe jamming, and poor user experience. Therefore, the associated tasks of the first live broadcast room can be canceled during the page scrolling process. There are many ways to cancel, and some exemplary solutions are provided below.
[0147] In an optional embodiment, canceling the associated tasks of the first live broadcast room may include: obtaining multiple task modules associated with the first live broadcast room, each task module including one or more tasks; and performing a cancel operation on the multiple task modules.
[0148] For example, all task modules associated with the first live broadcast room can be enumerated during the up and down sliding process, and each task module includes one or more tasks. By calling the cancel method for all task modules, the associated tasks of the first live broadcast room can be canceled. The overall change of the solution of this embodiment is small, and the operation logic is simple, but it is easy to deteriorate. New services need to manually call the cancel method, which increases the maintenance workload.
[0149] In an optional embodiment, canceling the associated task of the first live broadcast room may further include: obtaining a task management module associated with the first live broadcast room, the task management module including multiple task modules, each task module including one or more tasks, traversing each task module in the task management module, and performing a reset operation on each task module.
[0150] For example, a task management module can be established to centrally manage all task modules. During the sliding process, all task modules are reset. Figure 8 As shown, RoomContext can be used to manage the context of the first live broadcast room. Through RoomContext, the instance object of the task module associated with the first live broadcast room can be obtained to perform business logic processing. <basemodule>) can be used to store the task modules associated with the first live broadcast room, such as: BottomBarModule (the tool module at the bottom of the live broadcast room, which can be used for the management of bullet screen input box, gift sending, quick gift sending, microphone connection, user rights center and other entrances), TopBarModule (the top module of the live broadcast room, which can include anchor information, online list, setting entrance, etc.), PendantModule (the widget area module, which can be used to display configured activities, red envelopes, microphone connection and other widgets), RedPacketModule (the red envelope module, which can be used to process the logic related to red envelopes, including the display and hiding of the red envelope entrance in the widget area, the red envelope click pop-up window, etc.). When sliding up and down, you can traverse the task modules in modules and call the resetData method to reset the operation. Although the scheme of this embodiment has been greatly changed, it is friendly to new businesses, and new businesses do not need additional processing, which effectively prevents degradation.
[0151] In an optional embodiment, if Fig. 9 As shown, canceling the associated task of the first live broadcast room may also include:
[0152] Step S700: When the main thread receives the processing result of the asynchronous task, it checks whether the asynchronous task has executed the cancellation operation.
[0153] Step S702: When the asynchronous task does not perform a cancel operation, verify and convert the processing result of the asynchronous task.
[0154] Step S704: when the asynchronous task has executed a cancel operation, delete the processing result of the asynchronous task.
[0155] In actual applications, some interface requests will be triggered from time to time in the live broadcast room. Some are triggered when entering the room (live broadcast room), such as resources, room configuration, etc. Some are triggered when receiving broadcasts or specific scenarios. The network library of the live broadcast business further encapsulates the network library of the infrastructure, adding capabilities such as data validation and data model conversion. However, these tasks will eventually be asynchronously thrown to the main thread for processing. If these tasks are performed during the sliding switch of the live broadcast room, it will affect the smoothness of the sliding switch. Therefore, it is necessary to cancel these tasks to reduce the pressure on the main thread. Taking the network request as an example, after the main thread initiates the network request, the network request thread will asynchronously throw the serialized data (processing results) to the main thread for processing, and perform data validation and data model conversion in the main thread. During the up and down sliding process, you can call the cancel method on the asynchronous task to cancel the operation. Before the asynchronous task is thrown to the main thread, cancel can cancel subsequent operations. For example Fig.10 As shown in the figure, after the asynchronous task is thrown to the main thread, the cancel call is invalid. Because the task has been thrown to the main thread, the network library of the live broadcast service can perform data verification and data model conversion tasks in the main thread. In order to handle the second situation, an interception program can be added to the live broadcast network library. Fig.11 As shown, the main thread can determine whether the asynchronous task has been canceled before performing data verification and data model conversion. If it has not been canceled, the subsequent operations will be performed. If it has been canceled, the data of the asynchronous task will be deleted.
[0156] In this embodiment, the main thread adds a verification procedure for asynchronous tasks. For asynchronous tasks that have been canceled, operations such as data verification and data model conversion are no longer performed, which further reduces the pressure on the main thread and improves sliding smoothness.
[0157] The above embodiments exemplarily introduce multiple solutions for further optimizing the sliding switching experience. Another optimization route is provided below to further optimize the live room switching experience.
[0158] In an optional embodiment, if Fig.13 As shown, the live broadcast page includes the bullet screen area of the first live broadcast room. The live broadcast room switching method may also include:
[0159] Step S800, obtaining a sliding operation on the live broadcast page, and determining whether the sliding operation is located in the bullet screen area.
[0160] Step S802, when the sliding area is located in the bullet screen area, obtaining the state of the bullet screen area.
[0161] Step S804: when the bullet screen area has scrolled to the boundary, the sliding operation is determined as the sliding switching operation.
[0162] Step S806, when the barrage area has not scrolled to the boundary: in response to the sliding operation, scroll and display the barrage area until the barrage area scrolls to the boundary; when the barrage area scrolls to the boundary, display the elastic special effects of the barrage area.
[0163] like Fig.14 As shown, if the user's sliding gesture (sliding operation on the live page) falls on the bullet screen area, even if there is no message or only one or two messages in the bullet screen area, it cannot trigger the live room switch. The specific interaction situations include: (1) When there are few bullet screen messages, the bullet screen area cannot be scrolled up and down. In this case, the user tries to slide the bullet screen area but there is no response, and the live room switch cannot be triggered; (2) When there are many bullet screen messages, the bullet screen area stays at the last message, and the user swipes up but there is no response; (3) When there are many bullet screen messages and the bullet screen area stays in the middle position, the user can browse more bullet screen content by sliding up and down. It can be seen that this limits the user's operating freedom and interactive fluency, cannot achieve fast switching of live screens, and affects the overall viewing experience. To overcome the above problems, this embodiment provides a new and optimized interaction strategy: edge trigger mechanism. For example, it can be checked whether the sliding operation is located in the bullet screen area. If the sliding operation is not located in the bullet screen area, it is determined as a sliding switching operation. If the sliding operation is located in the bullet screen area, the state of the bullet screen area at this time is obtained. When the bullet screen area has scrolled to the boundary (edge position), as described in cases (1) and (2), the sliding operation can be determined as a sliding switching operation, and the sliding operation (such as an upward sliding gesture) will be passed to the live broadcast room list container, thereby triggering the live broadcast room switching function. When the bullet screen area has not scrolled to the boundary and is located in the middle position, as described in case (3). The user can scroll the bullet screen area to browse more bullet screen content by sliding. Once the bullet screen area scrolls to the boundary, if the user's finger still does not leave the screen and continues to slide, the bullet screen area will show elastic special effects as a prompt to avoid directly triggering the live broadcast room switch.
[0164] In this embodiment, by adjusting the sliding area and the trigger mechanism, the user can browse the barrage content or slide up and down smoothly to switch the live broadcast room by sliding the barrage area according to needs, which further improves the smoothness of user interaction.
[0165] Combine the following Fig.15 and Fig.16 A comparison of the application effects of the existing live broadcast room switching technology and the live broadcast room switching method provided in the embodiment of the present application is provided.
[0166] The live broadcast room switching technology provided in the embodiment of the present application has the following advantages: (1) The time consumption of the first frame (the first time entering the room and sliding up and down to enter the room) is reduced by 52%, and the time consumption of the first frame of sliding up and down is reduced from 544ms to 334ms, a decrease of 38%, with obvious effect; (2) The proportion of entering the live broadcast room by sliding up and down is increased by more than 40%, which increases user participation and improves user retention rate. The platform can recommend high-quality live broadcast rooms based on the user's sliding behavior to better meet the user's personalized needs; (3) The smoothness and display effect of switching between live broadcast rooms by swiping up and down are significantly improved and enhanced, and the user's interactive experience is smoother and freer; (4) The first frame of the picture can be seen immediately after the sliding stops, giving the user a better experience.
[0167] Embodiment 2
[0168] Fig.17 The block diagram of the live broadcast room switching device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Fig.17 As shown, the device 1000 may include: a preloading module 1100 and a switching module 1200, wherein:
[0169] A preloading module, used for temporarily storing preloaded data of a plurality of first adjacent live broadcast rooms in a cache area when the live broadcast page displays the first live broadcast room;
[0170] A switching module, configured to determine a second live broadcast room in response to a sliding switching operation on the live broadcast page, and switch the first live broadcast room in the live broadcast page to the second live broadcast room, where the second live broadcast room is one of the plurality of first adjacent live broadcast rooms;
[0171] Among them, in a first time period in response to the sliding switching operation, the preloaded data of the second live broadcast room is obtained from the cache area, and the preloaded data of the second live broadcast room is pre-displayed on the live broadcast page.
[0172] As an optional embodiment, the sliding switching operation includes a pressing operation, a dragging operation and a lifting operation performed continuously on the touch screen;
[0173] Correspondingly, in the first time period in response to the sliding switching operation, obtaining the preloaded data of the second live broadcast room from the cache area includes:
[0174] The time point when the lifting operation is performed is taken as the starting time point of the first time period, and the preloaded data of the second live broadcast room is obtained from the cache area.
[0175] As an optional embodiment, temporarily storing the preloaded data of the plurality of first adjacent live broadcast rooms in a cache area includes:
[0176] Determine a live broadcast room list, wherein the live broadcast room list includes a first live broadcast room and a plurality of other live broadcast rooms;
[0177] According to the position of the first live broadcast room in the live broadcast room list, the plurality of first adjacent live broadcast rooms are selected from the plurality of other live broadcast rooms according to a preset rule;
[0178] Determine the preloading priority of each first adjacent live broadcast room according to the distance between each first adjacent live broadcast room and the first live broadcast room;
[0179] Based on the preloading priority of each first adjacent live broadcast room, the preloading data of the multiple first adjacent live broadcast rooms are obtained in sequence.
[0180] As an optional embodiment, the device 1000 is further used for:
[0181] In a case where the second live broadcast room is displayed on the live broadcast page, determining a plurality of second adjacent live broadcast rooms of the second live broadcast room;
[0182] Temporarily storing the preloaded data of the plurality of second adjacent live broadcast rooms in the cache area;
[0183] Among them, the preloaded data of some live broadcast rooms among the multiple first adjacent live broadcast rooms are deleted from the cache area; the part of the live broadcast rooms whose preloaded data are deleted are not the second adjacent live broadcast rooms.
[0184] As an optional embodiment, the device 1000 is further used for:
[0185] In response to an exit operation on the live broadcast page, the preloaded data of each live broadcast room in the cache area is deleted.
[0186] As an optional embodiment, the preloaded data includes video data;
[0187] Correspondingly, switching the first live broadcast room in the live broadcast page to the second live broadcast room includes:
[0188] Switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page;
[0189] Among them, during the scrolling of the page: the live broadcast component of the first live broadcast room is released and the associated tasks of the first live broadcast room are canceled, the live broadcast component includes a playback component and an interactive component; the playback component of the second live broadcast room is created, and based on the playback component, the video data of the second live broadcast room is displayed.
[0190] As an optional embodiment, the preloaded data includes video data;
[0191] Correspondingly, switching the first live broadcast room in the live broadcast page to the second live broadcast room includes:
[0192] Switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page;
[0193] Among them, during the scrolling of the page: releasing the interactive components of the first live broadcast room and canceling the associated tasks of the first live broadcast room; initializing the playback components of the first live broadcast room; based on the initialized playback components, displaying the video data of the second live broadcast room.
[0194] As an optional embodiment, the device 1000 is further used for:
[0195] After the page scrolling is completed, creating an interactive component of the second live broadcast room in the live broadcast page;
[0196] Among them, the interactive components include one or more of the barrage area, anchor information area, tool area, widget area, and gift animation area.
[0197] As an optional embodiment, creating an interactive component of the second live broadcast room in the live broadcast page includes:
[0198] Configure the priority or trigger conditions for each interactive component according to preset rules;
[0199] According to the priority or triggering condition of each interactive component, multiple interactive components are created in the live broadcast page in sequence.
[0200] As an optional embodiment, canceling the associated task of the first live broadcast room includes:
[0201] Acquire multiple task modules associated with the first live broadcast room, each task module including one or more tasks;
[0202] A cancel operation is performed on the plurality of task modules.
[0203] As an optional embodiment, canceling the associated task of the first live broadcast room includes:
[0204] Obtaining a task management module associated with the first live broadcast room, wherein the task management module includes a plurality of task modules, and each task module includes one or more tasks;
[0205] Each task module in the task management module is traversed, and a reset operation is performed on each task module.
[0206] As an optional embodiment, canceling the associated task of the first live broadcast room includes:
[0207] When the main thread receives the processing result of the asynchronous task, checking whether the asynchronous task has executed the cancellation operation;
[0208] If the asynchronous task does not perform a cancellation operation, verifying and converting the processing result of the asynchronous task;
[0209] In the case that the asynchronous task has executed a cancellation operation, the processing result of the asynchronous task is deleted.
[0210] As an optional embodiment, the live broadcast page includes a bullet screen area of the first live broadcast room, and the method further includes:
[0211] Obtaining a sliding operation on the live broadcast page, and determining whether the sliding operation is located in the bullet screen area;
[0212] When the sliding area is located in the bullet screen area, obtaining a state of the bullet screen area;
[0213] In the case where the bullet screen area has scrolled to a boundary, determining the sliding operation as the sliding switching operation;
[0214] When the bullet screen area has not scrolled to the boundary: in response to the sliding operation, the bullet screen area is scrolled and displayed until the bullet screen area scrolls to the boundary; when the bullet screen area scrolls to the boundary, the elastic special effects of the bullet screen area are displayed.
[0215] Embodiment 3
[0216] Fig.18 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the live broadcast room switching method according to the third embodiment of the present application is schematically shown. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Fig.18 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them:
[0217] The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 may also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed on the computer device 10000, such as the program code of the live room switching method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.
[0218] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.
[0219] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.
[0220] It should be pointed out that Fig.18 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0221] In this embodiment, the live room switching method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0222] Embodiment 4
[0223] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the live broadcast room switching method in the embodiment are implemented.
[0224] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEP ROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the live room switching method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0225] Embodiment 5
[0226] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0227] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0228] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.< / basemodule>
Claims
1. A method for switching between live broadcast rooms, characterized in that: The method comprises: When the live broadcast page displays the first live broadcast room, preloaded data of multiple first adjacent live broadcast rooms are temporarily stored in the cache area; In response to a sliding switching operation on the live broadcast page, determining a second live broadcast room, and switching the first live broadcast room in the live broadcast page to the second live broadcast room, where the second live broadcast room is one of the plurality of first adjacent live broadcast rooms; Among them, in a first time period in response to the sliding switching operation, the preloaded data of the second live broadcast room is obtained from the cache area, and the preloaded data of the second live broadcast room is pre-displayed on the live broadcast page.
2. The method according to claim 1, characterized in that The sliding switching operation includes a pressing operation, a dragging operation and a lifting operation performed continuously on the touch screen; Correspondingly, in the first time period in response to the sliding switching operation, obtaining the preloaded data of the second live broadcast room from the cache area includes: The time point when the lifting operation is performed is taken as the starting time point of the first time period, and the preloaded data of the second live broadcast room is obtained from the cache area.
3. The method according to claim 1, characterized in that: The step of temporarily storing the preloaded data of the plurality of first adjacent live broadcast rooms in a cache area includes: Determine a live broadcast room list, wherein the live broadcast room list includes a first live broadcast room and a plurality of other live broadcast rooms; According to the position of the first live broadcast room in the live broadcast room list, the plurality of first adjacent live broadcast rooms are selected from the plurality of other live broadcast rooms according to a preset rule; Determine the preloading priority of each first adjacent live broadcast room according to the distance between each first adjacent live broadcast room and the first live broadcast room; Based on the preloading priority of each first adjacent live broadcast room, the preloading data of the multiple first adjacent live broadcast rooms are obtained in sequence.
4. The method according to claim 1, characterized in that: Also includes: In a case where the second live broadcast room is displayed on the live broadcast page, determining a plurality of second adjacent live broadcast rooms of the second live broadcast room; Temporarily storing the preloaded data of the plurality of second adjacent live broadcast rooms in the cache area; Among them, the preloaded data of some live broadcast rooms among the multiple first adjacent live broadcast rooms are deleted from the cache area; the part of the live broadcast rooms whose preloaded data are deleted are not the second adjacent live broadcast rooms.
5. The method according to claim 1, characterized in that Also includes: In response to an exit operation on the live broadcast page, the preloaded data of each live broadcast room in the cache area is deleted.
6. The method according to claim 1, characterized in that The preloaded data includes video data; Correspondingly, switching the first live broadcast room in the live broadcast page to the second live broadcast room includes: Switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page; Among them, during the scrolling of the page: the live broadcast component of the first live broadcast room is released and the associated tasks of the first live broadcast room are canceled, the live broadcast component includes a playback component and an interactive component; the playback component of the second live broadcast room is created, and based on the playback component, the video data of the second live broadcast room is displayed.
7. The method according to claim 1, characterized in that The preloaded data includes video data; Correspondingly, switching the first live broadcast room in the live broadcast page to the second live broadcast room includes: Switching the first live broadcast room in the live broadcast page to the second live broadcast room by scrolling the page; Among them, during the scrolling of the page: releasing the interactive components of the first live broadcast room and canceling the associated tasks of the first live broadcast room; initializing the playback components of the first live broadcast room; based on the initialized playback components, displaying the video data of the second live broadcast room.
8. The method according to claim 6 or 7, characterized in that: Also includes: After the page scrolling is completed, creating an interactive component of the second live broadcast room in the live broadcast page; Among them, the interactive components include one or more of the barrage area, anchor information area, tool area, widget area, and gift animation area.
9. The method according to claim 8, characterized in that Creating the interactive component of the second live broadcast room in the live broadcast page includes: Configure the priority or trigger conditions for each interactive component according to preset rules; According to the priority or triggering condition of each interactive component, multiple interactive components are created in the live broadcast page in sequence.
10. The method according to claim 6 or 7, characterized in that: Canceling the associated task of the first live broadcast room includes: Acquire multiple task modules associated with the first live broadcast room, each task module including one or more tasks; A cancel operation is performed on the plurality of task modules.
11. The method according to claim 6 or 7, characterized in that: Canceling the associated task of the first live broadcast room includes: Obtaining a task management module associated with the first live broadcast room, wherein the task management module includes a plurality of task modules, and each task module includes one or more tasks; Each task module in the task management module is traversed, and a reset operation is performed on each task module.
12. The method according to claim 6 or 7, characterized in that: Canceling the associated task of the first live broadcast room includes: When the main thread receives the processing result of the asynchronous task, checking whether the asynchronous task has executed the cancellation operation; If the asynchronous task does not perform a cancellation operation, verifying and converting the processing result of the asynchronous task; In the case that the asynchronous task has executed a cancellation operation, the processing result of the asynchronous task is deleted.
13. The method according to claim 1, characterized in that The live broadcast page includes a bullet screen area of the first live broadcast room, and the method further includes: Obtaining a sliding operation on the live broadcast page, and determining whether the sliding operation is located in the bullet screen area; When the sliding area is located in the bullet screen area, obtaining a state of the bullet screen area; In the case where the bullet screen area has scrolled to a boundary, determining the sliding operation as the sliding switching operation; When the bullet screen area has not scrolled to the boundary: in response to the sliding operation, the bullet screen area is scrolled and displayed until the bullet screen area scrolls to the boundary; when the bullet screen area scrolls to the boundary, the elastic special effects of the bullet screen area are displayed.
14. A live broadcast room switching device, characterized in that: The device comprises: A preloading module, used for temporarily storing preloaded data of a plurality of first adjacent live broadcast rooms in a cache area when the live broadcast page displays the first live broadcast room; A switching module, configured to determine a second live broadcast room in response to a sliding switching operation on the live broadcast page, and switch the first live broadcast room in the live broadcast page to the second live broadcast room, where the second live broadcast room is one of the plurality of first adjacent live broadcast rooms; Among them, in a first time period in response to the sliding switching operation, the preloaded data of the second live broadcast room is obtained from the cache area, and the preloaded data of the second live broadcast room is pre-displayed on the live broadcast page.
15. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 13 is implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claims 1 to 13 are implemented.
Citation Information
Cited By
Situation display method, system and equipment for combat simulation and medium
CN119830614A
Live broadcasting room service request processing method and device, electronic equipment and storage medium
CN120499421A
Message processing method and related device
CN121547633A
