Method, apparatus, device, and storage medium for performing activity navigation in a live broadcast room
By detecting the navigation configuration of the WebView in the live broadcast room and allocating the active container, the problem of excessive memory usage on the client is solved, and multiple active objects are displayed in the same WebView, which improves the activity exposure and participation rate.
Patent Information
- Application Number
- CN202210192988.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-03-01
AI Technical Summary
In the live broadcast room, the client allocates a webview for each activity, resulting in a large memory space occupies, which can easily lead to the client crash.
By detecting the user's triggering behavior of the web view WebView in the live broadcast room, we will determine whether there is a navigation configuration. If so, we will obtain the user-related activity configuration data, call Qiankun Schema to allocate the activity container for the activity object, and store the activity page resources into the container. Finally, open the activity navigation page in the WebView to display the activity tags and content.
Implementation of displaying multiple active objects in the same WebView, reducing memory usage, reducing the risk of client crashes, and improving activity exposure and participation.
Smart Images

Figure CN114547523B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of business processing, and in particular, to a method for activity navigation in a live broadcast room, a device for activity navigation in a live broadcast room, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Currently, the ways to display activities in a live broadcast room include an activity panel and a carousel entry. Among them, the activity panel refers to a webview (web page view) of a certain size displayed in the live broadcast room; the carousel entry refers to another webview of a different size that is carousel-displayed in the live broadcast room and will switch to the next activity entry after a certain time interval. In some live broadcast rooms, if there are multiple activities ongoing during the same period, the two display positions of the activity panel and the carousel entry cannot timely inform users in the live broadcast room that they can participate in multiple activities, which has a certain impact on the company's revenue.
[0003] In the related art, a semi-screen navigation function developed natively by the client (ios / android) is adopted for the scenario of simultaneously displaying multiple activities and supporting switching. The implementation method is as follows: The client assigns a webview to each activity, and the currently displayed activity is placed in the foreground, while other activities are hidden in the background. This method is the simplest to implement, but the disadvantages are also obvious. This is because creating the same number of webviews for multiple activities simultaneously will occupy most of the memory space in terms of performance, easily leading to an increase in the client crash rate. Summary of the Invention
[0004] The present application provides a method, a device, a device, and a storage medium for activity navigation in a live broadcast room to solve the problems of large memory space occupation and easy client crashes caused by the client assigning a webview to each activity.
[0005] According to one aspect of the present application, there is provided a method for activity navigation in a live broadcast room, the method including:
[0006] When detecting a trigger behavior of a user on a webview (WebView) in the live broadcast room, determining whether the WebView has a navigation configuration;
[0007] If the WebView has a navigation configuration, obtaining activity configuration data of multiple activity objects related to the user, where the activity configuration data includes activity tags;
[0008] Invoking the Qiankun architecture to respectively assign activity containers to the activity objects according to the activity configuration data of each activity object;
[0009] Obtain the activity page resources corresponding to each activity object, and store the activity page resources in the activity container corresponding to the activity object;
[0010] Determine the target activity object to be displayed from the multiple activity objects, and mount the activity container of the target activity object under the main project of the Qiankun architecture;
[0011] Open an activity navigation page in the WebView. The activity navigation page includes a navigation bar area and an activity content display area. The navigation bar area is used to display the activity labels of each activity object, and the activity content display area is used to display the activity content of the target activity object generated based on the Qiankun architecture.
[0012] According to another aspect of the present application, there is provided a device for activity navigation in a live broadcast room. The device includes:
[0013] A navigation configuration judgment module, configured to judge whether the WebView has a navigation configuration when detecting a triggering behavior of a user on a web view (WebView) in a live broadcast room;
[0014] An activity configuration data acquisition module, configured to, if the WebView has a navigation configuration, acquire the activity configuration data of multiple activity objects related to the user. The activity configuration data includes activity labels;
[0015] An activity container allocation module, configured to call the Qiankun architecture to allocate activity containers for the activity objects respectively according to the activity configuration data of each activity object;
[0016] A resource acquisition module, configured to acquire the activity page resources corresponding to each activity object, and store the activity page resources in the activity container corresponding to the activity object;
[0017] A container mounting module, configured to determine the target activity object to be displayed from the multiple activity objects, and mount the activity container of the target activity object under the main project of the Qiankun architecture;
[0018] An activity navigation page display module, configured to open an activity navigation page in the WebView. The activity navigation page includes a navigation bar area and an activity content display area. The navigation bar area is used to display the activity labels of each activity object, and the activity content display area is used to display the activity content of the target activity object generated based on the Qiankun architecture.
[0019] According to another aspect of the present application, there is provided an electronic device. The electronic device includes:
[0020] At least one processor; and
[0021] A memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute a method for activity navigation in a live broadcast room according to any embodiment of the present application.
[0023] According to another aspect of the present application, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a method for activity navigation in a live broadcast room according to any embodiment of the present application when executed.
[0024] According to another aspect of the present application, there is provided a computer program product including a computer program that implements a method for activity navigation in a live broadcast room according to any embodiment of the present application when executed by a processor.
[0025] In this embodiment, when a triggering behavior of a user on a WebView in a live broadcast room is detected, if it is determined that the WebView has a navigation configuration, activity configuration data of multiple activity objects related to the user can be obtained, and then the Qiankun architecture is called to allocate activity containers for each activity object according to the activity configuration data of each activity object. After obtaining the activity page resources corresponding to each activity object, the activity page resources will be stored in their corresponding activity containers. For a target activity object to be displayed, by mounting the activity container of the target activity object under the main project of the Qiankun architecture, the activity content of the target activity object can be displayed in the activity content display area of the activity navigation page in the WebView, and at the same time, the activity labels of each activity object are displayed in the navigation bar area of the activity navigation page. In this way, multiple activity objects can be displayed in the same WebView by using one WebView and the same number of activity containers as the activity objects. The environment of the WebView is the same set, and the same code parts in different activity pages can be run only once and can be used in different activities, achieving resource savings and less memory occupancy.
[0026] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become easily understood through the following description. Description of the Drawings
[0027] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0028] Figure 1 FIG. Figure 1 is a flowchart of a method for activity navigation in a live broadcast room provided by Embodiment 1 of the present application;
[0029] Figure 2 FIG. Figure 2 is a schematic diagram of an activity navigation page provided by Embodiment 1 of the present application;
[0030] Figure 3 FIG. Figure 3 is a schematic structural diagram of a device for activity navigation in a live broadcast room provided by Embodiment 2 of the present application;
[0031] Figure 4 FIG. Figure 4 is a schematic structural diagram of an electronic device for implementing the method of activity navigation in a live broadcast room according to the embodiment of the present application. Detailed Embodiments
[0032] In order to enable those skilled in the art to better understand the solutions of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above accompanying drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0034] Embodiment 1
[0035] Figure 1The present invention provides a flowchart of a method for activity navigation in a live broadcast room, which can be applied to the client of a live broadcast application. It can be applied to a scenario where multiple activities are displayed through an activity navigation page in a live broadcast room and activity switching is supported. For example, many activities during Christmas and New Year's Day need to be launched simultaneously in some regions. Coupled with some daily activities, the number of activities that users and hosts can participate in ranges from 5 to 10. Currently, there are 2 positions for the entrance of the exposed activities in the live broadcast room, namely the activity panel and the carousel entrance. Through this embodiment, a half-screen or full-screen page can be pulled up at these 2 positions. Different activities are displayed through a navigation bar in the half-screen or full-screen page, and the activity content of the currently selected activity is also displayed, realizing the ability for users to participate in multiple activities in the live broadcast room, improving the activity exposure rate and activity participation rate, and thus increasing the company's revenue.
[0036] As Figure 1 shown, the method may include the following steps:
[0037] Step 110, when a triggering behavior of the WebView in the live broadcast room by the user is detected, determine whether the WebView has a navigation configuration.
[0038] Among them, WebView is a control based on the webkit engine that displays web pages. In addition to having the attributes and settings of a general View, WebView can also perform powerful processing on url requests, page loading, rendering, page interaction, and interaction and invocation with JavaScript, etc.
[0039] The WebView in the live broadcast room can at least include an activity panel WebView and a carousel entrance WebView. Among them, the size of the activity panel WebView is larger than that of the carousel entrance WebView. For example, the size of the activity panel WebView is 180*250, and the size of the carousel entrance WebView is 160*160. For the carousel entrance WebView, the next activity entrance will be switched to every 5 seconds.
[0040] When the user clicks on the page in the activity panel WebView or the carousel entrance WebView, it is determined that a triggering behavior of the WebView in the live broadcast room by the user is detected, and then it can be further determined whether the current WebView has a navigation configuration. If the current WebView has a navigation configuration, it means that the activity navigation page can be opened through the current WebView. Among them, for the convenience of users to view, the activity navigation page can be a half-screen navigation page, and its size can be slightly larger than that of the current WebView.
[0041] In one embodiment, step 110 may further include the following steps:
[0042] Obtain the URL address of the entry page of the WebView; read the value of the navigation configuration parameter from the URL address; if the value of the navigation configuration parameter is the first set value, it is determined that the WebView has a navigation configuration.
[0043] Specifically, the parameter part of the URL address of the entry page of the WebView may include a navigation configuration parameter for indicating whether the current WebView has a navigation configuration. If the value of this navigation configuration parameter is the first set value, it can be determined that the current WebView has a navigation configuration. If the value of this navigation configuration parameter is the second set value, it can be determined that the current WebView does not have a navigation configuration. For example, assume that the navigation configuration parameter is hasHalfScreen. If hasHalfScreen = 1, it is determined that the current WebView has a navigation configuration; if hasHalfScreen = 0, it is determined that the current WebView does not have a navigation configuration.
[0044] Step 120, if the WebView has a navigation configuration, obtain the activity configuration data of multiple activity objects related to the user.
[0045] Exemplarily, the activity configuration data may include activity labels, activity IDs, activity themes, activity icons, etc.
[0046] Among them, the number of activity objects can be determined according to the area layout in the activity navigation page. For example, if 8 activity objects can be displayed in the activity navigation page, the activity configuration data of 8 activity objects can be obtained.
[0047] In one embodiment, step 120 may further include the following steps:
[0048] Generate an activity configuration request according to the user identifier of the current user, and send the activity configuration request to the server; receive the activity configuration data of multiple activity objects related to the user returned by the server based on the activity configuration request.
[0049] In this embodiment, the activity configuration data of multiple activity objects related to the user is obtained from the server through a request-response method. Among them, these multiple activity objects may be fixed activity objects. In this case, the activity objects pulled by each user are the same. Or, these multiple activity objects may also be activity objects personalized recommended for the current user according to preset business logic (for example, calculate the matching degree between the current user and each activity object in the existing activity list, and then select the top N activity objects with the largest matching degree and obtain their activity configuration data to return). This embodiment does not make a limitation on this.
[0050] In practice, when the server returns the activity configuration data of multiple active objects, it can also select a default active object from the multiple active objects according to a preset business logic and mark the default active object. The default active object can be an object selected according to a certain policy, or an active object pre-marked by a developer, or the active object that the user last clicked when opening the activity navigation page last time. This embodiment does not limit this.
[0051] In this way, when the client receives the activity configuration data of the multiple active objects, it can update the relevant data in the js file related to the default active object according to the default active object. For example, if there is a navigation configuration in the current WebView, its js file will contain the URL of the activity navigation page. For the sake of easy distinction, it is called the navigation URL address here. The parameter part of the navigation URL address can contain relevant information of the default active object, such as activity identifier, activity label, etc. After determining the default active object, the relevant information in the js file can be updated.
[0052] Step 130, call the Qiankun architecture to allocate activity containers for the activity objects respectively according to the activity configuration data of each activity object.
[0053] In this embodiment, an activity container can be allocated for each activity object, and the activity page resources of the activity object are carried by the activity container, realizing the separation of the activity page resources of the activity object and providing a data basis for subsequent activity switching.
[0054] In implementation, the activity container of this embodiment is implemented based on the micro front-end solution Qiankun architecture (qiankunjs), and the operation of each activity container needs to run in Qiankun. Among them, Qiankun is a micro front-end framework. It is based on single-spa (a micro front-end framework) and has capabilities required by a micro front-end system such as a js (JavaScript, a programming language) sandbox, style isolation, HTML Loader (HTML loading), preloading, etc., and can be used for any js framework.
[0055] Among them, each activity container can provide multiple state hooks for Qiankun to call state switching during construction. For example, the state hooks can include bootstrap (initialization), mount (mounting), unmount (unmounting), update (updating), destroy (destroying), etc.
[0056] Step 140, obtain the activity page resources corresponding to each activity object, and store the activity page resources in the activity container corresponding to the activity object.
[0057] Among them, the activity page resources can include resources such as html, js, css, etc.
[0058] When implementing, the activity page resources corresponding to each activity object can be preloaded through the preloading function of the client or the Qiankun architecture, so as to shorten the white screen duration when the activity is displayed as much as possible.
[0059] In one embodiment, the step of obtaining the activity page resources corresponding to each activity object can further include the following steps:
[0060] Call the application preloading method of the Qiankun architecture, and preload the activity page resources of the activity object from the server through an xhr request during idle time.
[0061] This embodiment uses the html preloading function of the Qiankun framework, calls the application preloading (prefetchApps) method provided by the Qiankun architecture, and gradually preloads the activity page resources of each activity object from the server through an xhr (XML Http Request, Extensible Hypertext Transfer) request during idle time.
[0062] When preloading resources, the activity page resources of each activity object can be preloaded in a preset order. For example, the resources of the default activity object will be added to the preloading function, and the activity objects on both sides of the default activity object will also be added to the preloading function after the default activity object, and so on.
[0063] In one implementation, the preloaded activity page resources will be stored in the client cache. Then, for subsequent requests for the activity resources, there is no need to make an xhr request, making the loading time shorter. Subsequently, the activity page resources can be read from the cache and stored in the activity container corresponding to its activity object.
[0064] In another implementation, the activity page resources can also be directly stored in the activity container corresponding to its activity object.
[0065] In another embodiment, the step of obtaining the activity page resources corresponding to each activity object can include the following steps:
[0066] Intercept the xhr request initiated by the Qiankun architecture; match the resource header information in the xhr request with the resources cached locally on the client. If the match is successful, obtain the corresponding activity page resources from the local cache and return the activity page resources through the xhr response.
[0067] This embodiment docks with the preloading function of the client. In this embodiment, the xhr requests sent by the Qiankun framework are intercepted, and then the resource header information is extracted from the xhr requests. Next, the resource header information is matched with the resources cached locally on the client to determine whether the requested resources have local caches. If the match is successful, it means there is a local cache, and then the active page resources in the client's local cache can be pulled, and the interception is responded to through xhr to simulate the browser xhr request to return the active page resources. This embodiment intercepts the specific active code requests in the way of no injected code in the web container application layer. Since there is no need to request resources from the server, the data loading efficiency is improved.
[0068] Step 150: Determine the target active object to be displayed from the multiple active objects, and mount the active container of the target active object under the main project of the Qiankun architecture.
[0069] This step can be used by the Qiankun architecture to determine the target active object and perform the mounting of the activity.
[0070] In one embodiment, step 150 may further include the following steps:
[0071] Obtain the entry page resources of the entry page of the WebView, and obtain the navigation URL address of the active navigation page from the entry page resources; determine the default active object from the navigation URL address as the target active object.
[0072] This embodiment can obtain the entry page resources of the current WebView's entry page (such as the page displayed in the activity panel or the page displayed in the carousel entry), such as js files, then find the navigation URL address pointing to the active navigation page from the entry page resources, and extract the information of the default active object from the parameter part of the navigation URL address, and use the default active object as the target active object.
[0073] In addition, after the navigation container determines the default active object, it can obtain the activity serial number of the default active object, and then add the active objects with the serial numbers adjacent to the front and back of this serial number to the preloading function, so as to facilitate the download and rendering of the resources of the above active objects during the idle stage.
[0074] After determining the target active object, the mount method of the target active object can be triggered to mount the active container of the target active object under the existing main project of the Qiankun architecture. In this way, when displaying the activity content, the Qiankun framework can display the activity content in the active container mounted under its main project.
[0075] Step 160, open the activity navigation page in the WebView. The activity navigation page may include a navigation bar area and an activity content display area. The navigation bar area is used to display the activity labels of each activity object, and the activity content display area is used to display the activity content of the target activity object generated based on the Qiankun architecture.
[0076] For example, an activity navigation page can be as Figure 2 shown ( Figure 2 taking the navigation page shown in Figure 2 which shows 3 activity objects as an example). It may include the navigation bar area in part A and the activity content display area in part B. Among them, the navigation bar area is used to display the activity labels of each activity object, such as Figure 2 activity label 1, activity label 2, activity label 3, etc. in
[0077] The activity content display area is used to display the activity content of the current target activity object generated based on the Qiankun architecture. In implementation, the navigation bar area is rendered by the client based on the activity labels, while the activity content display area is rendered by the Qiankun framework.
[0077] In one embodiment, the target activity object can also be the activity object determined after the user initiates an activity switching operation. When detecting the activity switching operation initiated by the user, the activity object to be displayed after the switch can be used as the target activity object specified by the user. For example, in Figure 2 if the user switches from "activity label 1" to "activity label 2", the activity object corresponding to activity label 2 can be used as the target activity object.
[0078] In one embodiment, after the user initiates an activity switching operation, before mounting the activity container of the target activity object specified by the user under the main project of the Qiankun architecture, this embodiment may further include the following steps:
[0079] Unmount the activity container of the previous target activity object mounted under the main project of the Qiankun architecture, and obtain the operation data of this activity object for caching, so that when switching back to this activity object next time, the displayed activity content is the same as the activity content displayed for this activity object last time.
[0080] In implementation, the activity switching operation initiated by the user will trigger the unloading of the activity container of the previous activity object from the main project. In implementation, the unmount method of the previous activity object can be triggered to unmount its activity container from the main project.
[0081] It should be noted that for the sub-projects corresponding to the suspended original activity objects, the data of these sub-projects can be stored in the local database through the localstorage api, so as to facilitate data acquisition when switching back to these activity objects later.
[0082] Then, the operation data of the previous active object can be obtained for caching. Exemplarily, the operation data may include URL configuration, current browsing history, content of user operations, etc. When implementing caching, the operation data can be stored in the local database through the localstorage api, or the operation data can be stored in the active container corresponding to the active object. This embodiment does not limit this. When switching back to this active object later, the cached operation data can be pulled back together. For example, by triggering the html native window.history.replaceState method, the browsing history can be inserted into the webview; at the same time, vuex (a web data management plugin) is used to load the data changes of user operations. Thus, when the user sees the display of the previous active object, they will not realize that different active effects are being displayed on the same page.
[0083] After completing the processing of the previous active object, the target active object specified by the user can be processed. This processing includes determining whether the active page resources corresponding to the target active object are loaded or rendered.
[0084] If the active page resources of the target active object have not been downloaded yet, resource download is required, and there will be a white screen duration at this time; if the active page resources of the target active object have been downloaded but not rendered, the skeleton screen will be loaded first, so that there will be no white screen in user interaction; if the active page resources of the target active object have been downloaded and rendered, the page of the next active object can be smoothly displayed during switching, and the interface request for this active page can be started.
[0085] If the active page resources corresponding to the target active object have been loaded, its active container can be mounted under the main project of the Qiankun architecture to update the active navigation page. In this case, the target active object and its active content will be displayed on the active navigation page.
[0086] In one embodiment, the following steps may further be included:
[0087] When it is detected that the user switches back to the default active object, unmount the sub-project where the second active page is located from under the main project; obtain the browsing history and data changes of the default active object last time; mount the first active page, the browsing history, and the data changes of the default active object as a sub-project under the main project.
[0088] In one embodiment, if the entry page includes a carousel entry page, which is used to carousel and display multiple carousel activity entries at preset time intervals, for example, carousel and display 6 carousel activity entries. Then this embodiment may further include the following steps:
[0089] Monitor trigger events of the multiple carousel activity entrances; determine the target carousel activity entrance for which no trigger event is monitored within a preset time period, and hide the target carousel activity entrance on the carousel entrance page.
[0090] For example, the trigger event may include a click event of clicking on a carousel activity entrance, or a swipe event of swiping left or right on a carousel activity entrance, etc.
[0091] If no trigger event is monitored for a certain carousel activity entrance within a preset time period (for example, not clicked for 3 days), it means that the user is not interested in this carousel activity entrance, and at this time, this carousel activity entrance can be hidden.
[0092] In one embodiment, the following steps may further be included:
[0093] Determine whether the currently triggered target activity object is the hidden target carousel activity entrance; if so, re-display the target carousel activity entrance on the carousel entrance page.
[0094] In this embodiment, if an activity object is hidden in the carousel entrance but still exists in the activity navigation page, at this time, if the user clicks on this activity object in the activity navigation page, it means that the user is interested in this activity object again, and at this time, the target carousel activity entrance of this activity object can be re-displayed on the carousel entrance page.
[0095] In this embodiment, when detecting a trigger behavior of a user on a WebView in a live broadcast room, if it is determined that the WebView has a navigation configuration, activity configuration data of multiple activity objects related to the user can be obtained, and then the Qiankun framework is called to allocate activity containers for each activity object according to the activity configuration data of each activity object. After obtaining the activity page resources corresponding to each activity object, the activity page resources will be stored in their corresponding activity containers. For the target activity object that needs to be displayed, by mounting the activity container of the target activity object under the main project of the Qiankun framework, the activity content of the target activity object can be displayed in the activity content display area of the activity navigation page opened in the WebView, and at the same time, the activity labels of each activity object can be displayed in the navigation bar area of the activity navigation page. In this way, by using one WebView and the same number of activity containers as the activity objects, multiple activity objects can be displayed in the same WebView. The environment of the WebView is the same set, and the same code parts in different activity pages can only run once and can be used in different activities, achieving resource throttling and less memory occupancy.
[0096] In addition, this embodiment combined with the preloading function can make the loading of resources earlier and the probability of being already rendered higher when switching.
[0097] Embodiment 2
[0098] Figure 3 The following is a schematic structural diagram of a device for activity navigation in a live broadcast room provided in Embodiment 2 of this application, which may include the following modules:
[0099] The navigation configuration judgment module 310 is used to judge whether the WebView has a navigation configuration when detecting a triggering behavior of the user on the WebView in the live broadcast room;
[0100] The activity configuration data acquisition module 320 is used to acquire the activity configuration data of multiple activity objects related to the user if the WebView has a navigation configuration, and the activity configuration data includes activity tags;
[0101] The activity container allocation module 330 is used to call the Qiankun architecture to allocate activity containers for the activity objects respectively according to the activity configuration data of each activity object;
[0102] The resource acquisition module 340 is used to acquire the activity page resources corresponding to each activity object and store the activity page resources in the activity container corresponding to the activity object;
[0103] The container mounting module 350 is used to determine the target activity object to be displayed from the multiple activity objects and mount the activity container of the target activity object under the main project of the Qiankun architecture;
[0104] The activity navigation page display module 360 is used to open an activity navigation page in the WebView. The activity navigation page includes a navigation bar area and an activity content display area. The navigation bar area is used to display the activity tags of each activity object, and the activity content display area is used to display the activity content of the target activity object generated based on the Qiankun architecture.
[0105] In one embodiment, the resource acquisition module 340 is specifically used for:
[0106] Call the application preloading method of the Qiankun architecture to preload the activity page resources of the activity object from the server through an xhr request during idle time.
[0107] In another embodiment, the resource acquisition module 340 is specifically used for:
[0108] Intercept the xhr request initiated by the Qiankun architecture;
[0109] Match the resource header information in the xhr request with the resources cached locally on the client. If the match is successful, obtain the corresponding active page resources from the local cache and return the active page resources through the xhr response.
[0110] In one embodiment, the container mounting module 350 is specifically configured to:
[0111] Obtain the entry page resources of the entry page of the WebView, and obtain the navigation URL address of the active navigation page from the entry page resources;
[0112] Determine the default active object from the navigation URL address as the target active object.
[0113] In another embodiment, the container mounting module 350 is further configured to:
[0114] Detect the active switching operation initiated by the user;
[0115] Determine the target active object specified by the user according to the active switching operation.
[0116] In one embodiment, when the user initiates an active switching operation, the device further includes the following module:
[0117] The unloading module is used to unload the active container of the previous target active object mounted under the main project of the Qiankun architecture before mounting the active container of the target active object under the main project of the Qiankun architecture, and obtain the operation data of this active object for caching, so that when switching back to this active object next time, the active content displayed is the same as the active content displayed by this active object last time.
[0118] In one embodiment, the entry page includes a carousel entry page, and the carousel entry page is used to display multiple carousel activity entries in a carousel at preset time intervals;
[0119] The device may further include a module:
[0120] Monitor the trigger events of the multiple carousel activity entries;
[0121] The hiding module is used to determine the target carousel activity entry for which no trigger event is monitored within the preset time period, and hide the target carousel activity entry on the carousel entry page.
[0122] In one embodiment, the device may further include a module:
[0123] A redisplay module is used to determine whether the currently triggered target activity object is the hidden target carousel activity entrance; if so, the target carousel activity entrance is redisplayed on the carousel entrance page.
[0124] In one embodiment, the navigation configuration judgment module 310 is specifically configured to:
[0125] Obtain the URL address of the entrance page of the WebView;
[0126] Read the value of the navigation configuration parameter from the URL address;
[0127] If the value of the navigation configuration parameter is the first set value, it is determined that the WebView has a navigation configuration.
[0128] In one embodiment, the activity configuration data acquisition module 320 is specifically configured to:
[0129] Generate an activity configuration request according to the user identifier of the current user, and send the activity configuration request to the server;
[0130] Receive the activity configuration data of multiple activity objects related to the user returned by the server based on the activity configuration request.
[0131] An apparatus for activity navigation in a live broadcast room provided by an embodiment of the present application can execute a method for activity navigation in a live broadcast room provided by any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
[0132] Embodiment III
[0133] Figure 4 The structural schematic diagram of the electronic device 10 that can be used to implement the method embodiment of the present application is shown. The electronic device 10 includes at least one processor 11, and a memory communicatively connected to at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0134] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0135] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for activity navigation in a live streaming room.
[0136] In some embodiments, a method for activity navigation in a live streaming room can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for activity navigation in a live streaming room described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute a method for activity navigation in a live streaming room by any other suitable means (e.g., by means of firmware).
[0137] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Claims
1. A method for activity navigation in a live broadcast room, characterized in that, The method includes: When a trigger behavior of a user on a WebView in a live streaming room is detected, determine whether the WebView has a navigation configuration; If the WebView has a navigation configuration, obtain activity configuration data of multiple activity objects related to the user, where the activity configuration data includes activity tags; Call the Qiankun architecture to allocate activity containers for the activity objects respectively according to the activity configuration data of each activity object; Obtain the activity page resources corresponding to each activity object, and store the activity page resources in the activity container corresponding to the activity object; Determine a target activity object to be displayed from the multiple activity objects, and mount the activity container of the target activity object under the main project of the Qiankun architecture; Open an activity navigation page in the WebView, where the activity navigation page includes a navigation bar area and an activity content display area. The navigation bar area is used to display the activity tags of each activity object, and the activity content display area is used to display the activity content of the target activity object generated based on the Qiankun architecture.
2. The method according to claim 1, characterized in that, The obtaining of the activity page resources corresponding to each activity object includes: Call the application preloading method of the Qiankun architecture to preload the activity page resources of the activity object from the server through an extensible hypertext transfer (xhr) request during idle time.
3. The method according to claim 1, characterized in that, The obtaining of the activity page resources corresponding to each activity object includes: Intercept the xhr request initiated by the Qiankun architecture; Match the resource header information in the xhr request with the resources cached locally on the client. If the match is successful, obtain the corresponding activity page resources from the local cache, and return the activity page resources through an xhr response.
4. The method according to any one of claims 1 - 3, characterized in that, The determining of the target activity object to be displayed from the multiple activity objects includes: Obtain the entry page resources of the entry page of the WebView, and obtain the navigation URL address of the activity navigation page from the entry page resources; Determine the default activity object from the navigation URL address as the target activity object.
5. The method according to claim 4, characterized in that, The determining of the target activity object to be displayed from the multiple activity objects further includes: Detect an activity switching operation initiated by the user; Determine the target activity object specified by the user according to the activity switching operation.
6. The method according to claim 5, characterized in that, Before mounting the activity container of the target activity object under the main project of the Qiankun architecture, the method further includes: Unload the activity container of the previous target activity object mounted under the main project of the Qiankun architecture, and obtain the operation data of the activity object for caching, so that when switching back to the activity object next time, the displayed activity content is the same as the activity content displayed by the activity object last time.
7. The method according to claim 4, characterized in that, The entry page includes a carousel entry page, and the carousel entry page is used to display multiple carousel activity entries in a carousel at preset time intervals; The method further includes: Monitor the trigger events of the multiple carousel activity entries; Determine the target carousel activity entry for which no trigger event is monitored within the preset time period, and hide the target carousel activity entry on the carousel entry page.
8. The method according to claim 7, characterized in that, The method further includes: judging whether the currently triggered target activity object is the hidden target carousel activity entrance; if so, re-displaying the target carousel activity entrance on the carousel entrance page.
9. The method according to claim 1, characterized in that, The judging whether the WebView has a navigation configuration includes: obtaining the URL address of the entrance page of the WebView; reading the value of the navigation configuration parameter from the URL address; if the value of the navigation configuration parameter is a first set value, determining that the WebView has a navigation configuration.
10. The method according to claim 1, wherein The obtaining the activity configuration data of multiple activity objects related to the user includes: generating an activity configuration request according to the user identifier of the current user, and sending the activity configuration request to the server; receiving the activity configuration data of multiple activity objects related to the user returned by the server based on the activity configuration request.
11. A device for activity navigation in a live streaming room, wherein The device includes: a navigation configuration judgment module, configured to judge whether the WebView has a navigation configuration when detecting a triggering behavior of the user on the web view (WebView) in the live broadcast room; an activity configuration data acquisition module, configured to acquire the activity configuration data of multiple activity objects related to the user if the WebView has a navigation configuration, where the activity configuration data includes activity labels; an activity container allocation module, configured to call the Qiankun architecture to allocate activity containers for the activity objects respectively according to the activity configuration data of each activity object; a resource acquisition module, configured to acquire the activity page resources corresponding to each activity object, and store the activity page resources in the activity containers corresponding to the activity objects; a container mounting module, configured to determine a target activity object to be displayed from the multiple activity objects, and mount the activity container of the target activity object under the main project of the Qiankun architecture; an activity navigation page display module, configured to open an activity navigation page in the WebView, where the activity navigation page includes a navigation bar area and an activity content display area, the navigation bar area is used to display the activity labels of each activity object, and the activity content display area is used to display the activity content of the target activity object generated based on the Qiankun architecture.
12. An electronic device, wherein The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute a method for activity navigation in a live broadcast room according to any one of claims 1-10.
13. A computer-readable storage medium, wherein The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, a method for activity navigation in a live broadcast room according to any one of claims 1-10 is implemented.
14. A computer program product, wherein The computer program product includes a computer program, and when the computer program is executed by a processor, a method for activity navigation in a live broadcast room according to any one of claims 1-10 is implemented.
Citation Information
Patent Citations
Method, device and client for displaying task state in web page as well as mobile equipment
CN105867984A
Auto-sizing an untrusted view
US9652130B1