Data loading method and device, equipment and storage medium

By loading business module data of different priorities sequentially during the user interface loading process, and alternating the loading of view and logic data under the same priority, the problem of live broadcast interface lag was solved, and a smoother interface display was achieved.

CN120956975APending Publication Date: 2025-11-14GUANGZHOU SHIYINLIAN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511012661.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

When users are watching a live stream, the main thread is blocked due to the concentrated loading of other services with the same priority during the live stream interface loading process, causing the interface to lag.

Method used

By responding to user interface commands, business module data of different priorities are loaded sequentially, and view data and logical data are loaded alternately under the same priority, thus avoiding centralized loading.

Benefits of technology

This avoids blocking the main thread, improves the smoothness and efficiency of the interface display, and ensures the rapid display of the user interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956975A_ABST
    Figure CN120956975A_ABST
Patent Text Reader

Abstract

The invention discloses a data loading method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the steps that in response to an instruction for triggering and displaying a first user interface of an application program, service data corresponding to N service modules in sequence are loaded according to priorities corresponding to the N service modules in the first user interface, the service data comprise view data and logic data, the view data are data used for displaying the service modules, and the logic data are data used for displaying the service modules; the logic data is data used for operating the business module; in the process of loading the service data corresponding to the M service modules with the same priority, alternately loading view data and logic data corresponding to the M service modules, M being an integer smaller than or equal to N and larger than 1; and displaying the first user interface according to the business data respectively corresponding to the N business modules which are loaded in sequence. The fluency of triggering display of the first user interface is improved, and the display efficiency of the first user interface is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data loading method, apparatus, device, and storage medium. Background Technology

[0002] When users watch a live stream, the necessary video data for the live stream interface needs to be loaded to ensure a smooth display of the live stream.

[0003] In related technologies, when the client loads the live streaming interface, it gives the live streaming screen service the highest priority and loads other services in batches according to priority. Therefore, after the user opens the live streaming interface, the relevant data of the live streaming screen service is loaded first, and then other services are assigned different priorities according to factors such as importance or frequency of use. The data of other services are loaded in batches according to the order of priority, so that the live streaming interface can be displayed quickly.

[0004] However, when there are many services with equal priority loading, the above method can cause the main thread to be blocked, resulting in stuttering in the live streaming interface. Summary of the Invention

[0005] This application provides a data loading method, apparatus, device, and storage medium. The technical solutions provided by this application are as follows:

[0006] According to one aspect of the embodiments of this application, a data loading method is provided, the method comprising:

[0007] In response to an instruction to trigger the display of the application's first user interface, business data corresponding to the N business modules in the first user interface are loaded sequentially according to their respective priorities. The business data includes view data and logical data. The view data is the data used to display the business module, and the logical data is the data used to run the business module.

[0008] During the process of loading business data corresponding to M business modules of the same priority, the view data and logical data corresponding to the M business modules are loaded alternately, where M is an integer less than or equal to N and greater than 1.

[0009] The first user interface is displayed based on the business data corresponding to the N business modules loaded sequentially.

[0010] According to one aspect of the embodiments of this application, a data loading apparatus is provided, the apparatus comprising:

[0011] The first loading module is configured to respond to an instruction that triggers the display of the first user interface of the application, and load the business data corresponding to the N business modules in the first user interface in sequence according to their respective priorities. The business data includes view data and logical data. The view data is the data used to display the business module, and the logical data is the data used to run the business module.

[0012] The second loading module is used to alternately load the view data and logical data corresponding to the M business modules respectively during the process of loading the business data corresponding to the M business modules of the same priority, where M is an integer less than or equal to N and greater than 1.

[0013] The interface display module is used to display the first user interface according to the business data corresponding to the N business modules loaded in sequence.

[0014] According to one aspect of the embodiments of this application, a terminal device is provided, the terminal device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described data loading method.

[0015] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the above-described data loading method.

[0016] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program, the computer program being loaded and executed by a processor to implement the above-described data loading method.

[0017] The technical solution provided in this application can bring the following beneficial effects:

[0018] By loading the business data of N business modules sequentially according to their priorities after the first user interface is displayed, and by distinguishing the loading order of view data and logical data among M business modules of the same priority during the loading process, the business data of the M business modules of the same priority can be loaded in an orderly manner. Compared with the method of centrally loading business data of the same priority in related technologies, the technical solution adopted in this application avoids the main thread blocking caused by centralized loading, thereby avoiding display lag of the first user interface, improving the smoothness and fluidity of the first user interface display, and enabling the first user interface to be displayed quickly after the user triggers it, thus improving the display efficiency of the first user interface. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of a computer system provided in one embodiment of this application;

[0020] Figure 2 This is a flowchart of a data loading method provided in one embodiment of this application;

[0021] Figure 3 This is a schematic diagram of the data loading process of N business modules provided in one embodiment of this application;

[0022] Figure 4 This is a schematic diagram of the data loading process of the user interface provided in one embodiment of this application;

[0023] Figure 5 This is a flowchart of a data loading method for a live streaming interface provided in one embodiment of this application;

[0024] Figure 6 This is a schematic diagram of the data loading process of the first live streaming interface provided in one embodiment of this application;

