TV box intelligent interactive control unit dynamic loading method and device

By constructing dynamic priority queues and predictive loading and intelligent unloading of functional modules on the TV box software system, the resource waste and user experience problems caused by traditional static loading methods are solved, and efficient resource utilization and personalized function loading are achieved.

CN119292750BActive Publication Date: 2025-04-01SHENZHEN YUEXINTONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411803782.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-01
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

The traditional TV box software system adopts static loading, resulting in slow system startup, excessive memory usage, and serious resource waste, making it impossible to effectively utilize system resources to adapt to the usage habits and personalized needs of different users.

Method used

By mining the user operation logs of the intelligent interactive control unit, building a dynamic priority queue, realizing predictive loading and intelligent unloading of functional modules, adopting incremental update mechanisms, dynamically loading and unloading functional modules, and flexibly allocating resources according to actual needs.

Benefits of technology

It significantly improves the efficiency of system resources utilization, reduces user waiting time, improves system response speed and user experience, and improves the long-term stability and maintenance convenience of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292750B_ABST
    Figure CN119292750B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of intelligent interactive control technology, and discloses a method and device for dynamically loading an intelligent interactive control unit of a TV box. The method comprises: performing data mining on a user operation log to obtain a classification list of function modules, a usage frequency statistics table, and a dependency graph. Modularly reconstructing the software system based on the classification list to generate a function module package. Constructing a dynamic priority queue using the frequency statistics table and the dependency graph. Predictive module loading is performed in combination with the priority queue and the function module package to obtain a list of loaded modules and a resource allocation status. Intelligent module unloading is performed according to the loading status, and the module list and resource usage status are updated. Incremental updates are performed based on the version information in the module package, the function module package is updated, and the dynamic priority queue is rebuilt to obtain a target priority queue. The present invention can flexibly allocate resources according to actual needs, avoid resource waste caused by static loading, and improve resource utilization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent interactive control, and in particular to a method and device for dynamically loading an intelligent interactive control unit of a TV box. Background Art

[0002] With the rapid development of smart TV technology, TV boxes, as an important entrance to smart homes, have become increasingly rich and complex in functions. Traditional TV box software systems use static loading to load all functional modules into memory at once. This method can cope with fewer functions, but as the number of functions increases, the static loading method leads to problems such as slow system startup, excessive memory usage, and serious waste of resources.

[0003] In addition, the diversity of user usage behaviors and the increase in personalized needs have led to significant differences in the needs of different users for functional modules at different times. The static loading method cannot be optimized according to the actual usage of users, resulting in a decline in user experience and the inability to effectively utilize system resources. In this case, how to dynamically load the required functional modules based on user usage habits and system resource status has become an urgent problem to be solved. On the other hand, with the increase in the frequency of software updates, the traditional overall update method is not only time-consuming and bandwidth-intensive, but also prone to system instability due to update failures. How to achieve incremental updates of functional modules and improve update efficiency while ensuring system stability has also become an important challenge facing the smart interactive control unit of TV boxes. Summary of the invention

[0004] The present invention provides a method and device for dynamically loading an intelligent interactive control unit of a TV box. The present invention can flexibly allocate resources according to actual needs, avoid the waste of resources caused by static loading, and significantly improve the utilization efficiency of system resources.

[0005] In a first aspect, the present invention provides a method for dynamically loading a smart interactive control unit of a TV box, the method comprising:

[0006] Data mining is performed on the user operation logs of the intelligent interactive control unit to obtain a functional module classification list, a module usage frequency statistics table, and a module dependency diagram;

[0007] Modularly reconstructing the TV box software system based on the functional module classification list to obtain a functional module package;

[0008] Constructing a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph;

[0009] Predictive module loading is performed based on the dynamic priority queue and the functional module package to obtain a loaded module list and module resource allocation status;

[0010] Perform intelligent module unloading according to the loaded module list and the module resource allocation status, and update the loaded module list and the system resource usage status;

[0011] Incremental updates are performed based on the version information in the function module package, the function module package is updated and the dynamic priority queue is rebuilt to obtain a target priority queue.

[0012] In a second aspect, the present invention provides a TV box intelligent interaction control unit dynamic loading device, the TV box intelligent interaction control unit dynamic loading device comprising:

[0013] A data mining module is used to perform data mining on the user operation log of the intelligent interactive control unit to obtain a functional module classification list, a module usage frequency statistics table, and a module dependency diagram;

[0014] A reconstruction module, used for modularly reconstructing the TV box software system based on the functional module classification list to obtain a functional module package;

[0015] A construction module, used for constructing a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph;

[0016] A loading module, used for performing predictive module loading based on the dynamic priority queue and the functional module package, and obtaining a loaded module list and module resource allocation status;

[0017] An unloading module, used to perform intelligent module unloading according to the loaded module list and the module resource allocation status, and update the loaded module list and the system resource usage status;

[0018] The reconstruction module is used to perform incremental update based on the version information in the function module package, update the function module package and rebuild the dynamic priority queue to obtain a target priority queue.

[0019] The third aspect of the present invention provides a TV box intelligent interaction control unit dynamic loading device, comprising: a memory and at least one processor, the memory storing instructions; the at least one processor calls the instructions in the memory to enable the TV box intelligent interaction control unit dynamic loading device to execute the above-mentioned TV box intelligent interaction control unit dynamic loading method.

[0020] A fourth aspect of the present invention provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned dynamic loading method of the intelligent interactive control unit of the TV box.

[0021] In the technical solution provided by the present invention, by dynamically loading and unloading functional modules, the system can flexibly allocate resources according to actual needs, avoid resource waste caused by static loading, and significantly improve the utilization efficiency of system resources. The predictive module loading mechanism can load the functional modules that users may need in advance, reduce user waiting time, and improve the response speed and user experience of the system. Data mining and dynamic priority queue construction based on user operation logs enable the system to adapt to the usage habits of different users and provide more personalized function loading strategies. The intelligent module unloading mechanism can release unnecessary system resources in time to prevent system resource exhaustion, thereby improving the long-term stability of the system. The incremental update mechanism greatly reduces the amount of data transmission and update time required for the update, and at the same time ensures the security and reliability of the update process through version control and security verification. Modular reconstruction and standardized interface design make the system easier to maintain and expand, and the addition of new functions and the removal of old functions become more convenient. Through dynamic loading and unloading, the system can more effectively manage memory usage, reduce unnecessary memory usage, and make more full use of limited memory resources. Through intelligent scheduling and resource management, the system can use hardware resources more reasonably, reduce energy consumption while ensuring performance, and extend the service life of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0023] Figure 1 A schematic diagram of a flow chart of a method for dynamically loading a TV box intelligent interactive control unit provided in an embodiment of the present application;

[0024] Figure 2 A schematic block diagram of the structure of a dynamic loading device for an intelligent interactive control unit of a TV box provided in an embodiment of the present application;

[0025] Figure 3 A schematic block diagram of the structure of a dynamic loading device for an intelligent interactive control unit of a TV box provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change based on actual conditions.

[0028] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0029] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0030] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0031] See also Figure 1 , Figure 1 A flowchart of a method for dynamically loading a TV box intelligent interactive control unit provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method for dynamically loading a TV box intelligent interactive control unit provided in an embodiment of the present application includes steps S100 to S600.

[0032] Step S100: Perform data mining on the user operation log of the intelligent interactive control unit to obtain a functional module classification list, a module usage frequency statistics table, and a module dependency diagram;

[0033] It is understandable that the execution subject of the present invention can be a dynamic loading device of a smart interactive control unit of a TV box, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.

