Methods, apparatus, devices, media, and products for loading components
By predicting and dynamically adjusting component loading in the periodic loop of the multi-track video editing tool's threads, the stuttering problem caused by loading too many components on the main thread was solved, resulting in a smoother user experience and improved resource utilization efficiency.
Patent Information
- Application Number
- CN202510603912.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2026-11-10
AI Technical Summary
Traditional multitrack video editing tools cannot complete the loading of a large number of components in one frame when the main thread is not able to do so, resulting in lag on the device display and affecting the user experience.
In the periodic loop of the thread, the loading time of the component is predicted to dynamically determine whether the component can be loaded in the current cycle. The unfinished components are loaded in the next cycle to avoid the lag caused by loading all components at once.
It effectively avoids display lag and improves the smoothness of the interactive interface and the efficiency of computing resource utilization.
Smart Images

Figure CN123067946A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computers, and more particularly to methods, apparatus, computing devices, computer storage media, and computer program products for loading components. Background Technology
[0002] Multitrack video editing tools are software or applications that allow users to overlay, arrange, and edit different media elements (such as video, audio, text, effects, etc.) on multiple independent tracks (layers). With the iteration of business functions, the number of components in multitrack video editing tools has grown rapidly. Traditionally, all components of the editing tool are loaded using the main thread during user interface rendering. However, when the number of components loaded at once is too large, the main thread cannot complete loading all components within one frame (for example, if the user's device screen refresh rate is 60Hz, then one frame is 1 / 60th of a second, approximately 16.67 milliseconds), causing the device's display to stutter and severely impacting the user's interactive experience. Summary of the Invention
[0003] In a first aspect of the embodiments of this disclosure, a method for loading components is provided for sequentially loading multiple components in a periodic loop of a thread. The method includes: for each of the multiple components, predicting the loading time of the component based on state information when the component was last loaded; determining, based on the predicted loading time of the component, whether the loading of the component can be completed within the current cycle of the loop; and if the loading of the component cannot be completed within the current cycle, loading the component in the next cycle of the loop.
[0004] In a second aspect of the embodiments of this disclosure, an apparatus for loading components is provided for sequentially loading multiple components in a periodic loop of a thread. The apparatus includes: a prediction unit configured to predict, for each of the multiple components, a loading time for that component based on state information from when the component was previously loaded; a determination unit configured to determine, based on the predicted loading time of the component, whether the loading of the component can be completed within the current cycle of the loop; and a loading unit configured to load the component in the next cycle of the loop if the loading of the component cannot be completed within the current cycle.
[0005] In a third aspect of embodiments of this disclosure, an electronic device is provided. It includes: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the computing device to perform the method as described in the first aspect of this disclosure.
[0006] In a fourth aspect of embodiments of this disclosure, a non-transient computer storage medium is provided. It includes machine-executable instructions that, when executed by a device, cause the device to perform the method as described in the first aspect of this disclosure.
[0007] In a fifth aspect of embodiments of this disclosure, a computer program product is provided. It includes machine-executable instructions that, when executed by a device, cause the device to perform the method as described in the first aspect of this disclosure.
[0008] The summary section is provided to present the chosen concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or principal features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. Attached Figure Description
[0009] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Wherein:
[0010] Figure 1 A schematic diagram illustrating loading components in a thread according to some embodiments of the present disclosure is shown;
[0011] Figure 2 A flowchart of a method for loading a component according to some embodiments of the present disclosure is shown;
[0012] Figure 3 A flowchart is shown illustrating a method for determining the state transition matrix of a component according to some embodiments of the present disclosure;
[0013] Figure 4 A block diagram of an apparatus for loading components according to some embodiments of the present disclosure is shown; and
[0014] Figure 5 A block diagram of a device capable of implementing several embodiments of the present disclosure is shown.
[0015] In all the accompanying figures, the same or similar reference numerals denote the same or similar elements. Detailed Implementation
[0016] It is understood that all user-related data involved in this technical solution should be obtained and used only after authorization from the user. This means that if it is necessary to use a user's personal information in this technical solution, the user's explicit consent and authorization are required before obtaining this data; otherwise, no related data collection and use will be carried out. It should also be understood that when implementing this technical solution, relevant laws and regulations should be strictly followed in the process of data collection, use, and storage, and necessary technical measures should be taken to protect user data security and ensure the secure use of data.
[0017] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0018] For example, upon receiving a user's proactive request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0019] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0020] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0021] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0022] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects unless explicitly stated. Other explicit and implicit definitions may also be included below.
[0023] The inventors noted that existing component loading methods typically load all components of the editing tool sequentially on the device's main thread. However, when the number of components loaded at once is too large, the main thread cannot complete loading all components within a single frame, and the user interface cannot update in real time in the next frame. This results in screen lag and longer loading times, severely impacting the user experience. Therefore, designing a new method for loading components is urgently needed.
[0024] To this end, this disclosure provides a method for loading components, which sequentially loads multiple components within a periodic loop of a thread. A loop is an event loop mechanism that manages thread tasks, responsible for listening to and processing input sources (such as touch events, timers, network callbacks, etc.), and allowing the thread to sleep to conserve resources when there are no tasks. Examples of loops include, but are not limited to, run loops, looping messages, and other event loops, and are not limited here. In this method, for each of the multiple components, the time required to load the component is predicted based on the state information of the component when it was previously loaded. The component's state information may include a combination of the system metric level and the loading time level when the component was loaded. Then, based on the predicted time required to load the component, it is determined whether the component can be loaded within the current cycle of the loop, where the cycle period is the length of one frame displayed on the device's screen (e.g., 1 / 60th of a second). If the component cannot be loaded within the current cycle of the loop, it is loaded in the next cycle of the loop.
[0025] This method can predict the loading time of each component that needs to be loaded, thereby determining whether to load the component in the current cycle of the loop. This ensures that the time length of multiple components that need to be loaded in each cycle of the loop does not exceed the length of one frame, thus avoiding display interface lag and improving the smoothness of the interactive interface.
[0026] Figure 1 A schematic diagram 100 illustrating loading components in a thread according to some embodiments of the present disclosure is shown. For example... Figure 1As shown, a thread includes multiple cycles (e.g., frames for UI refresh, i.e., "ticks"), such as the current cycle 102 (i.e., cycle 1) and the next cycle 104 (i.e., cycle 2). It should be understood that a thread can be a main thread used to update the user interface (UI) and perform UI operations. For example, a thread can be used to perform time-consuming operations such as view layout, animation, touch event handling, component loading, and complex calculations.
[0027] It should be understood that the device performing the component loading task in the thread may include a terminal device. The terminal device may be an electronic device with data processing and display functions, including but not limited to mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality / virtual reality devices, laptops, super mobile personal computers, netbooks, personal digital assistants, Internet of Things devices, industrial terminals, and various electronic devices with interface display functions. The embodiments of this disclosure do not impose any restrictions on the specific type of electronic device.
[0028] exist Figure 1 In the current cycle 102 of the thread, four components need to be loaded, where the length of a component represents the time required to load that component. For example, component 106 has the longest length and requires the longest loading time, while the three components loaded before component 106 have shorter lengths and require less loading time.
[0029] In some embodiments, when loading components in a periodic loop of a thread, the loading tasks of all components are executed sequentially. Within the current cycle 102 of the loop, component loading tasks are executed sequentially. The loading time required for the three components executed sequentially before component 106 is relatively short, and the sum of the loading times for these three components is less than the length of the current cycle 102. When these three components are completed and component 106 is executed sequentially, the length of component 106 plus the length of the three previously executed components exceeds the length of the current cycle 102. This prevents component 106 from being loaded within the current cycle 102, and also prevents the UI refresh task that needs to be executed within the current cycle 102 from being performed. Consequently, UI refresh cannot be achieved within the current cycle 102, resulting in frame drops, stuttering, and other issues in the interactive interface.
[0030] To address the issue of loading multiple components sequentially at once, as mentioned above, we can dynamically determine which components need to be loaded within a loop cycle by predicting the loading time of each of all components required. This ensures that the total loading time for components within the loop cycle is less than the length of a single frame displayed on the screen (or, the difference between the total loading time and the length of a single frame is at least a threshold duration, providing sufficient time for a refresh operation), thereby avoiding frame drops and resource waste. For example, for a given component among multiple components, we predict the loading time required for that component. Based on the predicted loading time, we determine whether the component's loading task can be completed within the current loop cycle. If the component cannot be loaded within the current loop cycle (e.g., the remaining time after subtracting the time already used to load previous components from the current cycle), the component is loaded in the next loop cycle. In other words, by predicting the component's loading time to determine whether to load it within the current loop cycle, this method avoids the stuttering problem caused by loading all components at once in a thread, improving the smoothness of the interactive interface and increasing the efficiency of computing resource utilization.
[0031] It should be understood that Figure 1 The number of cycles and components described are merely examples. The number of cycles and components to be loaded on the terminal device may be more or less, and this is not limited here.
[0032] Figure 2 A flowchart of a method 200 for loading a component according to some embodiments of the present disclosure is shown. Method 200 can be executed by a terminal device.
[0033] like Figure 2 As shown in box 202, for each of the multiple components, the loading time of that component is predicted based on its state information when it was last loaded. (Reference) Figure 1 In some embodiments, for component 106, the time required to load component 106 is predicted based on the state information of component 106 when it was previously loaded. The state information includes a combination of the system metric level and the loading time level when component 106 was loaded. The system metric level indicates the level of the device's system metric (S) when the component is loaded, such as high load, medium load, or low load; the loading time level (T) indicates the level of the time required to load the component, such as long loading time, medium loading time, or short loading time. In some implementations, the state information can be defined as (S, T), where S and T can be discrete values.
[0034] In some embodiments, using the state information of the component when it was previously loaded, one or more state information of the component when it is currently loaded is predicted by querying the state transition matrix associated with the component. Based on the predicted one or more state information, the predicted loading time of the component is obtained. The state transition matrix represents the probability of a state change of the component. For example, the state information of component 106 when it was previously loaded is determined, the state transition matrix associated with component 106 is queried, and one or more state information of component 106 when it is currently loaded is predicted. Based on the predicted one or more state information of component 106, the predicted loading time of component 106 is obtained.
[0035] In some embodiments, the loading time of the component is predicted based on the most probable state information among one or more predicted state information. For example, the loading time of component 106 is predicted based on the most probable state information among one or more predicted state information of component 106.
[0036] In some embodiments, an expected value is determined based on one or more predicted state information and corresponding probabilities, and this expected value is determined as the predicted loading time of the component. For example, an expected value is determined based on one or more predicted state information of component 106 and corresponding probabilities, and this expected value is determined as the predicted loading time of component 106.
[0037] In box 204, based on the predicted loading time of the component, it is determined whether the component can be loaded within the current cycle of the loop. (Reference) Figure 1 In some embodiments, based on the predicted loading time of component 106, it is determined whether the loading task of component 106 can be completed within the current cycle 102 of the loop.
[0038] In some embodiments, if the loading of a component can be completed within the current cycle of a loop, the component is loaded within the current cycle of the loop. For example, based on the predicted loading time of component 106 and the sum of the loading times of the three components preceding component 106 being less than the cycle period (i.e., less than the duration of a frame displayed on the screen), it is determined that the loading of component 106 can be completed within the current cycle 102 of the loop. For example, if the duration of a frame displayed on the screen is 16.67ms (i.e., the cycle period is 16.67ms), and the predicted sum of the loading times of the three components sequentially loaded before component 106 is 5ms, then 11.67ms remain in the current cycle 102 for the loading task of component 106. In other words, when the expected loading time of component 106 is less than 11.67ms, component 106 can be loaded completely within the current cycle 102 of the loop.
[0039] In box 206, if the component cannot be loaded within the current cycle, it will be loaded in the next cycle of the loop. (See reference) Figure 1 In some embodiments, based on the fact that the predicted loading time of component 106 and the sum of the loading times of the three components preceding component 106 are greater than or equal to the loop period, i.e., greater than or equal to the duration of one frame displayed on the screen, it is determined that the loading of component 106 will be completed within the next cycle 104 of the loop. For example, when the duration of one frame displayed on the screen is 16.67ms (i.e., the loop period is 16.67ms), if the sum of the predicted loading times of the three components sequentially loaded before component 106 is 5ms, and the predicted loading time required for component 106 is 12ms, then... Figure 1 The sum of the estimated loading times of the four components shown exceeds the duration of the loop cycle. Component 106 cannot be loaded in the current cycle 102 of the loop, and component 106 will be loaded in the next cycle 104 of the loop.
[0040] In this way, the number of components that need to be loaded within a loop cycle can be dynamically determined, so that the total time for loading multiple components within a loop cycle is less than the length of one frame displayed on the screen, thereby avoiding problems such as frame drops, stuttering, and excessively long loading times.
[0041] Figure 3 A flowchart of a method 300 for determining a state transition matrix of a component according to some embodiments of the present disclosure is shown. Method 300 may be executed, for example, by a terminal device.
[0042] In box 302, system metrics and loading times are obtained when the component is loaded multiple times. In some embodiments, the terminal device may obtain system metrics and loading times when one of a plurality of components has been previously loaded multiple times, wherein the system metrics include at least one of processor utilization, memory usage, and temperature. (See reference) Figure 1 Get the system metrics when component 106 is loaded multiple times within a certain period of time, as well as the loading time corresponding to the system metrics.
[0043] In box 304, system metrics and loading times are discretized to generate historical state information. This historical state information consists of the discretized system metrics and loading times. (Reference) Figure 1 The system metrics and loading times corresponding to the system metrics are obtained when component 106 is loaded multiple times within a certain time period through discretization.
[0044] For example, the processor utilization rate in system metrics can be divided into three levels, such as low, medium, and high. Low processor utilization rate indicates that the processor utilization rate is between 0-30% when components are loaded; medium processor utilization rate indicates that the processor utilization rate is between 30%-70% when components are loaded; and high processor utilization rate indicates that the processor utilization rate is between 70%-100% when components are loaded. Memory usage in system metrics can be divided into three levels, such as sufficient, medium, and insufficient. Sufficient memory usage rate indicates that more than 50% of the memory capacity remains when components are loaded; medium memory usage rate indicates that 20%-50% of the memory capacity remains when components are loaded; and insufficient memory usage rate indicates that less than 20% of the memory capacity remains when components are loaded. Temperature in system metrics can be divided into three levels, such as normal, high, and high. Normal temperature level indicates that the device temperature is less than 40 degrees Celsius when components are loaded; high temperature level indicates that the device temperature is between 40 and 45 degrees Celsius when components are loaded; and high temperature level indicates that the device temperature is higher than 45 degrees Celsius when components are loaded. Loading time can be categorized into three levels: short, medium, and long. A short loading time level indicates a component loading time of less than 5ms; a medium loading time level indicates a component loading time between 5 and 10ms; and a long loading time level indicates a component loading time greater than 10ms.
[0045] In some embodiments, historical state information for multiple loads of the component is generated by discretizing system metrics and loading times. (See reference) Figure 1 The system metrics and loading times of component 106 when it is loaded multiple times are obtained. For example, the system metrics and loading times of component 106 when it is loaded 100 times can be obtained. By discretizing the system metrics and loading times of these 100 times, the corresponding historical state information of component 106 when it is loaded 100 times can be generated. For example, the system metrics of component 106 when it is loaded 100 times may be that the processor utilization rate is 80%, the remaining memory accounts for 10% of the memory capacity, and the temperature is 50 degrees. The loading time of component 106 is 11ms. Discretizing the system metrics of this time generates the historical state information of component 106 as high processor utilization, insufficient memory usage, high temperature, and long loading time. That is, the historical state information of component 106 is (high processor utilization, insufficient memory usage, high temperature, long loading time) (for ease of explanation and illustration, it is described as (S1, T1), where S represents the system metric level and T represents the loading time level).
[0046] In box 306, the historical state information is sorted by time to obtain a sequence of historical state information. For example, after generating the historical state information for each of the 100 times that component 106 was loaded, the 100 historical state information are sorted according to the time order in which component 106 was loaded to obtain a sequence of historical state information for the 100 times that component 106 was loaded.
[0047] In block 308, a state transition matrix is generated using a Markov chain method based on a sequence of historical state information. In some embodiments, the state transition matrix is generated using a Markov chain method based on a sequence of historical state information in which component 106 has been loaded 100 times. Specifically, initial state information and target state information are selected from the sequence of historical state information of component 106. The number of times the initial state information appears in the sequence of historical state information is determined (referred to as the first count for ease of explanation). The number of times the target state information appears in the sequence of historical state information is determined (referred to as the second count for ease of explanation). Based on the first count and the second count, the probability of transitioning from the initial state information to the target state information in the sequence of historical state information is determined. The state transition matrix of component 106 is constructed based on the probability.
[0048] For example, in the sequence of 100 historical state information, the transition from the historical state information (S1,T1) (i.e., the initial state information) of component 106 to (low processor utilization, sufficient memory usage, normal temperature, short loading time) (described as (S2,T2) for ease of explanation) (i.e., the target state information) occurred a total of 10 times, and a total of 20 times from historical state information (S1,T1) to historical state information (S2,T2). Therefore, the transition probability from (S1,T1) to (S2,T2) is 10 / 20, or 0.5. By repeatedly executing the above method, the state transition matrix of component 106 is determined. For example, the state transition matrix of component 106 can be determined as follows:
[0049]
[0050]
[0051] It should be understood that the above description of determining the state transition matrix of component 106 is only an example. The state transition matrix corresponding to each component can be determined based on the sequence of historical state information of each component of all components to be loaded, thereby predicting the loading time of each component to be loaded.
[0052] Next, referring to the exemplary state transition matrix above, a specific implementation for predicting the component's loading time will be described. In some embodiments, using the state information from the previous loading, one or more state information for the component's current loading is predicted by querying the state transition matrix associated with the component. Based on the predicted one or more state information, the predicted loading time of the component is obtained. (See reference...) Figure 1 The system retrieves the state information of component 106 when it was previously loaded, for example, (S1, T1), and determines the loading time level of the previous loading as T1. It then retrieves system metrics for the current loading of component 106, such as processor utilization at 10%, remaining memory at 70% capacity, and temperature at 30 degrees Celsius. These metrics are discretized to determine the current system state of component 106 when it is loaded as (low processor utilization, sufficient memory usage, normal temperature, short loading time) (i.e., state S2). Based on the current system state S2 when component 106 is loaded and the loading time level of the previous loading as T1, the current state is determined to be (S2, T1). By querying the state transition matrix associated with component 106, one or more state information of component 106 when it is currently loaded can be predicted. For example, the probability of transitioning from (S2,T1) to (S1,T1) is 0.1; the probability of transitioning from (S2,T1) to (S1,T2) is 0.1; the probability of transitioning from (S2,T1) to (S2,T1) is 0.7; and the probability of transitioning from (S2,T1) to (S2,T2) is 0.1.
[0053] In some embodiments, the loading time of the component is predicted based on the most probable state among one or more predicted state information. For example, the most probable state among the predicted one or more state information is (S2, T1), with a probability of 0.7. That is, the most likely state of the currently loading component 106 is (S2, T1), and the loading time level of the currently loading component 106 is T1, where T1 represents a loading time range of 0-5ms. The midpoint of this loading time range, i.e., 2.5ms, is selected as the loading time of the currently loading component 106.
[0054] In some embodiments, an expected value is determined based on one or more predicted state information and the corresponding probabilities, and this expected value is determined as the predicted loading time of the component. For example, one or more predicted state information and the probabilities corresponding to the one or more state information can be determined based on the state transition matrix of component 106. For instance, when the current state of component 106 is (S2, T1), the predicted one or more state information of component 106 when it is currently loaded includes: a probability of 0.1 for transitioning from (S2, T1) to (S1, T1); a probability of 0.1 for transitioning from (S2, T1) to (S1, T2); a probability of 0.7 for transitioning from (S2, T1) to (S2, T1); and a probability of 0.1 for transitioning from (S2, T1) to (S2, T2). Choose the median value of the loading time interval for component 106. For example, if T1 in (S1,T1) is between 0-5ms, choose 2.5ms as the median; if T2 in (S1,T2) is between 5-10ms, choose 7.5ms as the median; if T1 in (S2,T1) is between 0-5ms, choose 2.5ms as the median; and if T2 in (S2,T2) is greater than 10ms, choose 12.5ms as the median. Therefore, the expected value calculation formula can be determined as 0.1*2.5 + 0.1*7.5 + 0.7*2.5 + 0.1*12.5 = 4ms. Use 4ms as the predicted loading time for component 106.
[0055] In some embodiments, after the component has been loaded, its current state information is determined based on current system metrics and the component's actual loading time. Then, based on this current state information, the component's state transition matrix is updated. The dynamically updated state transition matrix can be used to predict the component's next loading time. (See reference...) Figure 1After component 106 is loaded, based on the current system metric S2 and the actual loading time (e.g., 3ms), the current state information of component 106 is determined to be (S2, T1). The state transition matrix of component 106 is updated based on the current state information (S2, T1). For example, based on the current state information (S2, T1), the sequence of historical state information of component 106 includes the updated current state (S2, T1), meaning the sequence length increases to 101, and component 106 is loaded 101 times. Initial state information and target state information are selected from the updated sequence of historical state information of component 106. The first occurrence count of the initial state information in the historical state information sequence is determined. The second occurrence count of the target state information in the historical state information sequence is determined. Based on the first and second occurrence counts, the probability of transitioning from the initial state information to the target state information in the updated sequence of historical state information is determined. The state transition matrix of component 106 is updated based on the probability. By continuously acquiring the state information after the component is loaded, the state transition matrix is updated, and the next loading time can be predicted based on the updated state transition matrix, thus making the predicted loading time of the component more accurate.
[0056] The above is for reference only. Figures 1 to 3 The exemplary embodiments described provide a method for loading components. Compared to existing technologies, its advantage lies in its ability to accurately predict the loading time of each component that needs to be loaded, thereby dynamically determining the number of component loading tasks to be executed within the cycle of a thread loop, and avoiding frame drops and stuttering issues when loading components all at once.
[0057] Figure 4 A block diagram of an apparatus 400 for loading components according to some embodiments of the present disclosure is shown. As shown in FIG400, the apparatus 400 includes a prediction unit 402 configured to predict the loading time of each of a plurality of components based on state information of the component when it was last loaded. The apparatus 400 also includes a determination unit 404 configured to determine, based on the predicted loading time of the component, whether the loading of the component can be completed within the current cycle of a loop. The apparatus 400 also includes a loading unit 406 configured to load the component in the next cycle if the loading of the component cannot be completed within the current cycle.
[0058] In some embodiments, the prediction unit 402 may also be configured to: use the state information at the time of the previous loading to predict one or more state information of the component at the time of current loading by querying the state transition matrix associated with the component; and obtain the predicted loading time of the component based on the predicted one or more state information.
[0059] In some embodiments, the status information includes a combination of the system metric level at the time the component was loaded and the loading time level.
[0060] In some embodiments, the prediction unit 402 may also be configured to predict the loading time of the component based on the most probable state information among one or more predicted state information.
[0061] In some embodiments, the prediction unit 402 may also be configured to: determine an expected value based on one or more predicted state information and the corresponding probability; and determine the expected value as the predicted loading time of the component.
[0062] In some embodiments, the apparatus 400 may also be configured to: acquire a sequence of historical state information when the component is loaded multiple times, the historical state information in the sequence including a combination of system indicator levels and loading time levels; and determine the state transition matrix of the component based on the sequence of historical state information.
[0063] In some embodiments, the apparatus 400 may also be configured to: acquire system metrics and loading times when the component is loaded multiple times, the system metrics including at least one of processor utilization, memory usage and temperature; generate corresponding historical state information when the component is loaded multiple times by discretizing the system metrics and loading times; and sort the historical state information according to time to obtain a sequence of historical state information.
[0064] In some embodiments, the apparatus 400 may also be configured to generate a state transition matrix based on a sequence of historical state information using a Markov chain method.
[0065] In some embodiments, the device 400 may also be configured to: determine the current state information of the component based on the current system metrics and the actual loading time of the component after the component is loaded; and update the state transition matrix of the component based on the current state information of the component.
[0066] In some embodiments, the device 400 may also be configured to load the component in the current cycle if the loading of the component can be completed in the current cycle.
[0067] In some embodiments, the period of the loop is the duration of a frame displayed on the screen.
[0068] Figure 5 A block diagram of a device 500 capable of implementing various embodiments of the present disclosure is shown. (See diagram for example.) Figure 5As shown, device 500 includes a computing unit 501, which may be a central processing unit (CPU) and / or a graphics processing unit (GPU). The computing unit 501 can execute various appropriate actions and processes based on computer program instructions stored in read-only memory (ROM) 502 or loaded from storage unit 508 into random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An input / output (I / O) interface 505 is also connected to bus 504. Although not shown in... Figure 5 As shown, device 500 may also include a coprocessor.
[0069] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0070] The various methods or processes described above can be executed by computing unit 501. For example, in some embodiments, the methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps or actions of the methods or processes described above can be performed.
[0071] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.
[0072] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0073] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network (LAN), a wide area network (WAN), and / or a wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0074] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages and conventional procedural programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0075] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / poses specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / poses specified in one or more blocks of the flowchart and / or block diagram.
[0076] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to achieve the functions / poses specified in one or more boxes of a flowchart and / or block diagram.
[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0078] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for loading components, used to sequentially load multiple components in a periodic loop of a thread, the method comprising: For each of the plurality of components, the loading time of the component is predicted based on the state information of the component when it was last loaded; Based on the predicted loading time of the component, determine whether the loading of the component can be completed within the current cycle of the loop; as well as If the component cannot be loaded within the current cycle, it will be loaded in the next cycle of the cycle.
2. The method according to claim 1, wherein, Based on the component's state information when it was last loaded, the predicted loading time for this component includes: Using the state information from the previous loading, one or more state information for the current loading of the component are predicted by querying the state transition matrix associated with the component; and Based on one or more of the predicted state information, the predicted loading time of the component is obtained.
3. The method according to claim 1 or 2, wherein, The status information includes a combination of the system indicator level and the loading time level when the component is loaded.
4. The method according to claim 2, wherein, The predicted load time for this component includes: The loading time of the component is predicted based on the most probable state information among one or more predicted state information.
5. The method according to claim 2, wherein, The predicted load time for this component includes: The expected value is determined based on one or more predicted state information and the corresponding probabilities; and The expected value is determined as the predicted loading time of the component.
6. The method according to claim 1, further comprising: Obtain a sequence of historical state information when the component is loaded multiple times, wherein the historical state information in the sequence includes a combination of system indicator level and loading time level; as well as Based on the sequence of historical state information, the state transition matrix of the component is determined.
7. The method according to claim 6, wherein, Determining the state transition matrix of this component includes: Obtain system metrics and loading times when the component is loaded multiple times, wherein the system metrics include at least one of processor utilization, memory usage, and temperature; By discretizing the system metrics and the loading time, historical state information is generated for each instance of the component being loaded multiple times; and The historical state information is sorted according to time to obtain a sequence of historical state information.
8. The method according to claim 6, wherein, Determining the state transition matrix of this component includes: The state transition matrix is generated based on the sequence of historical state information using the Markov chain method.
9. The method according to claim 1, further comprising: After the component is loaded, its current status information is determined based on the current system metrics and the actual loading time of the component. as well as Update the state transition matrix of the component based on its current state information.
10. The method according to claim 1, further comprising: If the component can be loaded within the current cycle, then load the component within the current cycle of the loop.
11. The method according to claim 1, wherein, The cycle period is the duration of the frames displayed on the screen.
12. An apparatus for loading components, for sequentially loading multiple components in a periodic loop of a thread, the apparatus comprising: The prediction unit is configured to predict the loading time of each of the plurality of components based on the state information of the component when it was last loaded. The determining unit is configured to determine, based on the predicted loading time of the component, whether the loading of the component can be completed within the current cycle of the loop; as well as The loading unit is configured to load the component in the next cycle of the cycle if the component cannot be loaded within the current cycle.
13. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the electronic device to perform the method according to any one of claims 1-11.
14. A computer-readable storage medium having stored thereon computer-executable instructions, wherein the computer-executable instructions are executed by a processor to implement the method according to any one of claims 1-11.