[0025] Figure 7 This is a block diagram of a data loading apparatus provided in one embodiment of this application;

[0026] Figure 8 This is a structural block diagram of a terminal device provided in one embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0028] Please refer to Figure 1This illustration shows a schematic diagram of a computer system provided in one embodiment of this application. The computer system may include: a terminal device 10 and a server 20.

[0029] There may be one or more terminal devices 10. Terminal devices 10 may be electronic devices such as mobile phones, tablets, laptops, desktop computers, game consoles, e-book readers, multimedia playback devices, wearable devices, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.

[0030] The terminal device 10 may have a client application installed. The type of application is not limited to, but includes, live streaming applications, music applications, and video applications. Optionally, the application may be an application that requires downloading and installation, or it may be an application that can be used instantly.

[0031] Server 20 provides background services for clients of applications installed and running on terminal device 10. For example, server 20 can be a background server for the aforementioned application. Server 20 can be a standalone physical server, a server cluster consisting of multiple servers, or a cloud computing service center. Optionally, server 20 can simultaneously provide background services for applications on multiple terminal devices 10. Terminal devices 10 and server 20 can communicate with each other via a network.

[0032] In this embodiment, when a user opens an application on a terminal device, in response to an instruction to display the application's first user interface, business data corresponding to each of the N business modules in the first user interface is loaded sequentially according to their respective priorities. The business data includes view data and logical data; view data is used to display the business modules, and logical data is used to run the business modules. During the loading of business data corresponding to M business modules of the same priority, view data and logical data corresponding to the M business modules are loaded alternately, where M is an integer less than or equal to N and greater than 1. The first user interface is then displayed based on the sequentially loaded business data corresponding to the N business modules.

[0033] Please refer to Figure 2 This document illustrates a flowchart of a data loading method provided in an embodiment of this application. The execution entity for each step of this method can be a terminal device. The method may include at least one of the following steps 210 to 230:

[0034] Step 210: In response to the instruction to trigger the display of the first user interface of the application, the business data corresponding to the N business modules in the first user interface are loaded sequentially according to their respective priorities.

[0035] The instruction that triggers the display of the application's primary user interface is generated based on the user's action that triggers the display of the application's primary user interface. The primary user interface is any user interface in the application other than the home page user interface.

[0036] The first user interface displays N business modules, each indicating a business function within the user interface. The business functions corresponding to the N modules are related to the interface functions of the first user interface. For example, if the first user interface is a live streaming interface, then the N business modules are business modules related to live streaming, including but not limited to modules for gifting, special effects display, commenting, and sharing live streams. If the first user interface is a song playback interface, then the N business modules are business modules related to song playback, including but not limited to modules for song playback, lyrics display, song comments, and song chorus.

[0037] The priorities of the N business modules are pre-set, and the priority of each business module is determined by its business type. Optionally, the N business modules can each have different priorities, meaning there are N priorities for the N business modules. The business data corresponding to each of the N business modules can then be loaded sequentially according to these N priorities. Alternatively, at least two of the N business modules can have the same priority, meaning there are T priorities for the N business modules, where T is an integer less than M and greater than 1. The business data corresponding to at least one business module with each of the T priorities can then be loaded sequentially according to these T priorities.

[0038] Business data includes view data and logical data. View data is the data used to display business modules, while logical data is the data used to run business modules.

[0039] A view is the external representation of business data, that is, the interface that users can directly see and use. View data is used to present business modules to users in an intuitive and visual way. Logic is the internal processing rules and processes of business data, that is, the rules for how business modules run, transform, validate, and store data. Logic data is used to implement the core functions and business processes of business modules.

[0040] Step 220: During the process of loading the business data corresponding to M business modules of the same priority, the view data and logical data corresponding to the M business modules are loaded alternately, where M is an integer less than or equal to N and greater than 1.

[0041] View data has a higher loading priority than logical data. Therefore, in the process of alternately loading view data and logical data corresponding to M business modules, the view data corresponding to the M business modules will be loaded first, followed by the logical data corresponding to the M business modules.

[0042] For example, if N business modules correspond to N priorities, that is, there is one business module under the same priority, and M is 1, then in the process of loading the business data corresponding to each priority business module, the view data and the logical data corresponding to that business module are loaded alternately. That is, in the process of loading the business data corresponding to each priority business module, the view data corresponding to that business module is loaded first, and then the logical data corresponding to that business module is loaded.

[0043] For example, if N business modules correspond to T priorities (i.e., multiple business modules exist under the same priority), and M is an integer less than or equal to N and greater than 1, then during the loading of business data corresponding to the M business modules of the same priority, the view data and logical data corresponding to the M business modules are loaded alternately. Optionally, the view data and logical data corresponding to each of the M business modules can be loaded alternately, or the view data and logical data corresponding to at least two of the M business modules can be loaded alternately. For example, if the M business modules include business module 1 and business module 2, and the business data corresponding to business module 1 includes view data 1 and logical data 1, and the business data corresponding to business module 2 includes view data 2 and logical data 2, then view data 1, logical data 1, view data 2, and logical data 2 can be loaded sequentially, or view data 1, view data 2, logical data 1, and logical data 2 can be loaded sequentially.

[0044] The rules for alternating loading of the same priority can be found in the following examples, which will not be described here.