[0034] Specifically, a time series analysis is performed on the user operation log of the intelligent interactive control unit to obtain the user's use of each functional module in different time periods. The use time distribution diagram of the functional module is generated through the time series analysis to reflect the use frequency and trend of different functional modules in various time periods. Cluster analysis is performed based on the use time distribution diagram of the functional module to identify the user's use pattern of the functional module. Through clustering, the functional modules with similar use frequencies are classified to form the use pattern of the functional modules, revealing the similarities and common use habits between different modules. The use pattern of the functional modules is frequency counted to obtain the initial value of the module's use frequency. The initial value of the use frequency is a preliminary measure of the number of times the module is used, reflecting the number and frequency of the module being operated by the user. Based on the initial value of the module's use frequency, the importance index of the module is calculated to reflect the relative importance and use value of each module in the system. By calculating the importance index of the module, an importance ranking list of the module is generated. According to the importance ranking list of the module, the functional modules are classified to form a classification list of the functional modules. Modules of different importance are managed separately, so that the system can adopt different loading and unloading strategies for different types of modules during operation to achieve efficient use of resources. Perform temporal correlation analysis on the usage patterns of functional modules, explore the associations between modules, identify the calling order and usage logic between modules, reveal which modules are usually used together, or which modules are often called after certain specific operations. Through analysis, obtain the calling sequence diagram of the modules, and show the mutual relationship and calling path between functional modules. Based on the module calling sequence diagram, construct the calling relationship matrix between modules to obtain the module dependency diagram. The module dependency diagram is a graph structure that describes the mutual dependency between modules, reflecting the calling and dependency relationships between functional modules. By constructing the module dependency diagram, identify which modules need to be loaded together when used, and which modules have strong dependencies, so as to avoid functional abnormalities caused by missing modules or improper order when loading and unloading modules. Perform time decay processing on the initial value of the module usage frequency to obtain the module usage frequency statistics table, which more accurately reflects the real-time changes in user demand for the module and avoids ignoring the current user demand due to the high historical usage frequency. Through time decay, reduce the weight of modules that were once frequently used but have been used less recently, so that the module usage frequency statistics table is more in line with current user behavior.

[0035] Step S200: Modularize and reconstruct the TV box software system based on the functional module classification list to obtain a functional module package;

[0036] Specifically, the TV box software system is functionally divided according to the functional module classification list to obtain the initial module division scheme. The various functions in the system are clearly divided into different modules to facilitate modular management and loading. The initial module division scheme is subjected to coupling analysis to generate an inter-module coupling matrix. The purpose of coupling analysis is to evaluate the degree of mutual dependence between different modules. The coupling matrix is ​​a matrix that represents the relationship between modules, which intuitively reflects the mutual influence and coupling degree between modules. Based on the inter-module coupling matrix, the module boundary optimization algorithm is executed to obtain an optimized module division scheme. The purpose of the module boundary optimization algorithm is to reduce the high coupling between modules, improve the modularity of the system, make the modules as independent of other modules as possible, and avoid excessive cross-dependence. According to the optimized module division scheme, the software code is reconstructed to obtain independent functional module codes, and each module implements independent functional logic. The independent functional module codes are subjected to resource dependency analysis to clarify the resources required by each module at runtime and obtain a resource requirement list for each module. Resource dependency analysis is to identify the hardware resources, software libraries, configuration parameters, etc. required by each module during operation, so as to ensure that resources are correctly allocated when the module is loaded. Based on the resource requirement list, a standardized loading interface and unloading interface are created for each functional module to obtain the module interface definition. The interface definition is a standard interface for interaction between the module and the system. Through these interfaces, the module can be dynamically loaded or unloaded, and at the same time, the module's operation on resources during loading and unloading is ensured to comply with the standardized process to avoid resource conflicts or memory leaks. The independent functional module code and module interface definition are encapsulated to obtain the initial functional module package. The encapsulation process includes integrating the module code, interface definition and necessary configuration information to form a complete module unit. The initial functional module package is integrity checked and the module signature is generated to obtain the final functional module package. The integrity check is to ensure that the module package has not been changed during transmission and storage, and to ensure the security and reliability of the module. The module signature is used to ensure the source and authenticity of the module to prevent unauthorized modules from being loaded into the system.

[0037] Step S300: construct a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph;

[0038] Specifically, the module usage frequency statistics table is normalized to obtain a normalized frequency value, which effectively reflects the relative usage frequency of the module in the system, eliminates the impact caused by the different magnitudes of the original frequency data, and makes the frequency data of different modules comparable. The module dependency is calculated based on the module dependency graph to obtain the module dependency value. Module dependency is an important indicator to measure the relationship between a module and other modules. The higher the module dependency, the more it needs to work with other modules or be relied on by more modules, so it needs to be given priority when loading. By analyzing the calling relationship between modules, modules with strong dependencies or referenced by multiple modules are identified. The normalized frequency value and the module dependency value are input into the priority calculation function to obtain the initial priority value of each module. The priority calculation function combines the module usage frequency and dependency to evaluate the importance of the module and the necessity of loading. The initial priority value is time-decayed according to the current time of the system to obtain a time-weighted priority value, which reduces the priority of modules that were frequently used in the past but have been used less recently, so that the system can respond to the current needs of users more promptly. Based on the system resource status, the time-weighted priority value is adjusted by resource constraints to obtain the resource-weighted priority value. Consider the current resource status of the system, including the occupancy of hardware resources such as memory and processor, to ensure that when resources are limited, those important modules that occupy less resources and are frequently used are loaded first. Through resource constraint adjustment, the priority calculation is more in line with the actual situation of the system, avoiding system performance degradation or loading failure due to insufficient resources. Apply the priority smoothing algorithm to the resource-weighted priority value to obtain a smoothed priority value, avoid excessive changes in priority, and ensure the stability of the system and the rationality of module loading. By smoothing the priority, the drastic fluctuation of the priority in a short period of time is reduced, and some modules are prevented from being frequently loaded and unloaded due to temporary frequency changes, thereby reducing the system overhead and improving the system's response speed and stability. The smoothed priority value is combined with the module identifier and resource requirement information to generate a priority queue element. All priority queue elements are sorted to obtain a dynamic priority queue.

[0039] Step S400: Predictive module loading is performed based on the dynamic priority queue and the function module package to obtain a loaded module list and module resource allocation status;

[0040] Specifically, the dynamic priority queue is segmented by thresholds to obtain a subset of high-priority modules. The high-priority module subset is analyzed for correlation based on the user's current activity status and historical usage patterns to obtain a predicted loading sequence. The prediction is based on the user's current operations and past usage habits. By combining historical usage data and current contextual information, the functional modules that the user is about to use are predicted to generate a predicted loading sequence, which includes a group of modules arranged in a possible order of use. According to the predicted loading sequence, the resource requirement list of the corresponding module is extracted from the functional module package to obtain a pre-loaded resource requirement table. The pre-loaded resource requirement table includes the hardware resources and software resources required by each module in the predicted loading sequence during the loading process, such as memory requirements, computing power, and necessary library files. By extracting these resource requirements, pre-resource planning is performed for the modules to be loaded to ensure that their resource requirements can be met when loading the modules. The resource allocation algorithm is executed based on the pre-loaded resource requirement table to obtain an initial resource allocation plan. According to the current resource status of the system, the resources required by each module are reasonably allocated, thereby avoiding system performance problems caused by improper resource allocation. According to the initial resource allocation plan, the system resources are reserved to obtain the resource reservation status, ensuring that sufficient resources are provided during the module loading process to avoid loading failures caused by resources being occupied by other processes during actual loading. Based on the resource reservation status, the module data in the predicted loading sequence is loaded from the storage device to the memory to obtain the uninitialized module data in the memory. The delayed initialization program is executed on the uninitialized module data to obtain a list of modules to be activated. The necessary initialization operations are performed on the module, such as allocating internal structures, loading necessary dependent resources, etc., but the module is not activated immediately, so as to achieve a fast activation response when the user actually needs to use the module. By delaying initialization, the resource pressure of the system during the loading process is reduced, and at the same time, the user is guaranteed to use the corresponding functional module quickly when needed. The list of modules to be activated is merged with the information of activated modules, the resource usage status of the system is updated, and the list of loaded modules and the module resource allocation status are obtained.

[0041] Step S500: Unload the intelligent module according to the loaded module list and the module resource allocation status, and update the loaded module list and the system resource usage status;

