Memory utilization control method and system for soft and hard decoding mode switching
By monitoring terminal memory usage records and video playback logs, memory resources are allocated, and software and hardware decoding strategies are optimized. This solves the problem of wasted memory resources during terminal video decoding and achieves efficient memory management and stable operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUIZHIAN INFORMATION TECH CO LTD
- Filing Date
- 2025-12-28
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, terminals fail to effectively differentiate memory resource usage during video decoding, leading to wasted memory resources and a decline in overall terminal performance, especially in the process of switching between software and hardware decoding, where memory usage efficiency is low.
By monitoring terminal memory usage records and video playback logs, the memory configuration requirements under baseline working conditions are determined, reserved memory and available memory are divided, and the memory configuration strategies for software decoding and hardware decoding are controlled according to the video playback task process attributes to optimize memory resource allocation.
It improves memory resource utilization efficiency, avoids memory waste, ensures stable operation of the terminal during video decoding, and enhances overall performance.
Smart Images

Figure CN121842402A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of unmanned aerial vehicle control, and particularly relates to a memory utilization control method and system for switching between soft decoding and hard decoding. BACKGROUND
[0002] Soft decoding and hard decoding are commonly used decoding methods for video playing; wherein soft decoding is realized by software algorithm depending on CPU; hard decoding is realized by special hardware such as GPU or decoding chip to accelerate decoding process. Both soft decoding and hard decoding need memory support of the terminal during implementation, wherein the memory is mainly used for storing decoding context. The data volume of decoding context directly determines the memory volume required by decoding process, and the data volume of decoding context depends on the complexity and volume of video data to be decoded. The prior art regards all memory of the terminal as freely deployable memory during decoding, which can ensure the memory requirement of decoding operation, but when decoding complex and large volume video data, it may excessively occupy memory resources, affecting the normal work of the terminal as a whole. In addition, during the switching between soft decoding and hard decoding, the memory usage volume fluctuates, and the memory resources need to be released and recovered in time in response to the fluctuation, to improve the memory usage efficiency and reduce memory usage waste. SUMMARY
[0003] Considering that the existing terminal does not distinguish and demarcate the memory resource usage part for video data decoding and its own reference working state, affecting the normal work of the terminal as a whole, and cannot timely and accurately release and recover memory resources during the switching between soft decoding and hard decoding, reducing the memory resource usage efficiency and causing waste. In view of the above problems, the present application is proposed to provide a memory utilization control method for switching between soft decoding and hard decoding to overcome the above problems or at least partially solve the above problems, comprising:
[0004] According to the memory usage record of the terminal, determining the memory configuration requirement of the terminal in the reference working state; wherein the reference working state refers to that the terminal only maintains a number of specific types of running functions; according to the memory configuration requirement, setting the available memory part of the terminal;
[0005] Listening to and analyzing the video playing log of the terminal to determine the video playing task progress sequence of the terminal; according to the video playing attribute of all processes under the progress sequence, determining the decoding operation strategy of the video playing task; wherein the decoding task operation strategy includes the implementation time interval of soft decoding and hard decoding;
[0006] During the execution of the decoding operation strategy, according to the switching memory state of soft decoding and hard decoding, controlling the memory configuration of the available memory part for decoding switching.
[0007] Optionally, according to the memory usage record of the terminal, the memory configuration requirement of the terminal in the benchmark working state is determined; according to the memory configuration requirement, the available memory part of the terminal is set, including:
[0008] Memory call information of the terminal in the historical working period is extracted from the memory usage record of the terminal; wherein the memory call information includes memory call path and memory call duration;
[0009] According to the memory call information, the memory usage information corresponding to a plurality of specific types of running functions maintained by the terminal is determined, so as to determine the memory configuration requirement of the terminal in the benchmark working state; wherein the memory usage information includes memory usage amount and memory usage time length of maintaining each specific type of running function;
[0010] According to the memory configuration requirement and the available memory information of the terminal, the memory demarcation and identification of the terminal is performed, and the reserved memory part and the available memory part of the terminal are set; wherein the reserved memory part refers to the memory part dedicated to the plurality of specific types of running functions; the available memory part refers to the memory part that can be freely used.
[0011] Optionally, the video playing log of the terminal is listened to and analyzed to determine the video playing task process sequence of the terminal; according to the video playing attribute of all processes under the process sequence, the decoding operation strategy of the video playing task is determined, including:
[0012] The video playing log of the terminal is listened to to obtain the video data attribute of the video data loaded by the video playing process of the terminal; wherein the video data attribute refers to the code stream change attribute of the video data;
[0013] According to the video data attribute, the video playing task process sequence of the terminal is determined; wherein the video playing task process sequence includes all processes executed in the process of playing the loaded video data;
[0014] According to the video data part corresponding to each process of all processes, the video playing resolution attribute corresponding to each process of all processes is determined; according to the video playing resolution attribute, the decoding operation strategy of the video playing task is determined; wherein the decoding operation strategy includes the decoding mode implementation type and implementation time interval corresponding to each process, and the decoding mode implementation type includes soft decoding or hard decoding.
[0015] Optionally, according to the switching memory state of soft decoding and hard decoding during the execution of the decoding operation strategy, the memory configuration of the available memory part to decoding switching is controlled, including:
[0016] acquiring the decoding mode implementation type corresponding to any two adjacent processes during the execution of the decoding operation strategy, so as to determine all adjacent two processes in which the soft decoding and hard decoding switching event occurs;
[0017] controlling the memory allocation quantity or the memory recycling quantity of the available memory part for the switching event according to the memory usage change quantity between the adjacent two processes in which the soft decoding and hard decoding switching event occurs.
[0018] As an aspect of the present application, the embodiment of the present application further provides a memory utilization control system for soft and hard decoding mode switching, comprising:
[0019] a memory configuration requirement determination module configured to determine the memory configuration requirement of the terminal in a reference working state according to the memory usage record of the terminal; wherein the reference working state refers to that the terminal only maintains a plurality of specific types of running functions;
[0020] a memory setting module configured to set the available memory part of the terminal according to the memory configuration requirement;
[0021] a process sequence determination module configured to listen to and analyze the video playing log of the terminal, and determine the video playing task process sequence of the terminal;
[0022] a decoding operation strategy determination module configured to determine the decoding operation strategy of the video playing task according to the video playing attribute of all processes under the process sequence; wherein the decoding task operation strategy comprises the implementation time interval of soft decoding and hard decoding;
[0023] a memory configuration control module configured to control the memory configuration of the available memory part for decoding switching according to the switching memory state of soft decoding and hard decoding during the execution of the decoding operation strategy.
[0024] Optionally, the memory configuration requirement determination module is configured to determine the memory configuration requirement of the terminal in a reference working state according to the memory usage record of the terminal, comprising:
[0025] extracting the memory calling information of the terminal during the historical working of the terminal from the memory usage record of the terminal; wherein the memory calling information comprises the memory calling path and the memory calling duration;
[0026] determining the memory usage information corresponding to the plurality of specific types of running functions maintained by the terminal according to the memory calling information, so as to determine the memory configuration requirement of the terminal in the reference working state; wherein the memory usage information comprises the memory usage quantity and the memory usage time length of each specific type of running function;
[0027] The memory setting module is used to set the available memory portion of the terminal according to the memory configuration requirements, including:
[0028] Based on the memory configuration requirements and the available memory information of the terminal, the terminal's memory is allocated and identified, and a reserved memory portion and an available memory portion are set for the terminal; wherein the reserved memory portion refers to the memory portion dedicated to the aforementioned specific types of operating functions; and the available memory portion refers to the memory portion that can be freely used.
[0029] Optionally, the process sequence determination module is used to monitor and analyze the video playback logs of the terminal to determine the video playback task process sequence of the terminal, including:
[0030] Monitor the video playback log of the terminal to obtain the video data attributes loaded by the video playback program in the terminal; wherein the video data attributes refer to the bitstream change attributes of the video data.
[0031] Based on the video data attributes, the video playback task process sequence of the terminal is determined; wherein the video playback task process sequence includes all processes executed during the playback of the loaded video data;
[0032] The decoding operation strategy determination module is used to determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence, including:
[0033] Based on the video data portion corresponding to each process under the process sequence, determine the video playback resolution attribute corresponding to each process; based on the video playback resolution attribute, determine the decoding operation strategy for the video playback task; wherein the decoding operation strategy includes the decoding method implementation type and implementation time interval corresponding to each process, and the decoding method implementation type includes software decoding or hardware decoding.
[0034] Optionally, the memory configuration control module is used to control the memory configuration of the available memory portion for decoding switching based on the switching memory state between software decoding and hardware decoding during the execution of the decoding operation strategy, including:
[0035] Obtain the decoding method implementation type of any two adjacent processes during the execution of the decoding operation strategy, thereby determining all two adjacent processes that have experienced a software decoding and hard decoding switching event;
[0036] Based on the change in memory usage between two adjacent processes that experience a software decoding to hardware decoding switch event, the amount of memory allocated or reclaimed by the available memory portion for the switch event is controlled.
[0037] The beneficial effects of the above-mentioned technical solutions provided in the embodiments of the present invention include at least the following:
[0038] This invention provides a memory utilization control method and system for switching between software and hardware decoding modes. Based on the terminal's memory usage records, the system determines the memory configuration requirements of the terminal in its baseline operating state; based on these requirements, it sets the available memory portion of the terminal; it monitors and analyzes the terminal's video playback logs to determine the video playback task process sequence; based on the video playback attributes of all processes within the process sequence, it determines the decoding operation strategy for the video playback task; and during the execution of the decoding operation strategy, it controls the memory configuration of the available memory portion for decoding switching based on the memory state of switching between software and hardware decoding. By defining the available memory portion for decoding operations based on the terminal's memory usage and combining this with the video playback task process sequence to determine the decoding operation strategy, the system controls memory configuration, improves memory resource utilization efficiency, and avoids wasting memory resources.
[0039] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0041] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0042] Figure 1 This is a flowchart illustrating the memory utilization control method for switching between software and hardware decoding modes provided in an embodiment of the present invention.
[0043] Figure 2 This is a schematic diagram of the memory utilization control system for switching between software and hardware decoding modes provided in an embodiment of the present invention. Detailed Implementation
[0044] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0045] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," "outer," "far," "near," "front," and "rear," etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0046] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0047] Please see Figure 1 As shown, an embodiment of this application provides a memory utilization control method for switching between software and hardware decoding modes. This memory utilization control method for switching between software and hardware decoding modes includes:
[0048] Based on the terminal's memory usage records, determine the memory configuration requirements of the terminal in its baseline operating state; the baseline operating state refers to the terminal maintaining only a few specific types of operating functions; based on the memory configuration requirements, set the available memory portion of the terminal.
[0049] Monitor and analyze the video playback logs of the terminal to determine the process sequence of the video playback task; determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence; the decoding operation strategy includes the implementation time interval of software decoding and hardware decoding.
[0050] During the execution of the decoding operation strategy, the available memory portion is controlled to allocate memory for decoding switching based on the memory state of switching between software decoding and hardware decoding.
[0051] The beneficial effects of the above embodiments are that the memory utilization control method for switching between software and hardware decoding modes delineates the available memory portion for decoding operations based on the terminal's memory usage and determines the decoding operation strategy in conjunction with the video playback task process sequence, thereby controlling memory configuration, improving memory resource utilization efficiency, and avoiding memory resource waste.
[0052] In another embodiment, the memory configuration requirements of the terminal in a baseline operating state are determined based on the terminal's memory usage records; based on the memory configuration requirements, the available memory portion of the terminal is set, including:
[0053] Extract memory call information from the terminal's memory usage records during historical memory operation; the memory call information includes the memory call path and the duration of the memory call.
[0054] Based on memory access information, the memory usage information corresponding to the terminal maintaining several specific types of operating functions is determined, thereby determining the memory configuration requirements of the terminal in its baseline operating state; the memory usage information includes the amount of memory used to maintain each specific type of operating function and the duration of memory usage.
[0055] Based on memory configuration requirements and available memory information of the terminal, the terminal's memory is allocated and identified, and the reserved memory portion and available memory portion of the terminal are set. The reserved memory portion refers to the memory portion dedicated to several specific types of running functions; the available memory portion refers to the memory portion that can be freely used.
[0056] The beneficial effects of the above embodiments are that smartphones or computers and other terminals have multiple functional programs installed inside (including video playback programs), and these functional programs all require corresponding memory resources to operate. Maintaining the terminal in its baseline working state (i.e., maintaining the minimum standard communication interaction state and the minimum standard data processing state) requires a corresponding amount of memory resources. If the terminal cannot currently provide the corresponding amount of memory resources, it will lead to abnormal situations such as terminal crashes, affecting the normal operation of the terminal. To ensure that the terminal has sufficient memory resources to support itself in maintaining the above baseline working state, it is necessary to determine the amount of memory resources based on the terminal's historical working conditions. Specifically, the memory call paths and memory call durations during the terminal's historical working period are extracted from the terminal's memory usage records to determine the memory usage information corresponding to maintaining several specific types of operating functions (such as minimum standard communication operation functions and minimum standard data processing functions), and the memory usage amount and memory usage duration corresponding to maintaining the above operating functions are quantified. It can be understood that the aforementioned minimum standard communication operation function refers to the minimum uplink communication data volume and minimum downlink communication data volume that the terminal needs to handle per unit time, and the aforementioned minimum standard data processing function refers to the minimum data processing volume that the terminal needs to process per unit time.
[0057] Based on the aforementioned memory usage information, the memory usage and duration for each specific type of operational function are determined. These memory usage and durations are then integrated and calculated to determine the terminal's memory configuration requirements in its baseline operating state (i.e., the overall memory resource quantity requirement and memory resource usage duration requirement). Furthermore, by comparing these memory configuration requirements with the terminal's own available memory information (such as the total amount of available memory resources and the maximum allowed usage time), the terminal's memory resources are divided into reserved memory and available memory. This ensures that the terminal reserves sufficient memory resources to maintain its baseline operating state and has sufficient memory resources for video data decoding operations.
[0058] In another embodiment, determining the memory configuration requirements of the terminal in a baseline operating state based on the terminal's memory usage records includes the following steps:
[0059] S1. Extract system basic function process call information within a preset historical time period before the current moment from the memory usage record of the terminal. The system basic function process call information includes the type identifier of the system basic function process, the call duration of each type of system basic function process, and the memory usage of each type of system basic function process.
[0060] S2. Determine the process memory dependency score corresponding to the system basic function process based on the call duration, memory usage, and duration of the preset historical time period for each type of system basic function process.
[0061] Preferably, the process memory dependency score is determined according to the following formula (1). :
[0062] (1)
[0063] in, The call duration of the basic function process of the k-th type of system within a preset historical time period; The memory usage of the k-th type of system basic function processes within a preset historical time period; The duration of the preset historical time period; The average memory usage of all system basic function processes, by Calculated; To prevent zero reference offset, the unit is equal to... The units are the same, and the preferred value range is 0.1 to 2.0. To prevent division by zero or disturbances by extremely small values, a value of 1.0 is recommended. For the first The importance weight of the basic functional processes of the system is dimensionless and its value range is [value range missing]. The process type is preset or dynamically adjusted based on historical behavior; n is the total number of types of basic system function processes.
[0064] This formula is used to quantitatively evaluate the memory dependence of the system's basic functional processes. It combines the process runtime percentage, memory usage intensity, and process importance weight to comprehensively reflect the memory requirements required by the system to maintain such processes under baseline operating conditions.
[0065] S3. Determine the overall memory call stability score of the system based on the memory usage of each type of system basic function process within the preset historical time period and the number of memory calls of all system basic function processes within the preset historical time period in a preset unit of time.
[0066] Preferably, the overall system memory call stability score can be calculated according to the following formula (2). :
[0067] (2)
[0068] in, The standard deviation of memory usage for all system basic function processes within a preset historical time period, expressed in MB, reflects the volatility of memory usage. Calculated; The average memory usage of all system basic function processes, by Calculated; This is the fluctuation smoothing offset, in MB, a preset value with a range of 0.01 to 0.5. It is used to prevent the coefficient of variation from being too large due to a small mean, and a value of 0.1 is recommended. The average number of memory calls for all system basic function processes within a preset historical time period and within a preset unit of time reflects memory activity. This number is obtained from the call log. The preset time ranges from 1 to 60 seconds, with 10 seconds being preferred. The logarithmic decay coefficient is dimensionless and its value ranges from 1 to 1. This is used to adjust the strength of the impact of the number of calls on the stability score.
[0069] Formula (2) is used to evaluate the overall volatility and behavioral stability of memory calls in the basic function processes of the system; the degree of volatility is reflected by the coefficient of variation of memory usage, and the stability is corrected by the logarithmic decay term of the number of calls, so as to avoid the score being too high due to the high number of calls; the higher the score, the more stable and predictable the system memory behavior is.
[0070] S4. Calculate the memory configuration requirements of the terminal in its baseline working state based on the process memory dependency score and the overall system memory call stability score.
[0071] Among them, the preferred memory configuration requirements for the terminal in its baseline operating state. It can be calculated according to the following formulas (3) and (4):
[0072] (3)
[0073] (4)
[0074] in, This is the preset maximum memory usage limit, dimensionless, with a preferred value range of 0.6 to 0.9, and a suggested value of 0.8. This indicates that regardless of system dependencies, the baseline memory usage will at most account for a certain percentage of the total memory. Ensure that there is memory available for user tasks or buffering; For calculation The baseline memory usage ratio at that time.
[0075] The weighting coefficients are dimensionless and their optimal range of values is [missing information]. This setting is used to adjust the weight of process memory dependency and system stability in the demand calculation, and can be preset. This represents the total physical memory capacity of the terminal.
[0076] The beneficial effects of the above technical solution are as follows: Explanation of the beneficial effects of steps S1-S4
[0077] Step S1 constructs a multidimensional memory behavior dataset of the terminal under baseline working conditions by extracting the type, call duration, and memory usage of the system's basic functional processes. This provides a reliable data foundation for subsequent quantitative analysis and avoids the one-sidedness of relying solely on total memory usage or single process behavior in traditional methods. By decomposing general memory usage records into process-level call information, memory requirement analysis is upgraded from overall estimation to process-level modeling, improving the accuracy of memory configuration requirements and laying the foundation for the subsequent precise allocation of reserved and available memory.
[0078] Step S2 achieves an objective and comparable score for the memory dependency of various system basic function processes by integrating the proportion of call duration, memory usage intensity, and importance weight. This overcomes the subjectivity and rigidity of traditional methods that rely on experience or static configuration. A zero-baseline offset is added to the scoring formula. This avoids numerical instability or calculation abnormalities caused by excessively low average memory usage, ensuring the reliability and adaptability of the algorithm in low memory usage scenarios.
[0079] Step S3 reflects memory volatility by using the ratio of standard deviation to mean, and combines it with a logarithmic decay term for the number of calls to comprehensively characterize the stability characteristics of system memory calls, providing a quantitative basis for judging the fluctuation range of memory demand under baseline conditions. The use of logarithmic decay instead of exponential decay avoids the problem of inflated scores due to excessively high call counts, making the stability score more realistically reflect the stability of system memory behavior and improving the rationality of subsequent memory configuration decisions.
[0080] Step S4 uses weighting coefficients The weighting of process memory dependency scores and system stability scores in the final requirement calculation is dynamically adjusted so that memory configuration reflects both the strength of functional dependencies and system behavior fluctuations; a maximum memory allocation limit is preset. This ensures that the baseline memory requirement does not exceed the total allocatable memory limit, avoiding the problem of insufficient available memory due to excessively large calculation formula outputs. It also guarantees that the terminal still has a minimum amount of available memory resources during the decoding task execution, preventing the system from freezing or experiencing performance degradation due to excessive memory reservation.
[0081] The steps S1-S4 above form a closed-loop decision chain of data collection, feature scoring, and demand calculation. The four steps are interconnected, from raw logs to quantitative scoring and finally to memory requirements, realizing a complete mapping from historical behavior to current configuration. This ensures that memory allocation is supported by both data and model. Through a scoring mechanism based on historical data, memory configuration requirements can be dynamically adjusted according to changes in system behavior, overcoming the rigidity of traditional static memory reservation methods and achieving intelligent memory management. The accurate, stable, and adaptive memory demand calculation achieved by S1-S4 directly serves subsequent steps such as allocating available memory and controlling the decoding and switching of memory configurations, thereby improving memory utilization efficiency, avoiding resource waste, and ensuring stable system operation.
[0082] In another embodiment, the video playback logs of the terminal are monitored and analyzed to determine the video playback task process sequence of the terminal; based on the video playback attributes of all processes under the process sequence, the decoding operation strategy of the video playback task is determined, including:
[0083] Monitor the video playback logs of the terminal to obtain the video data attributes loaded by the video playback program within the terminal; among which, video data attributes refer to the bitrate change attributes of the video data.
[0084] Based on the video data attributes, determine the video playback task process sequence of the terminal; the video playback task process sequence includes all processes executed during the playback of the loaded video data;
[0085] Based on the video data portion of each process in the process sequence, determine the video playback resolution attribute of each process; based on the video playback resolution attribute, determine the decoding operation strategy for the video playback task; the decoding operation strategy includes the decoding method implementation type and implementation time interval for each process, and the decoding method implementation type includes software decoding or hardware decoding.
[0086] The beneficial effects of the above embodiments are that the terminal needs to load corresponding video data to play video through the video playback program, and the bitrate of the loaded video data directly determines the process state under the video playback task; for example, the process content corresponding to the video data part with a larger bitrate is more complex, while the process content corresponding to the video data part with a smaller bitrate is simpler. In order to ensure the normal and smooth playback of video data, all processes executed during the terminal's playback of the loaded video data are determined according to the bitrate change attributes of the video data; each process corresponds to a playback operation of a part of the video data. Furthermore, based on the video data parts corresponding to each process under the process sequence, the video playback resolution attributes corresponding to each process are determined, thereby determining the decoding method implementation type and implementation time interval corresponding to each process, so that each process can choose software decoding or hardware decoding to perform decoding operations, ensuring that reliable decoding processing can be obtained throughout the entire video playback task execution.
[0087] In another embodiment, during the execution of the decoding operation strategy, the available memory portion is controlled to allocate memory for decoding switching based on the switching memory state between software decoding and hardware decoding, including:
[0088] Obtain the decoding method implementation type of any two adjacent processes during the execution of the decoding operation strategy, thereby determining all two adjacent processes that have experienced a software decoding to hardware decoding switching event;
[0089] Based on the change in memory usage between two adjacent processes that experience a software decoding to hardware decoding switch event, control the amount of memory allocated or reclaimed from the available memory for the switch event.
[0090] The beneficial effects of the above embodiments are as follows: In actual operation, the decoding method implementation type (software decoding or hardware decoding) of any two adjacent processes during the execution of the decoding operation strategy is obtained, thereby determining all two adjacent processes that experience a software decoding to hardware decoding switch event (e.g., a software decoding to hardware decoding switch event or a hardware decoding to software decoding switch event). It can be understood that the two adjacent processes experiencing the software decoding to hardware decoding switch event undergo a decoding method switch. Furthermore, based on the change in memory usage between the two adjacent processes experiencing the software decoding to hardware decoding switch event, if the change in memory usage indicates that memory usage has increased before and after the decoding switch, the amount of memory allocated to the switch event from the available memory is controlled to compensate for the increased memory usage. If the change in memory usage indicates that memory usage has decreased before and after the decoding switch, the amount of memory reclaimed from the switch event from the available memory is controlled to centrally manage the memory resources released due to the decreased memory usage, thereby improving memory resource utilization efficiency and avoiding memory resource waste.
[0091] Please see Figure 2 As shown, an embodiment of this application provides a memory utilization control system for switching between software and hardware decoding modes. This memory utilization control system for switching between software and hardware decoding modes includes:
[0092] The memory configuration requirement determination module is used to determine the memory configuration requirements of the terminal in a baseline operating state based on the terminal's memory usage records; the baseline operating state refers to the terminal maintaining only a few specific types of operating functions.
[0093] The memory setting module is used to set the available memory portion of the terminal according to memory configuration requirements;
[0094] The process sequence determination module is used to monitor and analyze the terminal's video playback logs to determine the process sequence of the terminal's video playback tasks.
[0095] The decoding operation strategy determination module is used to determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence; the decoding task operation strategy includes the implementation time interval of software decoding and hardware decoding.
[0096] The memory configuration control module is used to control the memory configuration of the available memory portion for decoding switching based on the switching memory state between software decoding and hardware decoding during the execution of the decoding operation strategy.
[0097] The beneficial effects of the above embodiments are that the memory utilization control system for switching between software and hardware decoding methods delineates the available memory portion for decoding operations based on the terminal's memory usage and determines the decoding operation strategy in conjunction with the video playback task process sequence, thereby controlling memory configuration, improving memory resource utilization efficiency, and avoiding memory resource waste.
[0098] In another embodiment, the memory configuration requirement determination module is used to determine the memory configuration requirements of the terminal in a baseline operating state based on the terminal's memory usage records, including:
[0099] Extract memory call information from the terminal's memory usage records during historical memory operation; the memory call information includes the memory call path and the duration of the memory call.
[0100] Based on memory access information, the memory usage information corresponding to the terminal maintaining several specific types of operating functions is determined, thereby determining the memory configuration requirements of the terminal in its baseline operating state; the memory usage information includes the amount of memory used to maintain each specific type of operating function and the duration of memory usage.
[0101] The memory configuration module is used to set the available memory portion of the terminal according to memory configuration requirements, including:
[0102] Based on memory configuration requirements and available memory information of the terminal, the terminal's memory is allocated and identified, and the reserved memory portion and available memory portion of the terminal are set. The reserved memory portion refers to the memory portion dedicated to several specific types of running functions; the available memory portion refers to the memory portion that can be freely used.
[0103] In another embodiment, the process sequence determination module is used to monitor and analyze the terminal's video playback logs to determine the video playback task process sequence of the terminal, including:
[0104] Monitor the video playback logs of the terminal to obtain the video data attributes loaded by the video playback program within the terminal; among which, video data attributes refer to the bitrate change attributes of the video data.
[0105] Based on the video data attributes, determine the video playback task process sequence of the terminal; the video playback task process sequence includes all processes executed during the playback of the loaded video data;
[0106] The decoding operation strategy determination module is used to determine the decoding operation strategy for the video playback task based on the video playback attributes of all processes under the process sequence, including:
[0107] Based on the video data portion of each process in the process sequence, determine the video playback resolution attribute of each process; based on the video playback resolution attribute, determine the decoding operation strategy for the video playback task; the decoding operation strategy includes the decoding method implementation type and implementation time interval for each process, and the decoding method implementation type includes software decoding or hardware decoding.
[0108] In another embodiment, the memory configuration control module is configured to control the memory configuration of the available memory portion for decoding switching based on the switching memory state between software decoding and hardware decoding during the execution of the decoding operation strategy, including:
[0109] Obtain the decoding method implementation type of any two adjacent processes during the execution of the decoding operation strategy, thereby determining all two adjacent processes that have experienced a software decoding to hardware decoding switching event;
[0110] Based on the change in memory usage between two adjacent processes that experience a software decoding to hardware decoding switch event, control the amount of memory allocated or reclaimed from the available memory for the switch event.
[0111] The memory utilization control system for switching between software and hardware decoding modes of the present invention operates and has the same effect as the memory utilization control method for switching between software and hardware decoding modes described above. Therefore, the memory utilization control system for switching between software and hardware decoding modes will not be described again here.
[0112] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. This disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims. Thus, if these modifications and variations of the invention fall within the scope of the claims of the invention and their equivalents, the invention is also intended to include these modifications and variations.
Claims
1. A memory utilization control method for switching between software and hardware decoding modes, characterized in that, include: Based on the terminal's memory usage records, determine the memory configuration requirements of the terminal in its baseline operating state; The baseline operating state refers to the terminal maintaining only a few specific types of operating functions; the available memory portion of the terminal is set according to the memory configuration requirements; Monitor and analyze the video playback logs of the terminal to determine the video playback task process sequence of the terminal; determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence; wherein the decoding task operation strategy includes the implementation time interval of software decoding and hardware decoding; During the execution of the decoding operation strategy, the available memory portion is controlled to configure the memory for decoding switching based on the switching memory state between software decoding and hardware decoding.
2. The memory utilization control method for switching between software and hardware decoding modes as described in claim 1, characterized in that: Based on the terminal's memory usage records, determine the memory configuration requirements of the terminal in its baseline operating state; Based on the aforementioned memory configuration requirements, the available memory portion of the terminal is configured, including: Extract memory call information from the terminal's memory usage records during the terminal's memory history; wherein the memory call information includes the memory call path and the memory call duration; Based on the memory access information, the memory usage information corresponding to the terminal maintaining several specific types of operating functions is determined, thereby determining the memory configuration requirements of the terminal in a baseline working state; wherein the memory usage information includes the amount of memory used to maintain each specific type of operating function and the duration of memory use; Based on the memory configuration requirements and the available memory information of the terminal, the terminal's memory is allocated and identified, and a reserved memory portion and an available memory portion are set for the terminal; wherein the reserved memory portion refers to the memory portion dedicated to the aforementioned specific types of operating functions; and the available memory portion refers to the memory portion that can be freely used.
3. The memory utilization control method for switching between software and hardware decoding modes as described in claim 1, characterized in that: Monitor and analyze the video playback logs of the terminal to determine the video playback task process sequence of the terminal; determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence, including: Monitor the video playback log of the terminal to obtain the video data attributes loaded by the video playback program in the terminal; wherein the video data attributes refer to the bitstream change attributes of the video data. Based on the video data attributes, the video playback task process sequence of the terminal is determined; wherein the video playback task process sequence includes all processes executed during the playback of the loaded video data; Based on the video data portion corresponding to each process under the process sequence, determine the video playback resolution attribute corresponding to each process; based on the video playback resolution attribute, determine the decoding operation strategy for the video playback task; wherein the decoding operation strategy includes the decoding method implementation type and implementation time interval corresponding to each process, and the decoding method implementation type includes software decoding or hardware decoding.
4. The memory utilization control method for switching between software and hardware decoding modes as described in claim 1, characterized in that: During the execution of the decoding operation strategy, based on the memory state of switching between software decoding and hardware decoding, the available memory portion is controlled for memory configuration during decoding switching, including: Obtain the decoding method implementation type of any two adjacent processes during the execution of the decoding operation strategy, thereby determining all two adjacent processes that have experienced a software decoding and hard decoding switching event; Based on the change in memory usage between two adjacent processes that experience a software decoding to hardware decoding switch event, the amount of memory allocated or reclaimed by the available memory portion for the switch event is controlled.
5. A memory utilization control system for switching between software and hardware decoding methods, characterized in that, include: The memory configuration requirement determination module is used to determine the memory configuration requirements of the terminal in a baseline working state based on the terminal's memory usage records. The baseline operating state refers to the terminal maintaining only a few specific types of operating functions; The memory setting module is used to set the available memory portion of the terminal according to the memory configuration requirements; The process sequence determination module is used to monitor and analyze the video playback logs of the terminal to determine the process sequence of the video playback task of the terminal. The decoding operation strategy determination module is used to determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence; wherein the decoding task operation strategy includes the implementation time interval of software decoding and hardware decoding. The memory configuration control module is used to control the memory configuration of the available memory portion for decoding switching based on the switching memory state between software decoding and hardware decoding during the execution of the decoding operation strategy.
6. The memory utilization control system for switching between software and hardware decoding methods as described in claim 5, characterized in that: The memory configuration requirement determination module is used to determine the memory configuration requirements of the terminal in a baseline operating state based on the terminal's memory usage records, including: Extract memory call information from the terminal's memory usage records during the terminal's memory history; wherein the memory call information includes the memory call path and the memory call duration; Based on the memory access information, the memory usage information corresponding to the terminal maintaining several specific types of operating functions is determined, thereby determining the memory configuration requirements of the terminal in a baseline working state; wherein the memory usage information includes the amount of memory used to maintain each specific type of operating function and the duration of memory use; The memory setting module is used to set the available memory portion of the terminal according to the memory configuration requirements, including: Based on the memory configuration requirements and the available memory information of the terminal, the terminal's memory is allocated and identified, and a reserved memory portion and an available memory portion are set for the terminal; wherein the reserved memory portion refers to the memory portion dedicated to the aforementioned specific types of operating functions; and the available memory portion refers to the memory portion that can be freely used.
7. The memory utilization control system for switching between software and hardware decoding methods as described in claim 5, characterized in that: The process sequence determination module is used to monitor and analyze the video playback logs of the terminal to determine the video playback task process sequence of the terminal, including: Monitor the video playback log of the terminal to obtain the video data attributes loaded by the video playback program in the terminal; wherein the video data attributes refer to the bitstream change attributes of the video data. Based on the video data attributes, the video playback task process sequence of the terminal is determined; wherein the video playback task process sequence includes all processes executed during the playback of the loaded video data; The decoding operation strategy determination module is used to determine the decoding operation strategy of the video playback task based on the video playback attributes of all processes under the process sequence, including: Based on the video data portion corresponding to each process under the process sequence, determine the video playback resolution attribute corresponding to each process; based on the video playback resolution attribute, determine the decoding operation strategy for the video playback task; wherein the decoding operation strategy includes the decoding method implementation type and implementation time interval corresponding to each process, and the decoding method implementation type includes software decoding or hardware decoding.
8. The memory utilization control system for switching between software and hardware decoding methods as described in claim 5, characterized in that: The memory configuration control module is used to control the memory configuration of the available memory portion for decoding switching based on the switching memory state between software decoding and hardware decoding during the execution of the decoding operation strategy, including: Obtain the decoding method implementation type of any two adjacent processes during the execution of the decoding operation strategy, thereby determining all two adjacent processes that have experienced a software decoding and hard decoding switching event; Based on the change in memory usage between two adjacent processes that experience a software decoding to hardware decoding switch event, the amount of memory allocated or reclaimed by the available memory portion for the switch event is controlled.