[0045] Step 230: Display the first user interface based on the business data corresponding to the N business modules loaded in sequence.

[0046] The business data corresponding to each of the N business modules is rendered sequentially to generate the first user interface, which is then displayed in the application.

[0047] The technical solution provided in this application, after triggering the display of the first user interface, loads the business data corresponding to the N business modules in the first user interface sequentially according to their respective priorities. Furthermore, during the loading of business data corresponding to M business modules of the same priority, the loading order of view data and logical data within the business data is differentiated, and the view data and logical data corresponding to the M business modules are loaded alternately. This ensures that the business data of the M business modules of the same priority can be loaded in an orderly manner. Compared to the method of centrally loading business data of the same priority in related technologies, the technical solution adopted in this application avoids the main thread blocking caused by centralized loading, thereby avoiding display lag in the first user interface, improving the smoothness and fluidity of triggering the display of the first user interface, and enabling the first user interface to be displayed quickly after the user triggers it, thus improving the display efficiency of the first user interface.

[0048] In some embodiments, step 210 includes sub-step 211.

[0049] Sub-step 211: Load the business data corresponding to each of the N business modules in descending order of priority.

[0050] For example, if N business modules have N priorities, then the business data corresponding to each of the N business modules is loaded sequentially according to the N priorities from highest to lowest. For instance, if the N business modules are ordered as business module 1, business module 2, ..., business module N from highest to lowest priority, then the business data corresponding to business module 1, business module 2, ..., business module N is loaded sequentially.

[0051] For example, if N business modules correspond to T priorities, then the business data corresponding to each of the N business modules is loaded sequentially according to the T priorities from highest to lowest. For instance, if the N business modules are ordered as business module 1 (priority 1), business module 2 and business module 3 (priority 2), ..., business module N-1 and business module N (priority T), then business module 1, business module 2 and business module 3, ..., business module N-1 and business module N are loaded sequentially. The number of business modules corresponding to each priority is not limited, meaning that the value of M corresponding to different priorities can be the same or different.

[0052] By loading the business data of N business modules in descending order of priority, the highest priority business modules can be loaded onto the first user interface first, attracting the user's attention to them and preventing the display effect of the first user interface from being affected by the incomplete loading of other business modules.

[0053] In some embodiments, for the i-th business module among N business modules, if the i-th business module belongs to the first business type, the priority corresponding to the i-th business module is determined as the first priority; if the i-th business module belongs to the second business type, the priority corresponding to the i-th business module is determined as the second priority; wherein, the first priority is higher than the second priority.

[0054] There are N business modules with two priorities (first priority and second priority). The business module belonging to the first business type has the first priority, and the business module belonging to the second business type has the second priority.

[0055] The first business type is used to indicate at least one business module that is fixedly present in the user interface of the application. For example, if the user interface is a live streaming interface, the business modules of the first business type include, but are not limited to, business modules such as gift-giving module, special effects display module, comment-sending module, and live streaming sharing module. If the user interface is a song playback interface, the business modules of the first business type include, but are not limited to, business modules such as song playback module, lyrics display module, song comment module, and song chorus module.

[0056] The second business type is used to indicate business modules that are unique to the first user interface. For example, if the user interface is a live streaming interface, the business modules of the second business type can be business modules provided by the streamer, such as exclusive special effects modules, live streaming event modules, and product link modules. If the user interface is a song playback interface, the business modules of the second business type can be business modules exclusive to that song, such as song event modules, exclusive wallpaper modules, and exclusive sound effect modules.

[0057] Based on the priorities of the N business modules, at least one business module corresponding to the first priority is loaded first, followed by at least one business module corresponding to the second priority. During the loading of the first-priority business module, the view data and logical data corresponding to that module are loaded alternately. Similarly, during the loading of the second-priority business module, the view data and logical data corresponding to that module are loaded alternately.

[0058] In some embodiments, if a higher priority is set above the first priority, then at least one business module corresponding to the higher priority will be loaded first, followed by at least one business module corresponding to the first priority, and then at least one business module corresponding to the second priority. The business module corresponding to the higher priority is set according to the interface type of the user interface. For example, if the user interface is a live broadcast interface, then the business module corresponding to the higher priority can be the live broadcast display module.

[0059] By dividing N business modules into two business types, the business modules that are fixed in each user interface are loaded first to provide users with basic business functions in the user interface, allowing users to quickly experience the first user interface. Then, the business modules that are exclusive to the first user interface are loaded to improve the business functions in the first user interface and ensure the complete display of the first user interface.

[0060] In some embodiments, step 220 includes at least one of sub-steps 221 to 222.

[0061] Sub-step 221: Create a view queue and a logic queue. The view queue includes M view loading tasks, each of which loads view data corresponding to one of the M business modules. The logic queue includes M logic loading tasks, each of which loads logic data corresponding to one of the M business modules.

[0062] The business data corresponding to M business modules of the same priority are divided into two queues. A view queue is created based on the view data corresponding to each of the M business modules, and a logic queue is created based on the logical data corresponding to each of the M business modules. The view data corresponding to each business module corresponds to a view loading task, and the logical data corresponding to each business module corresponds to a logic loading task.