[0042] Specifically, the usage time of each module in the loaded module list is analyzed to obtain a module idle time statistics table to reflect the usage activity of each module. Based on the module idle time statistics table, the module coolness index is calculated to quantify the idleness of each module. The higher the coolness index of a module, the longer its idle time is and the lower the possibility of being called by the user. Through this process, a module coolness ranking list is obtained, and the modules are sorted from high to low according to the coolness, which is convenient for identifying modules that have not been used for a long time. The resource pressure threshold is set according to the resource usage status of the system. The resource pressure threshold is used to determine whether the current system resources are in a tense state, so as to determine whether some modules need to be unloaded to release resources. By evaluating the module resource allocation status, a resource over-limit module set is obtained, that is, a module set that occupies a large amount of resources and has an important impact on the system resource pressure. The module coolness ranking list and the resource over-limit module set are cross-analyzed to screen out modules that have a long idle time and occupy more resources to form a candidate unloading module list. The modules in the candidate unloading module list are checked for dependencies to construct an unloading sequence diagram and obtain an optimized unloading sequence. The purpose of dependency checking is to ensure that when a module is uninstalled, it will not cause functional loss or failure to other modules, especially when there are strong dependencies between modules. By analyzing the dependencies between modules, the order of uninstallation is determined, and an uninstallation sequence diagram is constructed to obtain an optimized uninstallation sequence. This sequence ensures that each module is uninstalled one by one in a safe order to avoid system instability or functional abnormality caused by improper uninstallation sequence. According to the optimized uninstallation sequence, the module uninstallation operation is performed one by one, and an uninstallation result report is generated. The uninstallation result report includes the status information of each module after uninstallation and the related resource release. Based on the uninstallation result report, the system resource usage status is updated, and an incremental resource recovery algorithm is executed to obtain the updated system resource status. The purpose of the incremental resource recovery algorithm is to effectively recover the resources in the system after the module is uninstalled, avoid resource fragmentation, and improve resource utilization. Through incremental resource recovery, the system response speed and stability are maintained while gradually recovering resources. The updated system resource status is integrated with the module information after uninstallation to obtain the loaded module list and system resource usage status. The loaded module list reflects the information of modules currently loaded in the system, while the system resource usage status describes the current usage of various system resources.

[0043] Step S600: perform incremental update based on the version information in the function module package, update the function module package and rebuild the dynamic priority queue to obtain a target priority queue.

[0044] Specifically, the version information file in the function module package is parsed to obtain a local module version list, which reflects the version status of each function module in the current system. The local module version list is compared with the latest version information on the server to obtain a list of modules to be updated. The update amount is calculated according to the list of modules to be updated to obtain an incremental update data packet. The incremental update data packet is integrity checked and security scanned to obtain verified update data. The integrity check is used to ensure that the incremental update data packet has not been tampered with or damaged during transmission, while the security scan is to prevent malicious code from being included in the update data, thereby ensuring the security of the system. The verified update data is merged with the local function module package, and a module replacement operation is performed to obtain an updated function module package. After the module replacement is completed, the dependency relationship between modules is recalculated based on the updated function module package to obtain an updated module dependency graph. The module dependency graph is a key data structure that describes the relationship between each function module, reflecting the call and dependency relationship between modules. The updated module dependency graph is combined with the current system usage status, and a priority recalculation algorithm is performed to obtain an updated priority value. The priority recalculation algorithm re-evaluates the importance and loading priority of each module based on the latest version information of the module, the dependency graph, and the current usage of the system, so that the system can better schedule each module in the next step of operation. Based on the updated priority value, the dynamic priority queue is reconstructed, and a concurrent and safe queue reconstruction operation is performed to obtain the target priority queue. Appropriate synchronization mechanisms are adopted to prevent queue inconsistencies or system anomalies caused by multi-threaded operations. Through concurrent and safe queue reconstruction operations, it is ensured that the reconstruction process of the priority queue does not affect the normal operation of the system, and at the same time, it is ensured that the reconstructed queue reflects the latest module priority status.

[0045] In the embodiment of the present invention, by dynamically loading and unloading functional modules, the system can flexibly allocate resources according to actual needs, avoid resource waste caused by static loading, and significantly improve the utilization efficiency of system resources. The predictive module loading mechanism can load the functional modules that users may need in advance, reduce user waiting time, and improve the response speed of the system and user experience. Data mining and dynamic priority queue construction based on user operation logs enable the system to adapt to the usage habits of different users and provide more personalized function loading strategies. The intelligent module unloading mechanism can release unnecessary system resources in time to prevent system resource exhaustion, thereby improving the long-term stability of the system. The incremental update mechanism greatly reduces the amount of data transmission and update time required for the update, and at the same time ensures the security and reliability of the update process through version control and security verification. Modular reconstruction and standardized interface design make the system easier to maintain and expand, and the addition of new functions and the removal of old functions become more convenient. Through dynamic loading and unloading, the system can manage memory usage more effectively, reduce unnecessary memory usage, and make more full use of limited memory resources. Through intelligent scheduling and resource management, the system can use hardware resources more reasonably, reduce energy consumption while ensuring performance, and extend the service life of the equipment.

[0046] In a specific embodiment, the process of executing step S100 may specifically include the following steps:

[0047] Perform time series analysis on the user operation log of the intelligent interactive control unit to obtain a time distribution diagram of the functional module usage, and perform cluster analysis based on the time distribution diagram of the functional module usage to obtain the functional module usage pattern;

[0048] Perform frequency statistics on the usage patterns of the functional modules to obtain the initial values ​​of the module usage frequencies, and calculate the module importance index based on the initial values ​​of the module usage frequencies to obtain a module importance ranking list;

[0049] Classify the functional modules according to the module importance ranking list to obtain a functional module classification list, and perform a timing correlation analysis on the functional module usage mode to obtain a module call sequence diagram;

[0050] Based on the module call sequence diagram, the inter-module call relationship matrix is ​​constructed to obtain the module dependency diagram, and the initial value of the module usage frequency is subjected to time decay processing to obtain the module usage frequency statistics table.

[0051] Specifically, a time series analysis is performed on the user operation log of the intelligent interactive control unit to analyze the trend of user usage of the functional modules over time, and a functional module usage time distribution diagram is obtained by analyzing the user's behavior patterns in different time periods. Time series analysis is generated by counting the number of times each functional module is used in different time periods. For example, the usage frequency of a certain module A from morning to evening throughout the day is plotted with time as the horizontal axis and the number of times used as the vertical axis to form a usage time distribution diagram of module A. In order to perform time series analysis, an autoregressive moving average model is used to capture the changing patterns of user behavior in different time periods by modeling the time series data. Cluster analysis is performed based on the functional module usage time distribution diagram to identify the usage patterns of the functional modules. Similar modules are clustered together according to the user's usage habits to obtain the usage patterns of each functional module in different usage scenarios. The K-means clustering algorithm is used to cluster the usage frequency data of the functional modules into several clusters, each cluster representing a typical usage pattern. The mathematical representation of clustering is:

[0052] ;

[0053] in, Represents the objective function of clustering, which represents the sum of the distances from all data points to the center of the cluster to which they belong. It belongs to The cluster data points, It is The centers of the clusters. By minimizing , get the best clustering result, and then determine the usage pattern of each module. Perform frequency statistics on the usage patterns of functional modules to get the initial usage frequency value of each module. The initial usage frequency value is based on the number of times the module is called during user use. For example, assuming that module B is called 50 times in a month, the initial usage frequency value of module B is 50. By counting the usage frequencies of all modules, an initial list of module usage frequencies is obtained. Based on the initial value list, calculate the importance index of each module. The importance index combines the usage frequency of the module and its role in the user experience, and its calculation formula is defined as:

[0054] ;