[0063] The order of the business modules corresponding to the M view loading tasks in the view queue is the same as the order of the business modules corresponding to the M logical loading tasks in the logic queue. This means there is a one-to-one correspondence between the M view loading tasks in the view queue and the M logical loading tasks in the logic queue. For example, the view queue might contain view loading tasks for business module 1, business module 2, ..., business module M, while the logic queue might contain logical loading tasks for business module 1, business module 2, ..., business module M.

[0064] The order in which the M view loading tasks in the view queue are arranged can be either in the order in which the M view data are loaded into the view queue or in a random order; this application does not limit this.

[0065] Sub-step 222: Alternately execute the view loading task in the view queue and the logic loading task in the logic queue to load the view data and logic data in the business data corresponding to M business modules respectively.

[0066] Optionally, a view loading task from the view queue and a logic loading task from the logic queue can be executed alternately each time. For example, if the view queue includes view loading task 1 and view loading task 2, and the logic queue includes logic loading task 1 and logic loading task 2, then view loading task 1, logic loading task 1, view loading task 2, and logic loading task 2 can be executed alternately.

[0067] Alternatively, multiple view loading tasks in the view queue and multiple logic loading tasks in the logic queue can be executed alternately each time, in which case the number of view loading tasks executed each time is the same as the number of logic loading tasks executed each time. For example, if the view queue includes view loading task 1, view loading task 2, and view loading task 3, and the logic queue includes logic loading task 1, logic loading task 2, and logic loading task 3, then view loading task 1, view loading task 2, logic loading task 1, logic loading task 2, view loading task 3, and logic loading task 3 can be executed alternately.

[0068] By creating view queues and logic queues, and alternately executing view loading tasks in the view queues and logic loading tasks in the logic queues, business data of the same priority can be loaded in sequence, ensuring that business modules of the same priority can be quickly loaded onto the first user interface.

[0069] In some embodiments, if the number of view loading tasks stored in the view queue is less than the maximum number of view loading tasks that can be executed each time, then after the M view loading tasks in the view queue are loaded, the M logical loading tasks in the logical queue are executed.

[0070] In some embodiments, if the number of view loading tasks stored in the view queue is greater than or equal to the maximum number of view loading tasks executed each time, then sub-step 222 includes at least one of sub-steps 2221 to 2223.

[0071] Sub-step 2221: Execute k view loading tasks in the view queue, where k is a positive integer less than or equal to M.

[0072] The execution priority of view loading tasks is higher than that of logical loading tasks. Therefore, in the process of loading business data corresponding to M business modules of the same priority, the k view loading tasks in the view queue are executed first. This application does not limit the specific value of k.

[0073] Sub-step 2222: After the view data corresponding to the k view loading tasks is loaded, execute the k logical loading tasks in the logical queue. The k business modules corresponding to the k logical loading tasks are the same as the k business modules corresponding to the k view loading tasks.

[0074] Sub-step 2223: After the logical data corresponding to the k logical loading tasks is loaded, if there are still unexecuted view loading tasks in the view queue, then start executing again from sub-step 2221 until there are no unexecuted view loading tasks in the view queue.

[0075] For example, if M is 3 and k is 2, then view loading task 1, view loading task 2, logic loading task 1, logic loading task 2, view loading task 3 and logic loading task 3 are executed sequentially.

[0076] Figure 3 This diagram illustrates the data loading process for N business modules. Based on the business type of each module, its priority is determined, resulting in priority queues. Data is loaded sequentially from the high-priority queue, the first-priority queue, and the second-priority queue. During the loading process, view queues and logic queues are created. First, k view loading tasks in the view queue are executed, then k logic loading tasks in the logic queue, then k view loading tasks in the view queue, and so on, until there are no unexecuted view loading tasks in the view queue.

[0077] By alternately executing k view loading tasks in the view queue and k logic loading tasks in the logic queue, business data of k business modules can be loaded sequentially when there are many business modules with the same priority. This allows M business modules with the same priority to be loaded in order according to the queue's loading rules, avoiding interface lag caused by concentrated loading and ensuring the smoothness of the first user interface triggering display and the display efficiency of the first user interface.

[0078] In some embodiments, step 240 is included before step 210.

[0079] Step 240: After the application starts running, preload the business data corresponding to at least one of the N business modules.

[0080] After the application starts running, that is, after the user opens the application, the application client preloads the business data corresponding to at least one of the N business modules. It is important to note that this preloading occurs after the application starts running, before the user triggers the display of the primary user interface, and while the application client is in an idle state.

[0081] Preloading business data corresponding to at least one of the N business modules means downloading the business data corresponding to at least one of the N business modules from the server in advance, so that the client has obtained a portion of the data needed to display the first user interface before the first user interface is triggered for display. Based on the preloading request sent by the client, the server obtains the target class through mechanisms such as reflection, custom class loaders, and local caching, asynchronously loads the explicit target class using a thread pool, and then dynamically sends the target class to the client for pre-initialization.

[0082] The business data corresponding to at least one of the N business modules refers to the business data corresponding to at least one business module belonging to the first business type among the N business modules, that is, the business data corresponding to at least one business module that is fixedly present in at least one user interface of the application. The business data corresponding to this at least one business module includes the business data corresponding to each of the at least one business module individually.

[0083] Since the client preloads business data corresponding to at least one of the N business modules after the application starts running, when the user triggers the display of the first user interface, it can directly load the business data corresponding to at least one existing business module in the client, and load the business data corresponding to the remaining business modules (excluding at least one) from the N business modules from the server. Therefore, after the user triggers the display of the first user interface, it can first load the at least one preloaded business module corresponding to the first priority in the client. While loading the at least one business module corresponding to the first priority, the client loads at least one business module corresponding to the second priority from the server. After the at least one business module corresponding to the first priority is loaded, the at least one business module corresponding to the second priority is loaded. Alternatively, after the user triggers the display of the first user interface, it can first load the at least one preloaded business module corresponding to the first priority in the client. After the at least one business module corresponding to the first priority is loaded, the client loads at least one business module corresponding to the second priority from the server.

[0084] By preloading business data corresponding to at least one of the N business modules after the application starts running, the model of data loading and initialization operations in related technologies, which only occur after entering the user interface, is changed. This fundamentally solves the problem of slow user interface opening speed, shortens the loading time of business data, and improves the display efficiency of the first user interface.

[0085] In some embodiments, during the process of preloading business data corresponding to at least one of the N business modules, the loading time corresponding to at least one business module is obtained through data tracking technology. The loading time corresponding to each business module is used to indicate the time consumption of that business module. Subsequently, the performance of at least one business module can be analyzed and optimized based on the loading time corresponding to each of the at least one business module, so as to shorten the loading time of the business module and improve the loading efficiency of the business module without affecting the performance of the business module.

[0086] In some embodiments, if the preloading of business data corresponding to at least one business module fails, an exception handling mechanism is initiated. The exception handling mechanism is used to perform one of the following: re-acquire the business data corresponding to at least one business module, or cancel the acquisition of the business data corresponding to at least one business module.

[0087] Exception handling mechanisms are used to handle exceptions encountered during application runtime through exception handling logic. Specific code logic can be used to monitor code blocks that might experience exceptions. When an exception occurs, the application will not crash but will instead jump to the corresponding exception handling block to resolve the exception.

[0088] Optionally, if preloading business data corresponding to at least one business module fails, the business data corresponding to at least one business module is retrieved again. Optionally, if preloading business data corresponding to at least one business module fails, the retrieval of business data corresponding to at least one business module is cancelled. Optionally, if preloading business data corresponding to at least one business module fails, and the business data corresponding to at least one business module is retrieved again, and if the retrieval is not completed after a preset number of times, the retrieval of business data corresponding to at least one business module is cancelled.

[0089] By initiating an exception handling mechanism in the event of a failure to preload business data corresponding to at least one business module, the application crashes due to data retrieval failure, thus ensuring its stability and preventing disruption to normal operation.

[0090] In some embodiments, business data corresponding to at least one business module is used to create a view instance of a first user interface. Based on the business data corresponding to at least one business module, a view instance of the first user interface is created, and the view instance is used to indicate the view layout of at least one business module in the first user interface.

[0091] After the application starts, a custom view instance for the first user interface is created based on the business data corresponding to at least one business module. The view instance is an instance that encapsulates the data required by the view, and can solve problems such as context dependencies, resource access conflicts, and difficulties in lifecycle management by encapsulating logic. The view instance is used to provide the necessary data and functionality during view rendering, allowing at least one business module to sequentially load its corresponding business data on the view layout defined by the view instance.

[0092] Therefore, after the application starts running, business data corresponding to at least one of the N business modules is preloaded. Then, based on the business data corresponding to at least one business module, a view instance of the first user interface is created. After the user triggers the display of the first user interface, the business data corresponding to the at least one business module is directly loaded according to the view instance of the first user interface, and the at least one business module is loaded into the specified position in the view layout of the first user interface, thus achieving the effect of quickly opening the display of the first user interface.

[0093] By creating a view instance of the primary user interface after the application starts running, the view layout of at least one business module in the primary user interface can be parsed and processed in advance when the client is idle. Therefore, after the user triggers the display of the primary user interface, the business data corresponding to each of the at least one business module can be directly loaded based on the view instance of the primary user interface, eliminating the need for view layout parsing and improving the loading efficiency and display smoothness of the primary user interface. Furthermore, using a custom view instance avoids context sharing issues that may arise when loading business data in a concentrated manner, ensuring the feasibility and effectiveness of view layout preloading.

[0094] Figure 4The diagram illustrates the data loading process for the user interface. After the user launches the application, the application's home screen loads, but the user has not yet opened any other user interfaces within the application; at this point, the application client is idle. A sub-thread on the client preloads business data corresponding to at least one fixed business module in each user interface of the application from the server. The main thread on the client preloads the view instance of the user interface based on the business data corresponding to at least one business module. After the user triggers the display of a user interface, the business data corresponding to at least one fixed business module in the user interface, as well as the business data corresponding to at least one unique business module within the user interface, are loaded based on the view instance of the user interface.

[0095] In some embodiments, the content displayed on the first user interface includes a live video feed, and business data corresponding to at least one business module is used to display the live video feed. The business data corresponding to at least one business module includes: business data corresponding to each of the at least one business module and address data of the live video feed.