[0055] in, Indicates The importance index of each module, It is The initial value of the usage frequency of each module, It represents the module dependency and reflects the degree of association between the module and other modules during use. By calculating the importance index, a module importance ranking list is obtained. The list is arranged from high to low according to the importance of the modules, which helps the system identify which modules are high-priority modules and which modules are uninstalled first when system resources are tight. According to the module importance ranking list, the functional modules are classified to obtain a functional module classification list. Modules with similar importance and usage characteristics are grouped together to facilitate subsequent management and optimization. For example, modules with high importance and high frequency of use are classified as "core modules", while modules with low frequency of use and less impact on user experience are classified as "secondary modules". Through classification, different strategies are adopted when loading and unloading modules, thereby improving the response efficiency and resource utilization of the system. After completing the module classification, the usage pattern of the functional modules is analyzed for timing correlation to obtain a module call sequence diagram. The purpose of timing correlation analysis is to identify which modules users usually use immediately after using certain modules, so as to determine the calling order between modules. Through timing correlation analysis, the calling order relationship between modules is obtained, and these relationships are expressed in the form of a graph, namely, the module call sequence diagram. The module call sequence diagram is represented as a directed graph ,in Represents a collection of functional modules. Represents the calling sequence relationship between modules. Based on the module calling sequence diagram, the calling relationship matrix between modules is constructed to obtain the module dependency diagram. The calling relationship matrix is ​​a square matrix, in which the elements Representation Module and modules If the module Dependencies on modules ,but ,otherwise . By calling the relationship matrix, the degree of dependency between modules is expressed. The initial value of the module usage frequency is subjected to time decay processing to obtain a module usage frequency statistics table. The purpose of time decay processing is to reduce the priority of modules that were frequently used in the past but have been used less recently, so that the system can better reflect the needs of current users. Time decay is achieved through an exponential decay function, and its formula is:

[0056] ;

[0057] in, is the module usage frequency after time decay, is the initial usage frequency, is the attenuation coefficient, is the time interval. Through time decay processing, a module usage frequency statistics table is obtained, which reflects the actual usage frequency of each module at the current time point.

[0058] Furthermore, the module call sequence graph is topologically sorted to obtain a module call sequence list; an N×N call relationship matrix is ​​constructed based on the module call sequence list, where N is the total number of modules, to obtain an initial call relationship matrix; the initial call relationship matrix is ​​normalized to obtain a normalized call relationship matrix; the direct dependency strength between modules is calculated based on the normalized call relationship matrix to obtain a direct dependency strength matrix; the Floyd-Warshall algorithm is applied to the direct dependency strength matrix to calculate the indirect dependency strength between modules to obtain a complete dependency strength matrix; the complete dependency strength matrix is ​​converted into a weighted directed graph structure to obtain a module dependency graph; an exponential decay function is applied to the initial value of the module usage frequency to calculate the time decay coefficient to obtain the time-weighted usage frequency; based on the time-weighted usage frequency, a sliding window algorithm is used to calculate the recent usage trend of the module to obtain a trend adjustment coefficient; the time-weighted usage frequency is multiplied by the trend adjustment coefficient to obtain a final adjusted usage frequency value; the final adjusted usage frequency value is normalized to obtain a module usage frequency statistics table.

[0059] In a specific embodiment, the process of executing step S200 may specifically include the following steps:

[0060] The TV box software system is functionally divided according to the functional module classification list to obtain an initial module division scheme, and the coupling degree of the initial module division scheme is analyzed to obtain an inter-module coupling degree matrix;

[0061] Execute the module boundary optimization algorithm based on the inter-module coupling matrix to obtain the optimized module partitioning scheme, and reconstruct the software code according to the optimized module partitioning scheme to obtain independent functional module codes;

[0062] Perform resource dependency analysis on the independent functional module codes to obtain the resource requirement list of each module, and create standardized loading and unloading interfaces for each functional module based on the resource requirement list to obtain the module interface definition;

[0063] The independent function module codes and module interface definitions are encapsulated to obtain an initial function module package, and the initial function module package is subjected to integrity verification and module signature generation to obtain a function module package.

[0064] Specifically, the TV box software system is functionally divided according to the functional module classification list. The functional module classification list classifies the functions in the system according to multiple factors such as the importance of the module, the frequency of use and the functional attributes. Based on the classification list, the various functional modules in the system are preliminarily divided to form an initial module division scheme. The initial module division scheme is a preliminary grouping based on the logical relevance of the system functions and the independence of the modules. The purpose is to split the system functions into multiple modules so that each module has a clear functional boundary. For example, the "video playback function" is a separate module, while the "volume control" and "subtitle management" are used as auxiliary modules to support video playback. The initial module division scheme is subjected to a module coupling analysis to obtain an inter-module coupling matrix. The purpose of the module coupling analysis is to evaluate the degree of mutual dependence between different modules. Modules with higher coupling degrees often have more data exchange or logic calls, which means that they have a closer connection in the system. In order to quantify the coupling between modules, the dependency between modules is represented by constructing an inter-module coupling matrix. The coupling matrix is ​​a symmetric matrix. The elements in the matrix are Representation Module and modules The coupling degree between them. The formula for calculating the coupling degree is:

[0065] ;

[0066] in, Representation Module and modules The coupling degree, Representation Module and modules The number of mutual calls between and Modules and modules The total number of calls. Through this formula, a coupling value between 0 and 1 is obtained. The higher the coupling, the stronger the mutual dependence between modules. Based on the inter-module coupling matrix, the module boundary optimization algorithm is executed to obtain the optimized module partitioning scheme. The purpose of module boundary optimization is to reduce the high coupling between modules, improve the independence of modules, and make the system more modular. In the process of module boundary optimization, the graph partitioning algorithm (such as spectral clustering algorithm) is used to re-partition the modules to reduce the coupling between modules. For example, through the spectral clustering algorithm, modules with strong coupling relationships are assigned to the same subset, while modules with low coupling are separated as much as possible to form a more reasonable module boundary. The spectral clustering algorithm optimizes module partitioning by performing eigenvalue decomposition on the inter-module coupling matrix. According to the optimized module partitioning scheme, the software code is reconstructed to obtain independent functional module code. The process of code refactoring is to reorganize the existing software code, separate the tightly coupled codes between different modules, ensure that the code of each module is as independent as possible, and achieve low coupling and high cohesion between modules. After completing the code refactoring, perform resource dependency analysis on the independent functional module codes to obtain a resource requirement list for each module. The purpose of resource dependency analysis is to determine the hardware and software resources required by each module at runtime, such as memory, computing power, network bandwidth, and specific software libraries. By performing resource dependency analysis on each module, a resource requirement list is obtained. ,in Representation Module The resource requirements of the system are determined, including the number and type of various resources. Based on the resource requirement list, a standardized loading interface and unloading interface are created for each functional module to obtain the module interface definition. The module interface definition is a standardized way of interaction between the module and the system. Through these interfaces, the module is dynamically loaded and unloaded to ensure that the module can correctly allocate and release resources when loading and unloading. For example, the loading interface contains the initialization operation of the module resources, while the unloading interface needs to ensure the complete release of resources to avoid memory leaks. After completing the module code and interface definition, they are encapsulated to obtain the initial functional module package. The process of module encapsulation is to package the module code, interface definition, resource requirement list and other information to form an independent module unit. The encapsulation of the module package uses a standard packaging tool to integrate the code and related configuration files together to facilitate subsequent loading and management. The initial functional module package is integrity checked and the module signature is generated to obtain the final functional module package. The integrity check is to ensure that the module package is not damaged or tampered with during transmission and storage, while the module signature is used to verify the source and authenticity of the module to prevent unauthorized modules from being loaded into the system.

[0067] Among them, the inter-module coupling matrix is ​​subjected to eigenvalue decomposition to obtain the inter-module relationship eigenvector; the module affinity graph is constructed based on the inter-module relationship eigenvector to obtain the initial module clustering structure; the hierarchical clustering algorithm is applied to the initial module clustering structure to obtain a multi-level module clustering tree; the multi-level module clustering tree is pruned based on a preset module size threshold to obtain an optimized module partitioning scheme; the dependency analysis of the original code is performed according to the optimized module partitioning scheme to obtain a code reconstruction dependency graph; based on the code reconstruction dependency graph, a code reconstruction instruction sequence is generated to obtain a reconstruction operation list; conflict detection and priority sorting are performed on the reconstruction operation list to obtain an optimized reconstruction operation sequence; the original code is automatically reconstructed according to the optimized reconstruction operation sequence to obtain a reconstructed code file; static code analysis is performed on the reconstructed code file to identify and remove redundant code and dead code to obtain a streamlined code file; modular encapsulation and interface definition are performed on the streamlined code file to obtain an independent functional module code.