[0096] For example, if the first user interface is a live streaming interface, then the content displayed by the first user interface includes the live video screen, and the business data corresponding to at least one business module is used to display the live video screen content and the module content corresponding to at least one business module in the live video screen.

[0097] Please refer to Figure 5 This document illustrates a flowchart of a data loading method for a live streaming interface according to an embodiment of this application. The executing entity for each step of this method can be a terminal device. The method may include at least one of the following steps 510 to 570:

[0098] Step 510: After the application starts running, preload the business data and live address data corresponding to at least one business module. The live address data includes the address data of the live video screen displayed by at least one live interface in the application.

[0099] After the application starts running, before the user triggers the display of the live stream interface, and while the application client is in an idle state, at least one business module's corresponding business data and live stream address data are preloaded. The "at least one business module" here refers to at least one business module that is fixedly present in the live stream interface of the application, including but not limited to gift-giving modules, special effects display modules, comment-sending modules, and live stream sharing modules.

[0100] Live stream address data indicates the stream address of the live stream list. The live stream list includes live room information for at least one live stream interface in the application. The address data of the live video screen displayed in each live stream interface indicates the source address of the live stream in that interface. Preloading the live stream address data allows for quick extraction of the corresponding address data from the live stream address data when a user confirms entry into a live stream interface, reducing streaming waiting time, improving the display efficiency of the live video screen, and avoiding display stuttering in the live stream interface.

[0101] Optionally, the business data corresponding to at least one business module can be preloaded first, followed by the live broadcast address data; alternatively, the live broadcast address data can be preloaded first, followed by the business data corresponding to at least one business module; or the steps of preloading the business data corresponding to at least one business module and the live broadcast address data can be executed asynchronously.

[0102] Step 520: Based on the business data corresponding to at least one business module, create a view instance of the first live broadcast interface. The view instance of the first live broadcast interface is used to indicate the view layout of at least one business module in the first live broadcast interface.

[0103] The view instance of the first live broadcast interface, also known as the view instance of the live broadcast interface, is a view instance that can be used to trigger the display of at least one live broadcast interface in the application.

[0104] Step 530: In response to the instruction to trigger the display of the first user interface of the application, generate the live video frame of the first live interface according to the address data of the live video frame displayed in the first live interface in the live address data.

[0105] After the user triggers the display of the first user interface, the address data of the live video frame displayed on the first live interface is obtained from the live address data, and the live video frame in the first live interface is loaded according to the address data of the live video frame displayed on the first live interface to generate the live video frame of the first live interface.

[0106] Step 540: Based on the priority of each of the N business modules in the first live broadcast interface, load the business data corresponding to each of the N business modules in sequence.

[0107] The N business modules include at least one pre-loaded business module and at least one dedicated business module. If the at least one pre-loaded business module belongs to the first business type, its priority is determined as the first priority. If the at least one dedicated business module is a business module unique to the first live streaming interface and belongs to the second business type, its priority is determined as the second priority. Based on the priorities of the N business modules in the first live streaming interface, and following a descending order of priority, the business data corresponding to the at least one pre-loaded business module is loaded first, followed by the business data corresponding to the at least one dedicated business module.

[0108] It is important to note that the loading priority of the live stream display module is higher than that of the fixed business modules, and the loading priority of the fixed business modules is higher than that of the dedicated business modules.

[0109] Step 550: During the process of loading the business data corresponding to the M business modules of the same priority, the view data and logical data corresponding to the M business modules are loaded alternately.

[0110] In some embodiments, a view queue and a logic queue are created. The view queue includes M view loading tasks, each for loading view data corresponding to one of the M business modules. The logic queue includes M logic loading tasks, each for loading logical data corresponding to one of the M business modules. The k view loading tasks in the view queue are executed. After the view data corresponding to the k view loading tasks is loaded, the k logic loading tasks in the logic queue are executed. The k business modules corresponding to the k logic loading tasks are the same as the k business modules corresponding to the k view loading tasks. After the logical data corresponding to the k logic loading tasks is loaded, if there are still unexecuted view loading tasks in the view queue, the execution process restarts from the step of executing the k view loading tasks in the view queue until there are no unexecuted view loading tasks in the view queue.

[0111] Step 560: Generate the view layout of the first live broadcast interface based on the view instance of the first live broadcast interface and the business data corresponding to the N business modules loaded in sequence.

[0112] The view layout of the first live broadcast interface is used to indicate the view layout of N business modules in the first live broadcast interface.

[0113] Step 570: Display the first live broadcast interface based on the live video feed and view layout of the first live broadcast interface.

[0114] After the live video of the first live interface is loaded in step 530, the live video of the first live interface is displayed first. Then, based on the live video of the first live interface, the view layout of the first live interface is gradually loaded and displayed to obtain the final displayed first live interface.

[0115] By preloading the business data corresponding to at least one fixed business module in the live streaming interface and the view layout of the live streaming interface, users can quickly pull and display the live video after entering any live streaming interface, and quickly render using the pre-loaded view layout to achieve the display effect of quickly opening the live streaming interface, thus improving the smoothness of triggering and displaying the live streaming interface.