[0068] In a specific embodiment, the process of executing step S300 may specifically include the following steps:

[0069] Normalize the module usage frequency statistics table to obtain a normalized frequency value, and calculate the module dependency based on the module dependency graph to obtain the module dependency value;

[0070] The normalized frequency value and the module dependency value are input into the priority calculation function to obtain an initial priority value, and the initial priority value is subjected to time decay processing according to the current time of the system to obtain a time-weighted priority value;

[0071] Performing resource constraint adjustment on the time-weighted priority value based on the system resource status to obtain a resource-weighted priority value, and applying a priority smoothing algorithm to the resource-weighted priority value to obtain a smoothed priority value;

[0072] The smoothed priority value is combined with the module identifier and the resource requirement information to obtain a priority queue element, and the priority queue elements are sorted to obtain a dynamic priority queue.

[0073] Specifically, the usage frequency of each functional module is standardized so that the frequency value can be within a uniform magnitude range, which is convenient for subsequent priority calculations. When normalizing the module usage frequency, the maximum-minimum normalization method is adopted. By mapping the original usage frequency value to the interval [0, 1], the influence of the magnitude difference between the module usage frequency on the priority calculation is eliminated, and the normalized usage frequency value is obtained. The dependency of each module is calculated based on the module dependency graph to obtain the module dependency value. Module dependency reflects the degree of mutual dependence between each module and other modules. The higher the dependency of a module, the stronger its correlation with other modules and the more important it plays in the system. In order to calculate the module dependency, an adjacency matrix is ​​constructed based on the module dependency graph, and the dependency calculation formula is used:

[0074] ;

[0075] in, Representation Module The dependence of It is the adjacency matrix element in the module dependency graph, indicating the module Depends on the module .if Depends on ,but ,otherwise By summing the adjacency matrix elements of each row, we get the module The total dependency of a module reflects its degree of coupling with other modules. The normalized frequency value and module dependency value are input into the priority calculation function to calculate the initial priority value of each module. The priority calculation function is to comprehensively consider the frequency of use of the module and its degree of dependency to determine the importance of the module in the system. The priority calculation formula is expressed as:

[0076] ;

[0077] in, Representation Module The initial priority value of It is a module The normalized frequency value of It is a module The dependence of and It is a coefficient used to adjust the weight between frequency value and dependency, reflecting the different effects of these two factors on module priority. The initial priority value of each module is obtained through the priority calculation formula, so as to determine which modules should be loaded first or kept active. After obtaining the initial priority value, the initial priority value is time-decayed according to the current time of the system to obtain a time-weighted priority value. The purpose of time decay processing is to reflect changes in user behavior and reduce the priority of modules that were frequently used in the past but have been used less recently. Time decay processing is implemented through an exponential decay model, and its formula is:

[0078] ;

[0079] in, Indicates the time-weighted priority value, is the initial priority value, is the attenuation coefficient, which controls the attenuation speed, It is the time interval from the last use to the current one. Through this formula, the priority of the module will gradually decrease over time, especially for modules that have not been used for a long time, so as to ensure that the system responds to the needs of current users more promptly. Based on the system resource status, the time-weighted priority value is adjusted for resource constraints to obtain the resource-weighted priority value. The priority of each module is dynamically adjusted according to the current resource availability of the system to make more reasonable use of limited system resources. For example, when the system memory usage is high, the priority of modules with large resource requirements is reduced to avoid performance problems in the system due to insufficient resources. The resource-weighted priority is adjusted by the following formula:

[0080] ;

[0081] in, Indicates the weighted priority value of resources. is the time-weighted priority value, Indicates the current amount of available system resources. Representation Module The resource demand. Through this formula, when resources are tight, the priority of modules with large resource consumption is lowered to achieve effective resource allocation. The priority smoothing algorithm is applied to the resource weighted priority value to obtain a smoothed priority value, avoid frequent changes in priority, and maintain the stability of the system and the consistency of module loading. For example, when a user changes his operating habits in a short period of time, the priority in the system does not fluctuate drastically, otherwise it will cause frequent loading and unloading of modules, thereby reducing system performance. Priority smoothing is achieved through the weighted average method, and its formula is:

[0082] ;

[0083] in, is the smoothed priority value, is the current resource weighted priority value, is the priority value calculated last time, is the smoothing coefficient, which controls the weight ratio of the current priority value to the historical priority value. Priority smoothing allows gradual adjustments when the priority changes to avoid drastic fluctuations. The smoothed priority value is combined with the module identifier and resource requirement information to form a priority queue element. All priority queue elements are sorted to obtain a dynamic priority queue. Modules with higher priorities are placed at the front of the queue, which means that these modules will be loaded first if system resources allow. Through the dynamic priority queue, each functional module is reasonably scheduled according to the current user needs and resource status, thereby ensuring rapid response to user operations and effective use of system resources.

[0084] In a specific embodiment, the process of executing step S400 may specifically include the following steps:

[0085] Perform threshold segmentation on the dynamic priority queue to obtain a subset of high-priority modules, and perform correlation analysis on the subset of high-priority modules based on the user's current activity status and historical usage patterns to obtain a predicted loading sequence;

[0086] Extracting a resource requirement list of a corresponding module from the functional module package according to the predicted loading sequence to obtain a preloaded resource requirement table, and executing a resource allocation algorithm based on the preloaded resource requirement table to obtain an initial resource allocation plan;

[0087] Reserving system resources according to the initial resource allocation scheme to obtain a resource reservation state, and loading module data in the predicted loading sequence from a storage device to a memory based on the resource reservation state to obtain uninitialized module data in the memory;

[0088] A delayed initialization program is executed on the uninitialized module data to obtain a list of modules to be activated, and the list of modules to be activated is merged with the activated module information, the system resource usage status is updated, and a list of loaded modules and module resource allocation status are obtained.

[0089] Specifically, the dynamic priority queue is evaluated, a priority threshold is determined, and the modules with a priority higher than the threshold are screened out to form a high-priority module subset. , compare the priority values ​​of all modules with the threshold, if the priority of the module , then the module is classified into the high-priority module subset. Based on the user's current activity status and historical usage pattern, the high-priority module subset is subjected to correlation analysis to obtain a predicted loading sequence. The purpose of correlation analysis is to predict which modules the user is most likely to use under the current operation, so as to load them in advance and improve the system response speed. Correlation analysis constructs a correlation matrix ,in Representation Module and modules The correlation matrix is ​​constructed by analyzing the user's historical operation logs and current activity status. If the user frequently used the module in the past operation Then use the module ,but The value of will be higher. By performing correlation analysis on the high-priority module subsets, a predicted loading sequence is generated according to the current user's activity status to ensure that the system loads the modules that the user is most likely to use in advance. According to the predicted loading sequence, the resource requirement list of the corresponding module is extracted from the functional module package to obtain a preloaded resource requirement table. The preloaded resource requirement table summarizes the resource requirements of all predicted loading modules, including memory requirements, CPU requirements, storage space requirements and other information. For example, suppose the predicted loading sequence contains module A and module B, and module A requires Memory resources and CPU resources, module B needs Memory resources and CPU resources, then the preload resource requirement table will contain all resource requirements of these modules. The calculation formula of the preload resource requirement table is expressed as:

[0090] ;

[0091] in, Indicates the total memory requirement, Indicates The memory requirements of each module, Indicates the total CPU demand, Indicates CPU requirements for each module, To predict the number of modules in the loading sequence. By calculating the preload resource requirement table, we can have a comprehensive understanding of the total resource requirements of the modules to be loaded. Based on the preload resource requirement table, the resource allocation algorithm is executed to obtain the initial resource allocation plan. According to the current available resources of the system, the resources of each module are reasonably allocated to ensure that each module can obtain the required hardware support during the loading process. Resource allocation is implemented through a greedy algorithm, that is, the resource requirements of modules with high priority are met first, and the requirements of other modules are met in the remaining resources. The calculation of resource allocation is expressed as:

[0092] ;

[0093] in, and Respectively indicate the assignment to the module memory and CPU resources, and Modules resource requirements, and The resource allocation algorithm generates an initial resource allocation plan to ensure that the resource requirements of each module are met. The system resources are reserved according to the initial resource allocation plan to obtain the resource reservation status. A part of the system resources are allocated to the modules to be loaded, so as to ensure that these modules will not have errors due to insufficient resources during the loading process. The reserved resources are marked as allocated in the system, but have not been actually used. Based on the resource reservation status, the module data in the predicted loading sequence is loaded from the storage device into the memory to obtain the uninitialized module data in the memory. The loading process is to read the module code and necessary data from the storage device (such as the hard disk) into the memory to prepare for the initialization of the module. After the module data is loaded into the memory, the delayed initialization program is executed on the uninitialized module data to obtain the list of modules to be activated. The purpose of delayed initialization is to configure the data structure and internal resources of the module so that it can be quickly activated when needed. The delayed initialization method allows the system to complete most of the initialization work in advance without fully activating the module, so as to provide a faster response when the user really needs to use the module. By delaying initialization, the burden of the system in the loading phase is reduced, and the efficiency of module activation is improved. After the delay initialization is completed, the list of modules to be activated is obtained, and the list is merged with the information of activated modules, and the resource usage status of the system is updated to obtain the list of loaded modules and the module resource allocation status.

[0094] In a specific embodiment, the process of executing step S500 may specifically include the following steps:

[0095] Analyze the usage time of the modules in the loaded module list to obtain a module idle time statistics table, and calculate the module cooling index based on the module idle time statistics table to obtain a module cooling ranking list;

[0096] Set resource pressure thresholds according to the system resource usage status, evaluate the module resource allocation status, obtain a resource-exceeded module set, and cross-analyze the module cooling degree sorting list with the resource-exceeded module set to obtain a candidate uninstall module list;

[0097] Check the dependencies of the modules in the candidate uninstallation module list, build an uninstallation sequence diagram, obtain an optimized uninstallation sequence, and perform module uninstallation operations one by one according to the optimized uninstallation sequence to obtain an uninstallation result report;

[0098] Based on the uninstall result report, the system resource usage status is updated, and an incremental resource recovery algorithm is executed to obtain an updated system resource status. The updated system resource status is integrated with the module information after uninstallation to obtain a loaded module list and system resource usage status.

[0099] Specifically, the most recent usage time of each module is recorded, and these data are analyzed to obtain a module idle time statistics table. The module idle time statistics table records the idle time of each module since the last use, and these time periods are used to evaluate the activity of the module. Representation Module By collecting the idle time from the last time it was used to the current time, a complete module idle time statistics table is obtained. Based on this data, the module cooling index is calculated to evaluate the relative idleness of the module. The module cooling index is calculated using the following formula:

[0100] ;

[0101] in, Representation Module The cooling index, It is a module of idle time, is the longest idle time among all modules. Through this formula, the coolness index is standardized to the interval [0, 1]. The higher the coolness, the longer the module is idle and the lower the frequency of use. By calculating the coolness index of all modules, a module coolness ranking list is obtained, which is arranged from high to low according to the coolness index, to help the system identify modules that have not been used for a long time and can be uninstalled first. After obtaining the module coolness ranking list, a resource pressure threshold is set according to the usage status of system resources to evaluate whether the current system resources are in a tight state. Resource pressure threshold It is a critical value used to judge the system resource usage. When the system resource usage exceeds this threshold, the resources are released by uninstalling the module. and resource pressure threshold, if , the system enters the resource overrun state, and evaluates the module resource allocation state to determine the resource overrun module set. The resource overrun module set contains modules that occupy large resources and have a significant impact on system resource pressure. The module cooling degree sorting list is cross-analyzed with the resource overrun module set to obtain a candidate uninstall module list. The purpose of the cross-analysis is to screen out modules that have been idle for a long time (high cooling degree) and occupy more system resources, so that they can be uninstalled first. The uninstallation of these modules has the least impact on system performance and user experience, while maximizing the release of system resources. The candidate uninstall module list is checked for dependencies to ensure that uninstalling a module will not cause abnormal system functions or failure of other modules. The purpose of the dependency check is to analyze the calls and dependencies between modules and build an uninstall sequence graph. The uninstall sequence graph is a directed graph that represents the dependency path between modules to ensure that other modules that have dependencies on a module have been processed before uninstalling it. The uninstall sequence graph is constructed by topological sorting to obtain an optimized uninstall sequence. The module uninstall operations are executed one by one according to the optimized uninstall sequence, and an uninstall result report is generated. The execution of the uninstall operation needs to ensure that the module's resources are completely released to avoid resource leakage or system instability. For example, suppose module A depends on module B. Module B has a higher cooling degree and occupies more resources, so module B is included in the list of candidate uninstall modules. When uninstalling, confirm whether the dependency of module A can be met by other means to ensure that the normal operation of module A is not affected, and then uninstall module B. The uninstall result report records the status information of each module uninstall, the amount of resources released, and the impact on the system. After the module is uninstalled, the system resource usage status is updated based on the uninstall result report, and the incremental resource recovery algorithm is executed to obtain the updated system resource status. The purpose of the incremental resource recovery algorithm is to gradually recover the resources occupied by the uninstalled modules, thereby avoiding a sudden drop in system performance and improving resource utilization efficiency. Incremental resource recovery is calculated using the following formula:

[0102] ;

[0103] in, Indicates the updated system resource status. Indicates the current resource status of the system before uninstallation. Indicates that by uninstalling the module The released resources, is the number of unloaded modules. Through incremental recycling, resources are gradually released without affecting the current task, making resource management more efficient and stable. The updated system resource status is integrated with the module information after unloading to obtain a new loaded module list and system resource usage status. The loaded module list reflects all modules in the current system that are in the loaded state, while the system resource usage status records the specific occupancy of various resources in the current system. For example, assuming that at a certain moment, the system resource usage rate exceeds the set resource pressure threshold, modules A, B, and C are included in the candidate unloading module list due to their high cooling and high resource occupation. After unloading modules B and C, the resource usage status of the system changes. Through the incremental resource recycling algorithm, the system memory occupancy is reduced and the CPU availability is improved. By integrating the module information and resource status after unloading, the loaded module list is updated, so that the system can more reasonably schedule each module according to the current resource status and user needs in subsequent operations.

[0104] In a specific embodiment, the process of executing step S600 may specifically include the following steps:

[0105] Parse the version information file in the function module package to obtain the local module version list, and compare the local module version list with the latest version information on the server to obtain the list of modules that need to be updated;

[0106] Calculate the update amount according to the list of modules to be updated to obtain an incremental update data packet, and perform integrity check and security scan on the incremental update data packet to obtain verified update data;

[0107] Merge the verified updated data with the local function module package, perform a module replacement operation to obtain an updated function module package, and recalculate the dependencies between modules based on the updated function module package to obtain an updated module dependency graph;

[0108] Combine the updated module dependency graph with the current system usage status, execute the priority recalculation algorithm, obtain the updated priority value, reconstruct the dynamic priority queue based on the updated priority value, perform concurrent and safe queue reconstruction operations, and obtain the target priority queue.

[0109] Specifically, the version information file contained in the local functional module package is read, and the version number of each module is extracted therefrom to obtain the local module version list. The version information file is usually stored in a structured format, such as JSON or XML, and records the name, version number, update time and other related information of each functional module. By parsing this information, a local module version list is obtained, which contains the specific version of each module currently in the local system. The local module version list is compared with the latest version information on the server side to obtain a list of modules to be updated. The latest version information on the server side is provided by the central update server, and usually contains the latest version number, release date and related update instructions of all functional modules. By comparing the local module version and the server-side module version, the modules whose local version lags behind the server-side version are identified, and these modules are included in the list of modules to be updated. The update amount is calculated according to the update module list to obtain an incremental update data packet. The purpose of incremental update is to transmit only the difference between the local version and the latest version, thereby reducing the amount of data transmitted over the network and improving the update efficiency. The calculation of the incremental update data packet is implemented by a difference calculation algorithm (such as a binary difference algorithm), which generates a file describing the difference between the old version and the new version. For example, for module A, if the difference between the latest version on the server and the local version is a small part of the file, only this part of the content is packaged into the incremental update data package. The incremental update amount is expressed as:

[0110] ;

[0111] in, Representation Module The update amount, It is a module The amount of data difference between the new version and the old version. By calculating the update amount of all modules to be updated, an incremental update data packet containing all the differences is generated. The incremental update data packet is integrity checked and security scanned to ensure the correctness and security of the update data. The purpose of the integrity check is to verify that there is no data loss or tampering in the incremental update data packet during transmission. The hash value of the data packet is calculated by a hash algorithm (such as SHA-256) and compared with the check value provided by the server. The purpose of the security scan is to ensure that there is no malicious code or security vulnerability in the update data packet, so as to prevent the update operation from causing the system to be attacked or damaged. After the integrity check and security scan, the verified update data is obtained to ensure that it is safely and reliably applied to the system. The verified update data is merged with the local function module package, and the module replacement operation is performed to obtain the updated function module package. The data of the old version module is replaced with the data of the new version module, and other unchanged modules are retained. For example, for module A, its old version data is deleted, and the updated data is written into the module package to form an updated function module package. After the module replacement is completed, the dependency relationship between the modules is recalculated based on the updated function module package to obtain the updated module dependency graph. The module dependency graph is a graph structure that describes the interdependencies between functional modules. Each node represents a module and the edge represents the dependencies between modules. Since some modules have been updated, their dependencies have changed accordingly, so the dependencies between modules are recalculated. The module dependency graph is represented by an adjacency matrix, where the elements Representation Module Depends on the module

[0112] ;

[0113] By recalculating the dependency graph, the latest interdependencies between modules are obtained. The updated module dependency graph is combined with the current system usage status, and the priority recalculation algorithm is executed to obtain the updated priority value of each module. Based on the latest module dependencies, the importance of the modules, and the current system usage status, the importance of each module in the system is re-evaluated. The priority value is calculated using the following formula:

[0114] ;

[0115] in, Representation Module The updated priority value of Representation Module Frequency of use, Representation Module The dependencies in the updated dependency graph (i.e. the number of modules that the module depends on). and It is a weight parameter used to adjust the influence of usage frequency and dependency. By recalculating the priority, determine which modules should be loaded first, thereby improving the response efficiency of the system. Based on the updated priority value, the dynamic priority queue is reconstructed, and a concurrent safe queue reconstruction operation is performed to obtain the target priority queue. During the queue reconstruction process, the concurrent safety of the system is guaranteed, because the loading and unloading operations of the module may be performed simultaneously in a multi-threaded environment, resulting in data competition or inconsistent state problems. When reconstructing the priority queue, use thread synchronization mechanisms (such as locks) to ensure that access to the queue is safe. For example, when a thread is modifying the priority queue, other threads will be blocked until the modification operation is completed to ensure that the queue is always in a consistent state. Get the target priority queue.

[0116] See also Figure 2 , Figure 2 A schematic block diagram of the structure of the TV box intelligent interactive control unit dynamic loading device 200 provided in the embodiment of the present application, such as Figure 2 As shown, the TV box intelligent interaction control unit dynamic loading device 200 includes:

[0117] The data mining module 210 is used to perform data mining on the user operation log of the intelligent interactive control unit to obtain a functional module classification list, a module usage frequency statistics table and a module dependency diagram;

[0118] A reconstruction module 220 is used to modularly reconstruct the TV box software system based on the functional module classification list to obtain a functional module package;

[0119] A construction module 230 is used to construct a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph;

[0120] A loading module 240 is used to perform predictive module loading based on a dynamic priority queue and a functional module package, and obtain a loaded module list and a module resource allocation status;

[0121] Unloading module 250, used to perform intelligent module unloading according to the loaded module list and module resource allocation status, and update the loaded module list and system resource usage status;

[0122] The reconstruction module 260 is used to perform incremental update based on the version information in the function module package, update the function module package and rebuild the dynamic priority queue to obtain a target priority queue.

[0123] Through the cooperation of the above components, by dynamically loading and unloading functional modules, the system can flexibly allocate resources according to actual needs, avoid resource waste caused by static loading, and significantly improve the utilization efficiency of system resources. The predictive module loading mechanism can load the functional modules that users may need in advance, reduce user waiting time, and improve the system response speed and user experience. Data mining and dynamic priority queue construction based on user operation logs enable the system to adapt to the usage habits of different users and provide more personalized function loading strategies. The intelligent module unloading mechanism can release unnecessary system resources in time to prevent system resource exhaustion, thereby improving the long-term stability of the system. The incremental update mechanism greatly reduces the amount of data transmission and update time required for updates, and at the same time ensures the security and reliability of the update process through version control and security verification. Modular reconstruction and standardized interface design make the system easier to maintain and expand, and it becomes more convenient to add new functions and remove old functions. Through dynamic loading and unloading, the system can manage memory usage more effectively, reduce unnecessary memory usage, and make more full use of limited memory resources. Through intelligent scheduling and resource management, the system can use hardware resources more reasonably, reduce energy consumption while ensuring performance, and extend the service life of the equipment.

[0124] See also Figure 3 , Figure 3 A schematic block diagram of the structure of a TV box intelligent interaction control unit dynamic loading device 300 provided in an embodiment of the present application, wherein the TV box intelligent interaction control unit dynamic loading device 300 includes a processor 301 and a memory 302, wherein the processor 301 and the memory 302 are connected via a device bus 303, wherein the memory 302 may include a non-volatile storage medium and an internal memory.

[0125] The non-volatile storage medium can store a computer program. The computer program includes program instructions, and when the program instructions are executed by the processor 301, the processor 301 can execute any of the above-mentioned TV box intelligent interactive control unit dynamic loading methods.

[0126] The processor 301 is used to provide computing and control capabilities to support the operation of the dynamic loading device 300 of the entire TV box intelligent interactive control unit.

[0127] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 301, the processor 301 can execute any of the above-mentioned TV box intelligent interactive control unit dynamic loading methods.

[0128] Those skilled in the art will understand that Figure 3The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the dynamic loading device 300 of the smart interaction control unit of the TV box involved in the scheme of the present application. The specific TV box smart interaction control unit dynamic loading device 300 may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0129] It should be understood that the processor 301 may be a central processing unit (CPU), and the processor 301 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0130] It should be noted that, technical personnel in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the TV box intelligent interaction control unit dynamic loading device 300 described above can refer to the corresponding process of the aforementioned TV box intelligent interaction control unit dynamic loading method, and will not be repeated here.

[0131] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the one or more processors implement the dynamic loading method of the TV box intelligent interaction control unit provided in the embodiment of the present application.

[0132] The computer-readable storage medium may be an internal storage unit of the TV box intelligent interaction control unit dynamic loading device 300 of the aforementioned embodiment, such as a hard disk or memory of the TV box intelligent interaction control unit dynamic loading device 300. The computer-readable storage medium may also be an external storage device of the TV box intelligent interaction control unit dynamic loading device 300, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc., equipped with the TV box intelligent interaction control unit dynamic loading device 300.

[0133] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0135] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for dynamically loading a TV box intelligent interactive control unit, characterized in that: include: Data mining is performed on the user operation logs of the intelligent interactive control unit to obtain a functional module classification list, a module usage frequency statistics table, and a module dependency diagram; Modularly reconstructing the TV box software system based on the functional module classification list to obtain a functional module package; Constructing a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph; Predictive module loading is performed based on the dynamic priority queue and the functional module package to obtain a loaded module list and module resource allocation status; Perform intelligent module unloading according to the loaded module list and the module resource allocation status, and update the loaded module list and the system resource usage status; Incremental updates are performed based on the version information in the function module package, the function module package is updated and the dynamic priority queue is rebuilt to obtain a target priority queue.