[0116] Figure 6 The diagram illustrates the data loading process of the first live streaming interface. After the user launches the application and enters the application's home screen, it checks whether the application client is idle, i.e., whether the application client has opened the live streaming interface within the application. If the application client is not idle, it continues to wait for an idle state. If the application client is idle, the client's sub-thread initializes the application's live streaming interface. The client sends an initialization request for the live streaming interface to the server, requesting to obtain the business data corresponding to at least one fixed business module in the live streaming interface. If the business data corresponding to at least one business module is not obtained, an exception handling mechanism is initiated. During the process of the server distributing the business data corresponding to at least one business module, the client obtains the time consumption of each of the at least one business module and reports the time consumption of each of the at least one business module to the server. This facilitates subsequent performance analysis and optimization of the time consumption of each of the at least one business module, shortening the loading time of each business module and improving the loading efficiency of each business module. When the application client is idle, the client also preloads the view layout of the live streaming interface, obtains the view instance of the live streaming interface, and preloads the list of live stream addresses corresponding to at least one live streaming interface in the application. After a user opens the first live stream interface, the system retrieves the view instance of the live stream interface and the corresponding live stream address from the list of live stream addresses. Based on the live stream address corresponding to the first live stream interface, it pulls and displays the live video, loads the corresponding business data from the business modules, renders the view layout of the first live stream interface, and finally displays the first live stream interface.

[0117] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0118] Please refer to Figure 7 This diagram illustrates a block diagram of a data loading apparatus according to an embodiment of this application. The apparatus has the function of implementing the above-described data loading method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be the terminal device described above, or it can be installed within a terminal device. For example... Figure 7 As shown, the device 700 may include: a first loading module 710, a second loading module 720, and an interface display module 730.

[0119] The first loading module 710 is configured to respond to an instruction that triggers the display of the first user interface of the application, and load the business data corresponding to the N business modules in the first user interface in sequence according to their respective priorities. The business data includes view data and logical data. The view data is the data used to display the business module, and the logical data is the data used to run the business module.

[0120] The second loading module 720 is used to alternately load the view data and logical data corresponding to the M business modules respectively during the process of loading the business data corresponding to the M business modules of the same priority, where M is an integer less than or equal to N and greater than 1.

[0121] The interface display module 730 is used to display the first user interface according to the business data corresponding to the N business modules loaded in sequence.

[0122] In some embodiments, the second loading module 720 is configured to:

[0123] Create a view queue and a logic queue. The view queue includes M view loading tasks, each of which is used to load view data corresponding to one of the M business modules. The logic queue includes M logic loading tasks, each of which is used to load logic data corresponding to one of the M business modules.

[0124] The view loading task in the view queue and the logic loading task in the logic queue are executed alternately to load the view data and logic data in the business data corresponding to the M business modules respectively.

[0125] In some embodiments, the second loading module 720 is configured to:

[0126] Execute k view loading tasks from the view queue, where k is a positive integer less than or equal to M;

[0127] After the view data corresponding to the k view loading tasks is loaded, the k logical loading tasks in the logical queue are executed, wherein the k business modules corresponding to the k logical loading tasks are the same as the k business modules corresponding to the k view loading tasks.

[0128] After the logical data corresponding to the k logical loading tasks is loaded, if there are still unexecuted view loading tasks in the view queue, the execution will start again from the step of executing the k view loading tasks in the view queue, until there are no unexecuted view loading tasks in the view queue.

[0129] In some embodiments, the first loading module 710 is configured to:

[0130] The business data corresponding to the N business modules are loaded sequentially in descending order of priority.

[0131] In some embodiments, the first loading module 710 is configured to:

[0132] For the i-th business module among the N business modules, if the i-th business module belongs to the first business type, the priority corresponding to the i-th business module is determined as the first priority;

[0133] If the i-th business module belongs to the second business type, the priority corresponding to the i-th business module is determined as the second priority;

[0134] The first priority is higher than the second priority.

[0135] In some embodiments, the device 700 further includes a preloading module, the preloading module being configured to:

[0136] After the application starts running, business data corresponding to at least one of the N business modules is preloaded.

[0137] In some embodiments, the business data corresponding to the at least one business module is used to create a view instance of the first user interface; the preloading module is used to:

[0138] Based on the business data corresponding to the at least one business module, a view instance of the first user interface is created, and the view instance is used to indicate the view layout of the at least one business module in the first user interface.

[0139] In some embodiments, the preloading module is configured to:

[0140] If the preloading of business data corresponding to at least one business module fails, an exception handling mechanism is initiated. The exception handling mechanism is used to perform one of the following: re-acquire the business data corresponding to at least one business module, or cancel the acquisition of the business data corresponding to at least one business module.

[0141] In some embodiments, the content displayed by the first user interface includes a live video feed, and the business data corresponding to the at least one business module is used to display the live video feed.

[0142] The business data corresponding to the at least one business module includes: the business data corresponding to the at least one business module respectively, and the address data of the live video frame.

[0143] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0144] Please refer to Figure 8 This diagram illustrates a structural block diagram of a terminal device 800 provided in one embodiment of this application. The terminal device 800 can be any electronic device capable of data computation, processing, and storage. The terminal device 800 can be used to implement the data loading method provided in the above embodiments.

[0145] Typically, terminal device 800 includes a processor 801 and a memory 802.

[0146] Processor 801 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0147] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 802 are used to store a computer program configured to be executed by one or more processors to implement the data loading method described above.

[0148] Those skilled in the art will understand that Figure 8 The structure shown does not constitute a limitation on the terminal device 800, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0149] In an illustrative embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and the computer program implements the above-described data loading method when executed by the processor of a terminal device. Optionally, the above-described computer-readable storage medium may be ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.

[0150] In an exemplary embodiment, a computer program product is also provided, comprising a computer program stored in a computer-readable storage medium. A processor of a terminal device reads the computer program from the computer-readable storage medium and executes the computer program, causing the terminal device to perform the data loading method described above.

[0151] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user data. These prompt interfaces, pop-ups, or voice prompts are used to inform users that their data is being collected. This ensures that the application only begins the steps for collecting user data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without receiving confirmation from the user), the steps for collecting user data end, meaning no user data is collected. In other words, all user data collected by this application is processed strictly in accordance with the requirements of relevant national laws and regulations. The informed consent or separate consent of the data subject is obtained only with the user's consent and authorization. Subsequent data use and processing are conducted within the scope of laws, regulations, and the data subject's authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0152] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0153] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A data loading method, characterized in that, The method includes: In response to an instruction to trigger the display of the application's first user interface, business data corresponding to the N business modules in the first user interface are loaded sequentially according to their respective priorities. The business data includes view data and logical data. The view data is the data used to display the business module, and the logical data is the data used to run the business module. During the process of loading business data corresponding to M business modules of the same priority, the view data and logical data corresponding to the M business modules are loaded alternately, where M is an integer less than or equal to N and greater than 1. The first user interface is displayed based on the business data corresponding to the N business modules loaded sequentially.

2. The method according to claim 1, characterized in that, The alternating loading of view data and logical data from the business data corresponding to the M business modules includes: Create a view queue and a logic queue. The view queue includes M view loading tasks, each of which is used to load view data corresponding to one of the M business modules. The logic queue includes M logic loading tasks, each of which is used to load logic data corresponding to one of the M business modules. The view loading task in the view queue and the logic loading task in the logic queue are executed alternately to load the view data and logic data in the business data corresponding to the M business modules respectively.

3. The method according to claim 2, characterized in that, The alternating execution of the view loading task in the view queue and the logic loading task in the logic queue to load the view data and logic data from the business data corresponding to the M business modules respectively includes: Execute k view loading tasks from the view queue, where k is a positive integer less than or equal to M; After the view data corresponding to the k view loading tasks is loaded, the k logical loading tasks in the logical queue are executed, wherein the k business modules corresponding to the k logical loading tasks are the same as the k business modules corresponding to the k view loading tasks. After the logical data corresponding to the k logical loading tasks is loaded, if there are still unexecuted view loading tasks in the view queue, the execution will start again from the step of executing the k view loading tasks in the view queue, until there are no unexecuted view loading tasks in the view queue.

4. The method according to any one of claims 1 to 3, characterized in that, The step of sequentially loading the business data corresponding to the N business modules according to their respective priorities in the first user interface includes: The business data corresponding to the N business modules are loaded sequentially in descending order of priority.

5. The method according to claim 4, characterized in that, The method further includes: For the i-th business module among the N business modules, if the i-th business module belongs to the first business type, the priority corresponding to the i-th business module is determined as the first priority; If the i-th business module belongs to the second business type, the priority corresponding to the i-th business module is determined as the second priority; The first priority is higher than the second priority.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: After the application starts running, business data corresponding to at least one of the N business modules is preloaded.

7. The method according to claim 6, characterized in that, The business data corresponding to at least one business module is used to create a view instance of the first user interface; the method further includes: Based on the business data corresponding to the at least one business module, a view instance of the first user interface is created, and the view instance is used to indicate the view layout of the at least one business module in the first user interface.

8. The method according to claim 6 or 7, characterized in that, The method further includes: If the preloading of business data corresponding to at least one business module fails, an exception handling mechanism is initiated. The exception handling mechanism is used to perform one of the following: re-acquire the business data corresponding to at least one business module, or cancel the acquisition of the business data corresponding to at least one business module.

9. The method according to any one of claims 6 to 8, characterized in that, The content displayed in the first user interface includes live video footage, and the business data corresponding to the at least one business module is used to display the live video footage; The business data corresponding to the at least one business module includes: the business data corresponding to the at least one business module respectively, and the address data of the live video frame.

10. A data loading device, characterized in that, The device includes: The first loading module is configured to respond to an instruction that triggers the display of the first user interface of the application, and load the business data corresponding to the N business modules in the first user interface in sequence according to their respective priorities. The business data includes view data and logical data. The view data is the data used to display the business module, and the logical data is the data used to run the business module. The second loading module is used to alternately load the view data and logical data corresponding to the M business modules respectively during the process of loading the business data corresponding to the M business modules of the same priority, where M is an integer less than or equal to N and greater than 1. The interface display module is used to display the first user interface according to the business data corresponding to the N business modules loaded in sequence.

11. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, which is loaded and executed by the processor to implement the data loading method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the data loading method as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, The computer program product includes a computer program that is loaded and executed by a processor to implement the data loading method as described in any one of claims 1 to 9.