2. The method for dynamically loading a TV box intelligent interactive control unit according to claim 1, characterized in that: The data mining of the user operation log of the intelligent interactive control unit is performed to obtain a functional module classification list, a module usage frequency statistics table and a module dependency diagram, including: Performing time series analysis on the user operation log of the intelligent interactive control unit to obtain a time distribution diagram of the functional module usage, and performing cluster analysis based on the time distribution diagram of the functional module usage to obtain a functional module usage pattern; Performing frequency statistics on the functional module usage patterns to obtain module usage frequency initial values, and calculating module importance indexes based on the module usage frequency initial values ​​to obtain a module importance ranking list; Classifying the functional modules according to the module importance ranking list to obtain the functional module classification list, and performing a time sequence correlation analysis on the functional module usage patterns to obtain a module call sequence diagram; Based on the module call sequence diagram, a module call relationship matrix is ​​constructed to obtain the module dependency diagram, and the initial value of the module usage frequency is subjected to time decay processing to obtain the module usage frequency statistics table, wherein the time decay processing is implemented by an exponential decay function, and the formula of the exponential decay function is: ;in, is the module usage frequency after time decay, is the initial usage frequency, is the attenuation coefficient, is the time interval.

3. The method for dynamically loading a TV box intelligent interactive control unit according to claim 1, characterized in that: The TV box software system is modularly reconstructed based on the functional module classification list to obtain a functional module package, including: Performing functional division on the TV box software system according to the functional module classification list to obtain an initial module division scheme, and performing coupling degree analysis on the initial module division scheme to obtain an inter-module coupling degree matrix; Executing a module boundary optimization algorithm based on the inter-module coupling matrix to obtain an optimized module partitioning scheme, and reconstructing the software code according to the optimized module partitioning scheme to obtain independent functional module codes; Performing resource dependency analysis on the independent functional module codes to obtain a resource requirement list for each module, and creating a standardized loading interface and unloading interface for each functional module based on the resource requirement list to obtain a module interface definition; The independent function module code and the module interface definition are encapsulated to obtain an initial function module package, and integrity verification and module signature generation are performed on the initial function module package to obtain a function module package.

4. The method for dynamically loading a TV box intelligent interactive control unit according to claim 1, characterized in that: The step of constructing a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph includes: Normalizing the module usage frequency statistics table to obtain a normalized frequency value, and calculating the module dependency based on the module dependency graph to obtain a module dependency value; The normalized frequency value and the module dependency value are input into the priority calculation function to obtain an initial priority value, and the initial priority value is subjected to time decay processing according to the current time of the system to obtain a time-weighted priority value; wherein the time decay processing is implemented by an exponential decay model, and the formula of the exponential decay model is: ;in, Indicates the time-weighted priority value, is the initial priority value, is the attenuation coefficient, which controls the attenuation speed, is the time interval; Performing resource constraint adjustment on the time-weighted priority value based on the system resource status to obtain a resource-weighted priority value, and applying a priority smoothing algorithm to the resource-weighted priority value to obtain a smoothed priority value; The smoothed priority value is combined with a module identifier and resource requirement information to obtain a priority queue element, and the priority queue elements are sorted to obtain a dynamic priority queue.

5. The method for dynamically loading a TV box intelligent interactive control unit according to claim 1, characterized in that: The predictive module loading is performed based on the dynamic priority queue and the functional module package to obtain a loaded module list and a module resource allocation state, including: Performing threshold segmentation on the dynamic priority queue to obtain a high priority module subset, and performing correlation analysis on the high priority module subset based on the user's current activity status and historical usage pattern to obtain a predicted loading sequence; Extracting a resource requirement list of a corresponding module from the functional module package according to the predicted loading sequence to obtain a preloaded resource requirement table, and executing a resource allocation algorithm based on the preloaded resource requirement table to obtain an initial resource allocation plan; Reserving system resources according to the initial resource allocation scheme to obtain a resource reservation state, and loading module data in the predicted loading sequence from a storage device to a memory based on the resource reservation state to obtain uninitialized module data in the memory; A delayed initialization program is executed on the uninitialized module data to obtain a list of modules to be activated, and the list of modules to be activated is merged with the activated module information, the system resource usage status is updated, and a loaded module list and a module resource allocation status are obtained.

6. The method for dynamically loading a TV box intelligent interactive control unit according to claim 1, characterized in that: The intelligent module unloading according to the loaded module list and the module resource allocation status, and updating the loaded module list and the system resource usage status, comprises: The modules in the loaded module list are analyzed for usage time to obtain a module idle time statistics table, and the module cooling index is calculated based on the module idle time statistics table to obtain a module cooling ranking list; wherein the module cooling index is calculated to evaluate the relative idleness of the module, and the module cooling index is calculated by the following formula: ;in, Representation Module The cooling index, It is a module of idle time, It is the longest idle time among all modules; Setting a resource pressure threshold according to the system resource usage status, evaluating the module resource allocation status to obtain a resource-exceeded module set, and cross-analyzing the module cooling degree sorting list with the resource-exceeded module set to obtain a candidate uninstall module list; Perform dependency check on the modules in the candidate uninstallation module list, construct an uninstallation sequence diagram, obtain an optimized uninstallation sequence, and perform module uninstallation operations one by one according to the optimized uninstallation sequence to obtain an uninstallation result report; Based on the uninstall result report, the system resource usage status is updated, an incremental resource recovery algorithm is executed to obtain an updated system resource status, and the updated system resource status is integrated with the module information after uninstallation to obtain a loaded module list and system resource usage status.

7. The method for dynamically loading a TV box intelligent interactive control unit according to claim 1, characterized in that: The incremental update based on the version information in the function module package, updating the function module package and rebuilding the dynamic priority queue to obtain the target priority queue includes: Parsing the version information file in the functional module package to obtain a local module version list, and comparing the local module version list with the latest version information on the server to obtain a list of modules that need to be updated; Calculating the update amount according to the list of modules to be updated to obtain an incremental update data packet, and performing integrity verification and security scanning on the incremental update data packet to obtain verified update data; Merging the verified updated data with the local function module package, performing a module replacement operation to obtain an updated function module package, and recalculating dependencies between modules based on the updated function module package to obtain an updated module dependency graph; The updated module dependency graph is combined with the current system usage status, and a priority recalculation algorithm is executed to obtain an updated priority value. The dynamic priority queue is reconstructed based on the updated priority value, and a concurrent and safe queue reconstruction operation is performed to obtain a target priority queue.

8. A dynamic loading device for a TV box intelligent interactive control unit, characterized in that: A method for dynamically loading a TV box intelligent interactive control unit according to any one of claims 1 to 7, comprising: A data mining module is used to perform data mining on the user operation log of the intelligent interactive control unit to obtain a functional module classification list, a module usage frequency statistics table, and a module dependency diagram; A reconstruction module, used for modularly reconstructing the TV box software system based on the functional module classification list to obtain a functional module package; A construction module, used for constructing a dynamic priority queue according to the module usage frequency statistics table and the module dependency graph; A loading module, used for performing predictive module loading based on the dynamic priority queue and the functional module package, and obtaining a loaded module list and module resource allocation status; An unloading module, used to perform intelligent module unloading according to the loaded module list and the module resource allocation status, and update the loaded module list and the system resource usage status; The reconstruction module is used to perform incremental update based on the version information in the function module package, update the function module package and rebuild the dynamic priority queue to obtain a target priority queue.

9. A TV box intelligent interactive control unit dynamic loading device, characterized in that: The TV box intelligent interaction control unit dynamic loading device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instruction in the memory so that the TV box intelligent interaction control unit dynamic loading device executes the TV box intelligent interaction control unit dynamic loading method as described in any one of claims 1-7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by the processor, the method for dynamically loading the intelligent interactive control unit of a TV box as described in any one of claims 1-7 is implemented.

Citation Information

Patent Citations

  • Dynamic front-end content loading optimization method, system and equipment based on user behavior prediction and medium

    CN118276981A

  • Page interaction component loading optimization method and device

    CN118535817A