Resource allocation method and device of WiFi module, equipment and storage medium

By collecting real-time information on the internal resource usage of the WiFi module and dynamically adjusting the program loading order and resource allocation, the problem of traditional WiFi module resource scheduling methods being unable to adapt to complex scenarios is solved, thereby improving device response speed and user experience.

CN122227252APending Publication Date: 2026-06-16GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GREE ELECTRIC APPLIANCE INC OF ZHUHAI
Filing Date
2025-12-17
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Traditional WiFi module program loading and resource scheduling methods mostly use static configuration or fixed rules, which are difficult to adapt to complex and ever-changing application scenarios and resource requirements.

Method used

By acquiring the resource status data and task list of the WiFi module, the system predicts resource usage, dynamically determines the target functional modules and their loading order, allocates resources based on priority, usage frequency, or user history data, and sets reserved resources to cope with emergency tasks.

Benefits of technology

It improves device response speed, stability, and user experience, enabling it to adapt to complex and ever-changing application scenarios and resource requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122227252A_ABST
    Figure CN122227252A_ABST
Patent Text Reader

Abstract

The application discloses a resource allocation method and device of a WiFi module, equipment and a storage medium, and belongs to the technical field of smart homes. Resource state data and a task list of the WiFi module are acquired; resource usage is predicted according to the resource state data and the task list; in the case that the resource usage meets resource early warning conditions, a target function module that needs to be loaded in each function module of the WiFi module and a loading sequence of the target function module are determined; and resources are allocated to the target function module for loading in the loading sequence of the target function module. By collecting the usage of the internal resources of the WiFi module in real time, analyzing the data, predicting resource bottlenecks, and dynamically adjusting the program loading sequence and resource allocation, important tasks can be ensured to be executed in priority, the response speed, stability and user experience of the equipment are improved, and the application scene and resource demand can be adapted to complex and changeable application scenes and resource demands.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart home technology, specifically relating to a resource allocation method for a WiFi module, a resource allocation device for a WiFi module, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the rapid development of the Internet of Things (IoT) and smart home technologies, various smart devices (such as air conditioners, refrigerators, security cameras, and smart speakers) commonly achieve network access and remote control through built-in WiFi modules. The WiFi module typically handles wireless communication protocols, device control logic, and various application tasks. Its operating efficiency and stability directly determine the overall device's response speed, connection reliability, and user experience.

[0003] In existing technologies, the software loading and system resource scheduling of WiFi modules mostly adopt static or simple rule-based strategies. For example, when the device starts up, the module firmware usually loads all functional modules in a predetermined order; during operation, task scheduling often uses fixed time-slice round-robin or static priority allocation mechanisms. Although such methods are simple to implement, they are difficult to adapt to complex and ever-changing application scenarios and resource requirements. Summary of the Invention

[0004] The purpose of this invention is to provide a resource allocation method for a WiFi module, a resource allocation device for a WiFi module, an electronic device, and a corresponding computer-readable storage medium, which can solve the problem that traditional WiFi module program loading and resource scheduling methods mostly use static configuration or fixed rules, making it difficult to adapt to complex and ever-changing application scenarios and resource requirements.

[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows: In a first aspect, embodiments of the present invention provide a resource allocation method for a WiFi module, the method comprising: Obtain resource status data and task list of the WiFi module; Based on the resource status data and task list, predict resource usage; If the resource usage meets the resource warning conditions, determine the target functional modules that need to be loaded in each functional module of the WiFi module and the loading order of the target functional modules; Resources are allocated to the target functional modules for loading according to their loading order.

[0006] Optionally, determining the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules includes: Obtain the priority of each task in the task list; According to the priority order from high to low, the functional modules required by the tasks in the task list are identified as target functional modules, and the loading order of the target functional modules is determined.

[0007] Optionally, determining the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules further includes: Obtain the usage frequency of each functional module of the WiFi module; The target functional modules to be loaded and their loading order are determined according to the order of their usage frequency from high to low.

[0008] Optionally, determining the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules further includes: Obtain user's historical operation data; Based on the user's historical operation data, predict the functional modules that the user will use; The predicted functional modules are identified as target functional modules, and the loading order of the target functional modules is determined.

[0009] Optionally, it also includes: Set up reserved resources; The step of allocating resources to the target functional modules for loading according to their loading order includes: Determine the task type of the task that uses the target functional module; Depending on the task type, resources are allocated to the target functional modules in the reserved resources according to their loading order for loading; or, resources are allocated to the target functional modules in resources other than the reserved resources according to their loading order for loading.

[0010] Optionally, predicting resource usage based on the resource status data and the task list includes: Acquire resource usage prediction models; Based on the resource status data and the task list, the resource usage prediction model is used to predict resource usage.

[0011] Optionally, the resource early warning condition is that the resource utilization rate is greater than a preset threshold.

[0012] Optionally, it also includes: If the resource usage does not meet the resource warning conditions, resources are allocated to all functional modules of the WiFi module for loading.

[0013] Secondly, embodiments of the present invention provide a resource allocation apparatus for a WiFi module, the apparatus comprising: The acquisition module is used to acquire resource status data and task list of the WiFi module; The prediction module is used to predict resource usage based on the resource status data and the task list; The determination module is used to determine the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules when the resource usage meets the resource warning conditions. The allocation module is used to allocate resources to the target functional modules for loading according to the loading order of the target functional modules.

[0014] Optionally, the determining module includes: The priority acquisition submodule is used to acquire the priority of each task in the task list; The first determining submodule is used to determine the functional modules required by the tasks in the task list as target functional modules in descending order of priority, and to determine the loading order of the target functional modules.

[0015] Optionally, the determining module further includes: The frequency acquisition submodule is used to acquire the usage frequency of each functional module of the WiFi module. The second determining submodule is used to determine the target functional modules to be loaded and the loading order of the target functional modules according to the order of their usage frequency from high to low.

[0016] Optionally, the determining module further includes: The operation data acquisition submodule is used to acquire users' historical operation data; The prediction submodule is used to predict the functional modules that the user will use based on the user's historical operation data. The third determining submodule is used to determine the predicted functional modules as target functional modules and to determine the loading order of the target functional modules.

[0017] Optionally, it also includes: The settings module is used to configure reserved resources; The allocation module includes: The task type determination submodule is used to determine the task type of the task that uses the target functional module. The allocation submodule is used to allocate resources for loading the target functional module in the reserved resources according to the loading order of the target functional modules, based on the task type; or, to allocate resources for loading the target functional module in resources other than the reserved resources, according to the loading order of the target functional modules.

[0018] Optionally, the prediction module includes: The prediction model acquisition submodule is used to acquire resource usage prediction models; The prediction submodule is used to predict resource usage based on the resource status data and the task list, using the resource usage prediction model.

[0019] Optionally, the resource early warning condition is that the resource utilization rate is greater than a preset threshold.

[0020] Optionally, it also includes: The second allocation module is used to allocate resources to all functional modules of the WiFi module for loading when the resource usage does not meet the resource warning conditions.

[0021] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0022] Fourthly, embodiments of the present invention provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0023] The embodiments of the present invention have the following advantages: This invention provides a resource allocation method for a WiFi module. The method involves acquiring resource status data and a task list of the WiFi module; predicting resource usage based on the resource status data and task list; determining the target functional modules to be loaded and their loading order when resource usage meets resource warning conditions; and allocating resources to the target functional modules according to their loading order. By collecting and analyzing the resource usage data within the WiFi module in real time, resource bottlenecks are predicted, and the program loading order and resource allocation are dynamically adjusted. This ensures that important tasks are executed first, improving device response speed, stability, and user experience, and can adapt to complex and ever-changing application scenarios and resource requirements. Attached Figure Description

[0024] Figure 1This is a flowchart illustrating the steps of a resource allocation method for a WiFi module provided in an embodiment of the present invention; Figure 2 This is a control flowchart of another WiFi module resource allocation method provided in an embodiment of the present invention; Figure 3 This is a structural block diagram of a resource allocation device for a WiFi module provided in an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0027] The following description, in conjunction with the accompanying drawings, details a resource allocation method for a WiFi module, a resource allocation device for a WiFi module, an electronic device, and a computer-readable storage medium provided by the embodiments of the present invention, through specific examples and application scenarios.

[0028] Reference Figure 1 The diagram illustrates a flowchart of a resource allocation method for a WiFi module according to an embodiment of the present invention. The method may specifically include the following steps: Step 101: Obtain the resource status data and task list of the WiFi module; Resource status data is a quantitative description of the current load on the internal computing, storage, and communication interfaces of the WiFi module. The system collects this data by calling the underlying operating system interface or directly reading hardware performance counters. It mainly includes the following dimensions: computing resource status, memory resource status, I / O (input / output) and communication load, etc. Depending on the specific implementation, power status (such as current voltage and power consumption mode), temperature sensor readings, etc., can also be collected to comprehensively evaluate the operational health of the module. This invention does not impose any limitations on this.

[0029] Specifically, the computing resource status is assessed by collecting data on the current CPU utilization (or idle rate), the load distribution of each core, and the interrupt frequency to determine whether the MCU's processing power is sufficient. The memory resource status is assessed by collecting data on memory occupancy, the current free memory size, and the fragmentation level of the memory allocator to evaluate whether it can meet the needs of loading new tasks or expanding existing tasks. The I / O (input / output) and communication load is assessed by collecting data on the I / O interface load related to the WiFi module, such as the data throughput and busy status of buses like SPI and UART. At the same time, WiFi communication-related performance indicators are collected, such as the signal-to-noise ratio (SNR) of the current wireless connection, data transmission rate, send / receive queue depth, and instantaneous network latency. This part of the data reflects the module's communication pressure and external environmental conditions.

[0030] The task list describes all currently executing, waiting, or planned tasks in the WiFi module, along with their attributes. Each task entry typically includes the following information: a task identifier to uniquely identify a task; a task status, such as running, ready, blocked, or suspended; a static priority, i.e., the preset priority assigned during task initialization; dynamic attributes, such as historical CPU usage time, average memory usage, and historical frequency of user or system calls since task startup or in recent times—these dynamic attributes are crucial for subsequent intelligent prediction and dynamic priority adjustment; and an associated functional module identifier, indicating which upper-layer functional module the task belongs to (e.g., "network configuration service module," "audio / video transmission module," "OTA upgrade module"), thus establishing a mapping relationship from lower-level scheduling to upper-layer business logic.

[0031] In some embodiments provided by this invention, after obtaining the above-mentioned raw data, the system can perform preliminary preprocessing, such as: formatting; converting data from different sources into a unified format (such as JSON or a custom binary structure); filtering and smoothing, performing moving average filtering on certain performance indicators with large fluctuations (such as instantaneous CPU utilization) to eliminate noise and reflect trends more stably; association and encapsulation, associating resource status data and task list data under the same timestamp and encapsulating them into a complete "system status snapshot" for subsequent AI model analysis.

[0032] The data acquisition process can be triggered in the following ways: periodic triggering, which executes automatically at fixed time intervals (e.g., every 100 milliseconds); event-driven triggering, which is triggered immediately when a specific event occurs, such as the creation of a new task, a change in task status, CPU utilization exceeding a threshold, or the receipt of external instructions; or hybrid triggering, which combines the above two methods to ensure that the system baseline status can be monitored periodically, while the instantaneous status when important events occur can be captured in a timely manner.

[0033] Step 102: Based on the resource status data and task list, predict resource usage. This step uses a pre-built or online-learned resource usage prediction model to make a forward-looking judgment on the future resource load of the WiFi module, providing a basis for decision-making in subsequent dynamic scheduling.

[0034] In one embodiment, step 102 may include the following sub-steps: Sub-step S11: Obtain the resource usage prediction model; The resource usage prediction model (hereinafter referred to as the prediction model) can be obtained through one or more of the following methods: Pre-trained model import: During device production or firmware flashing, a lightweight machine learning model trained on a large amount of historical operating data is embedded into the storage space of the WiFi module. This pre-trained model has learned the mapping relationship between resource status data (such as CPU utilization time series, memory usage change rate, I / O wait queue length), task list features (such as task type, quantity, expected resource requirements), and future short-term resource usage (such as CPU peak and memory growth trend in the next N time slices).

[0035] Online Learning and Building: During the initial device startup or initialization phase, a basic scheduling strategy is used to run for a period of time, simultaneously collecting local resource status data, task lists, and corresponding actual resource usage results. Based on this real-time collected data, an online learning algorithm is run on the MCU to gradually build or optimize a predictive model suitable for the specific hardware and usage patterns of this device.

[0036] Cloud-edge collaborative updates: The device has a built-in basic prediction model. During operation, the device can periodically upload local runtime data features to the cloud server. The cloud server uses massive amounts of device data to train and optimize more complex models, and then distributes the optimized model parameters or a lightweight version to the device, enabling dynamic model updates and performance improvements.

[0037] Sub-step S12: Based on the resource status data and the task list, use the resource usage prediction model to predict resource usage.

[0038] After obtaining the prediction model, the system predicts resource usage based on resource status data and a task list through a prediction process that includes feature extraction and input construction, model inference, prediction result output, and prediction triggering and cyclical execution. This allows the system to identify risks and initiate optimized scheduling strategies (such as preloading critical modules and reserving resources) before resource stress actually occurs, thereby smoothing system load and avoiding sudden performance fluctuations.

[0039] Specifically, feature extraction and input construction include: the system acquiring real-time current resource status data (such as current CPU utilization, available memory size, and busy flags for each I / O channel) and a task list (including the ID, type, status, priority, and resource request declaration for each task). This raw data is then converted into the input feature vector required by the prediction model. Feature engineering may include: time-series features, extracting the mean, variance, and trend slope of CPU, memory, and other metrics within a recent time window; task features, counting the number of tasks with different priorities in the task list, calculating the total expected memory requirements of tasks, and identifying the existence of specific task types (such as network-intensive or compute-intensive tasks); and composite features, combining resource status and the task list to calculate metrics such as the ratio of current remaining memory to the total memory requirements of pending tasks.

[0040] Model inference includes: inputting the constructed input feature vector into the prediction model. The model performs forward computation (inference) and outputs predictions of resource usage at one or more future prediction time points.

[0041] Prediction results typically include, but are not limited to: bottleneck prediction, indicating the type of resource most likely to become a system performance bottleneck in a specific future time period (e.g., "CPU will become the main bottleneck in the next 100ms"); quantitative prediction, predicting the possible range of CPU utilization, the growth curve of memory usage, and the expected value of I / O throughput in the future period; and demand conflict warning: predicting which task combinations in the current task list may cause resource demand to exceed the safe threshold when executed simultaneously.

[0042] Prediction triggers and cycles include resource usage predictions which can be triggered by the following events: for example, periodic triggers, where a prediction is executed at fixed intervals (e.g., every 50ms); and event-driven triggers, where a prediction is triggered when the task list changes (e.g., a new task is created or an old task ends), or when the utilization rate of a resource crosses a specific threshold.

[0043] In some embodiments provided by this invention, an online learning mechanism can also be incorporated, enabling the prediction model to continuously adapt to the aging of the device itself, changes in user habits, and new task modes, thus giving the system the ability to optimize over the long term.

[0044] Step 103: If the resource usage meets the resource warning conditions, determine the target functional modules that need to be loaded in each functional module of the WiFi module and the loading order of the target functional modules. In one embodiment, the resource warning condition is that the resource utilization rate is greater than a preset threshold, and step 103 may include the following sub-steps: The resource early warning condition is that when the predicted utilization rate of one or more resources within a specific future time period, as determined by the prediction model, exceeds their respective preset thresholds, intelligent dynamic scheduling is required. By setting clear and quantifiable resource early warning conditions, the system can achieve precise switching based on state awareness. This ensures that the system can intervene in advance before resources actually become a bottleneck, initiating optimization measures such as priority scheduling and selective loading, thereby effectively avoiding performance degradation or task failure and achieving a leap from passive response to proactive prevention.

[0045] Sub-step S21: Obtain the priority of each task in the task list; In some embodiments provided by the present invention, high-priority tasks include at least one of critical tasks, urgent tasks, and emergency tasks; The critical tasks refer to the essential tasks that maintain network connectivity, protocol stack operation, and other basic device functions; the emergency tasks refer to tasks that are triggered by user commands or device events and require a response within a set delay; and the sudden tasks refer to tasks whose resource requirements exceed the system's average load level within a short period of time.

[0046] In this embodiment of the invention, the critical tasks are those necessary to maintain the normal operation of the basic functions of the WiFi module; such as one or more of the following: beacon frame transmission, link keep-alive, association authentication, maintenance of the TCP / IP protocol stack, DHCP lease renewal, and establishment and maintenance of encrypted channels.

[0047] Emergency tasks are those that require the WiFi module to respond and process within a very short time, such as responding to device control commands: like users sending immediate on / off or mode switching commands via an app; reporting security alarms: such as sensors triggering anti-theft or smoke alarms, requiring immediate data packet transmission; and processing high-priority network packets: such as specific QoS-tagged data frames and ACK confirmations.

[0048] Sudden surge tasks are those that arise suddenly within a short period of time, with resource requirements (such as CPU time, memory, and bandwidth) significantly higher than the system's current average or baseline load level. Their "suddenness" is primarily reflected in the instantaneous surge in resource demands. Examples include receiving and verifying firmware over-the-air upgrade data, one-time reporting of device logs or batch data, and large volumes of configuration data or media streams suddenly sent from the network side.

[0049] Sub-step S22: According to the priority from high to low, determine the functional modules required by the tasks in the task list as target functional modules, and determine the loading order of the target functional modules.

[0050] Based on the priorities of the above tasks, the loading order of the target functional modules is initially determined in descending order of priority.

[0051] Specifically, the system generates an initial loading queue, with the highest-priority module at the head of the queue, and so on. For multiple modules with the same priority, secondary sorting rules can be used, such as sorting by module dependencies (loading the underlying basic modules first), historical loading time of the modules (loading modules with shorter expected loading times first to quickly release resources), or module size.

[0052] Furthermore, before actual loading, the system performs conflict checks and dynamic optimizations on the order. For example, if the predictive model indicates that memory resources will be extremely scarce in the near future, the system can dynamically adjust the order, prioritizing the loading of modules with lower memory requirements but higher priority, while loading modules with high priority but large memory requirements later, in order to smooth out peak resource usage.

[0053] In addition, the system can divide the target module list into multiple loading batches based on the current resource status. High-priority modules constitute the first batch and are loaded immediately; medium- and low-priority modules can be included in subsequent batches and loaded when the system is idle or receives a specific trigger signal, thereby achieving gradual resource allocation and rapid system response.

[0054] By prioritizing tasks and using batching, the system can quickly concentrate resources on the most urgent task chains, significantly shortening the end-to-end readiness time of high-priority tasks and improving user experience and system efficiency.

[0055] In one embodiment, step 103 may further include the following sub-steps. Sub-step S31: Obtain the usage frequency of each functional module of the WiFi module; First, each task in the task list is parsed to determine one or more functional modules that the task must depend on or invoke to execute. The priority of each task is inherited by all the functional modules used. If a functional module is depended on by multiple tasks, its inherited priority is the highest among all dependent tasks. Through this mapping and inheritance relationship, the system constructs a set of functional modules to be loaded with priority attributes. In some embodiments provided by this invention, the system obtains the usage frequency of each functional module through continuous monitoring and statistics. This includes statistical dimensions, statistical mechanisms, and dynamic updates.

[0056] Specifically, "usage frequency" typically refers to the number of times a functional module is called or activated within a preset statistical period (such as the last 24 hours, one week, or the entire history since the device's first use). Weighted frequency can also be used, for example, assigning higher weight to recent usage records. A lightweight statistics module is built into the firmware or management program of the WiFi module. Whenever a functional module is successfully loaded and executed (or triggered by user operation or system events), the statistics module updates the count of its corresponding identifier. The statistical results are stored in non-volatile memory in key-value pairs to ensure that data is not lost after a device restart. Usage frequency data is not static but dynamically updated as the device continues to operate. The system can be configured with periodic (e.g., daily) or event-triggered (e.g., when a certain number of calls are accumulated) mechanisms to summarize and normalize frequency statistics to reflect the latest usage habits.

[0057] Sub-step S32: Determine the target functional modules to be loaded and the loading order of the target functional modules according to the order of their usage frequency from high to low.

[0058] When resource optimization scheduling is required (e.g., during system startup or when a resource alert is triggered), the system executes according to the logic of reading and sorting, determining the target module, and determining the loading order.

[0059] Specifically, the system reads the latest usage frequency data of all functional modules from memory, then sorts them according to frequency values ​​from high to low, generating a "frequency priority list." It doesn't always load all modules; based on the current resource alert level or preset strategies, it selects a subset of modules from the sorted list as the target functional modules to be loaded. For example, when resources are severely strained, only the top 3 most frequently used modules might be loaded; when resources are only slightly strained, the top 50% of modules might be loaded. The system can set a frequency threshold, loading only modules whose frequency exceeds that threshold. The loading order of the target functional modules is directly based on their order in the "frequency priority list," meaning the most frequently used module is loaded first, followed by the next most frequently used, and so on. This order ensures that, under limited resource conditions, the functions most likely to be used by the user are ready as quickly as possible.

[0060] Implementing this step significantly improves the system's responsiveness and user-perceived performance. By prioritizing limited resources for the most frequently used functions, most modules required for daily operations are quickly ready, reducing user wait time. It also adapts to different usage patterns of different users or in different scenarios, making the device increasingly user-friendly over time.

[0061] In one embodiment, step 103 may include the following sub-steps: Sub-step S41: Obtain user's historical operation data; During device operation, the system continuously and securely collects historical user operation data. This data typically includes, but is not limited to, operation sequences, usage frequency, time patterns, and scene associations.

[0062] Specifically, this can include: historical records of user-triggered functional modules at different times and in different scenarios; statistics on the number of times each functional module is called; usage patterns of specific functional modules at different times of the day or on different dates of the week; and records of specific functional modules' interaction with device status (such as home / away mode), network environment, or other devices. Data collection follows privacy protection principles and can be anonymized and aggregated on the device side, extracting only behavioral pattern features.

[0063] Sub-step S42: Based on the user's historical operation data, predict the functional modules that the user will use; Based on the processed historical operation data, the system builds or invokes a user behavior prediction model. This model can be implemented using one or more of the following techniques: sequence prediction model, classification or clustering model, lightweight rule engine, etc.

[0064] Specifically, based on Markov chains or recurrent neural networks (RNNs), predict the next function that may be triggered based on the recent operation sequence; or classify the user's current state into a certain typical usage pattern based on features such as time and context, and load the commonly used functional modules in that pattern; or set prediction rules based on explicit usage patterns (such as "audio-visual modules are commonly used after 8 pm on weekdays").

[0065] Sub-step S43: Determine the predicted functional modules as target functional modules and determine the loading order of the target functional modules.

[0066] When it is necessary to determine the target functional modules and their loading order, the system inputs the current context information (such as the current time and device status) into the prediction model. The model outputs the prediction results of the functional modules that the user will use, and the system determines the functional modules with high prediction scores (i.e., high probability of use) as target functional modules; or, by combining factors such as prediction confidence, module size, and resource requirements, the system determines the loading order of these target functional modules, prioritizing the loading of modules that are most likely to be used immediately and whose resources are ready.

[0067] This step ensures that frequently needed functional modules are partially or fully loaded before they are officially called, significantly reducing the waiting time for function startup; it also makes resource allocation more aligned with real and personalized usage needs, avoiding resource waste on low-frequency functions; and it enables the device to exhibit intelligent perception, improving user experience satisfaction.

[0068] In one embodiment, the method may further include: if the resource usage does not meet the resource warning conditions, then allocating resources to all functional modules of the WiFi module for loading.

[0069] When the resource usage output of the predictive model indicates that the expected demand for all critical resources (such as CPU, memory, and I / O bandwidth) will not reach or exceed preset thresholds (i.e., resource warning conditions are not met) within the foreseeable future, the system determines that it is currently in a resource-sufficient state. In this state, the system will execute a standard, efficient global loading strategy to ensure that all functional modules can be quickly ready, maximizing the system's functional completeness.

[0070] Specifically, resource warning conditions are typically a set of preset threshold combinations (e.g., predicted peak CPU utilization ≤ 70% and predicted memory usage ≤ 60% of total capacity within the next 200ms). When all predicted indicators are better than (or lower than) these thresholds, it is determined that "resource warning conditions are not met." At this time, a preset, optimal standard loading sequence will be used to allocate the necessary resources to all functional modules of the WiFi module and start loading. This standard sequence may be optimized based on factors such as inter-module dependencies and initialization time, aiming to shorten the overall startup time. In cases of extremely abundant resources, some independent modules can even be loaded in parallel to further improve initialization efficiency. During this process, the resource allocation strategy does not require complex priority queuing or dynamic reservation. The system adopts a relatively balanced allocation method, providing each functional module with the initial resources it claims to need, ensuring that all modules can complete initialization and startup smoothly and quickly.

[0071] In addition, once all functional modules are loaded, the system enters a fully functional ready state. Meanwhile, the background monitoring and prediction processes continue to run. If subsequent real-time monitoring data or predictive model outputs indicate that future resource usage may trigger warning conditions, the system will seamlessly switch to the dynamic scheduling and intelligent loading mode described in the previous steps to cope with impending resource constraints.

[0072] Step 104: Allocate resources to the target functional modules for loading according to the loading order of the target functional modules.

[0073] Once the dynamic scheduling strategy is formulated, the resource allocation execution phase begins. Based on the determined target functional modules and their loading order, orderly resource allocation and loading activation are carried out.

[0074] In some embodiments provided by this invention, specific implementation methods may include: the system sequentially allocates the resources necessary for the initialization and operation of each target functional module according to a predetermined loading order. The allocation process specifically includes CPU time slice allocation, memory space allocation, and I / O and peripheral resource reservation. If necessary, specific communication interfaces, timers, or hardware accelerator resources are configured or reserved for the module. Once resource allocation is complete, the system immediately triggers the loader of the corresponding functional module, reads the module code and data from the storage medium (such as Flash) into the allocated memory space, and executes its initialization function. During the actual allocation process, the system can fine-tune based on the current real-time (unpredictable) resource status. After each module is loaded, the system records its actual resource consumption and loading time, and inputs this data as feedback information into the resource monitoring and prediction loop to optimize subsequent prediction accuracy and scheduling decisions.

[0075] In one embodiment, the method further includes: Set up reserved resources; To address urgent, sudden, or high-priority tasks that may occur during system operation, this method introduces a hierarchical resource allocation strategy. This strategy, through a pre-set reserved resource pool and precise identification of task types, achieves differentiated resource guarantees for tasks of different natures, thereby maintaining system responsiveness and stability under complex loads.

[0076] In some embodiments provided by this invention, during the initialization phase or operation, the system allocates a portion of its total available resources (such as CPU time slices, memory blocks, and I / O bandwidth) for reservation. These resources are managed separately and are typically not used for loading and executing routine tasks; they are specifically designed to handle unplanned high-priority demands. The size of the reserved resources is not fixed; the system can dynamically adjust the size of the reserved pool based on resource usage trends output by the predictive model and historical load statistics. For example, when a high-load period is predicted, the proportion of reserved resources can be appropriately increased; when the system load is light, it can be reduced accordingly to improve overall resource utilization.

[0077] Step 104 further includes: Determine the task type of the task that uses the target functional module; based on the task type, allocate resources to the target functional module in the reserved resources according to the loading order of the target functional modules for loading; or, allocate resources to the target functional module in resources other than the reserved resources according to the loading order of the target functional modules for loading.

[0078] In some embodiments provided by the present invention, when resources need to be allocated to a target functional module, the system first determines the task type of the task that initiates the loading request. Based on the determined task type, the system executes differentiated resource allocation paths. Path one is to use reserved resource allocation, which is mainly applicable to urgent tasks and some critical or sudden tasks that are determined to be essential. Path two is to use regular resource allocation, which is applicable to regular tasks and some critical / sudden tasks whose resource requirements can be delayed or whose resources are predicted to be sufficient.

[0079] Furthermore, task types can be marked or determined in real time based on preset strategies, and mainly include, but are not limited to: tasks that are extremely sensitive to latency and require immediate response (such as user control commands and alarm reporting); tasks necessary to maintain basic system functions (such as connection keep-alive and core protocol processing); bursty tasks: tasks with a surge in resource demand in a short period of time (such as firmware upgrade package reception); and routine tasks: ordinary application functions or background service tasks.

[0080] When using reserved resource allocation, the system directly allocates the required resources to each module from the reserved resource pool according to the predetermined loading order of the target functional modules. This path ensures that high-priority tasks can bypass the contention of the regular resource queue and obtain the resources required for execution with almost no delay, thereby meeting strict real-time requirements.

[0081] When using conventional resource allocation, the system allocates resources from the conventional resource pool, in addition to the reserved resources, according to the loading order of the target functional modules. These tasks follow ordinary resource scheduling and queuing mechanisms. The system can flexibly decide which path a task should take based on real-time resource usage predictions.

[0082] This invention provides a resource allocation method for a WiFi module. The method involves acquiring resource status data and a task list of the WiFi module; predicting resource usage based on the resource status data and task list; determining the target functional modules to be loaded and their loading order when resource usage meets resource warning conditions; and allocating resources to the target functional modules according to their loading order. By collecting and analyzing the resource usage data within the WiFi module in real time, resource bottlenecks are predicted, and the program loading order and resource allocation are dynamically adjusted. This ensures that important tasks are executed first, improving device response speed, stability, and user experience, and can adapt to complex and changing application scenarios and resource requirements.

[0083] Reference Figure 2 This diagram illustrates a control flowchart of another resource allocation method for a WiFi module provided in an embodiment of the present invention, which may specifically include: When the device starts up, the WiFi module's MCU initializes, collecting the current MCU resource status (including CPU utilization, memory usage, I / O load, etc.) and the current running task list to build an AI model of the running status. The AI ​​model analyzes the collected running status data to predict the availability of current MCU resources and potential bottlenecks. Based on the analysis results, a resource priority queue dynamic allocation mechanism is adopted to dynamically adjust the priority of MCU resources according to real-time demand. Simultaneously, the running status and performance indicators of the WiFi module (such as connection speed, data throughput, latency, etc.) are continuously monitored, and the data is fed back to the AI ​​model for subsequent scheduling strategy optimization. The specific steps are as follows: When the device starts up, the WiFi module MCU (hereinafter referred to as MCU) first loads the basic kernel, and then enters the scheduling initialization phase. This phase builds an AI model of the running status by collecting the current MCU resource status (including CPU utilization, memory usage, I / O load, etc.) and the list of currently running tasks.

[0084] A pre-trained AI model is used to analyze the collected operating status data to predict the availability of current MCU resources and potential bottlenecks.

[0085] Based on the analysis results of the AI ​​model, the MCU dynamically determines the loading order of relevant programs. For example, when CPU resources are sufficient, all functional modules are loaded first; when resources are scarce, frequently used functional modules are loaded first, and the loading of other modules is delayed.

[0086] Furthermore, a resource priority queue mechanism is adopted. During the program loading process, the MCU dynamically allocates resources such as CPU and memory according to task priority and resource requirements to ensure that critical tasks (such as connection establishment and data transmission) receive priority resource guarantees.

[0087] Furthermore, a dynamic allocation mechanism is introduced during the resource allocation phase, dynamically adjusting priorities based on real-time program requirements. For example, when a sudden task arrives, the MCU can temporarily increase its priority to ensure it receives sufficient resources for execution, avoiding performance degradation caused by resource contention and enhancing the MCU's adaptability in complex task environments.

[0088] Meanwhile, a user behavior prediction model is introduced. By analyzing users' historical operation behavior (such as frequently used functional modules, usage time periods, etc.), the model predicts the functional modules that the current user may use and prioritizes loading these modules. This enhances the MCU's ability to perceive user behavior, making the program run more in line with the user's actual needs and significantly improving the user experience.

[0089] When allocating resources, the MCU reserves some resources (such as CPU cycles and memory space) to cope with the rapid execution needs of sudden tasks. When a sudden task arrives, the MCU can immediately call upon the reserved resources to process it, avoiding task delays or failures due to insufficient resources, thus enhancing the stability and responsiveness of the MCU.

[0090] During MCU operation, the operating status and performance indicators of the WiFi module (such as connection speed, data throughput, latency, etc.) are continuously monitored, and the data is fed back to the AI ​​model for subsequent scheduling strategy optimization.

[0091] To support multi-platform deployment, the AI ​​model shields the underlying operational logic and hardware differences, enabling unified interface calls and resource scheduling strategies to ensure consistent operating logic and performance across different platforms.

[0092] By dynamically analyzing the operating status of WiFi module MCU resources and load through AI algorithms, the MCU can perceive its current operating status in real time and make intelligent scheduling decisions. This effectively improves resource utilization and MCU response efficiency, achieving the technical effects of reducing loading latency and increasing concurrent processing capabilities. Dynamically adjusting resource allocation strategies can avoid performance bottlenecks caused by resource contention, improving MCU performance and enhancing user-perceived startup speed and operational smoothness, thus improving the user experience.

[0093] It should be noted that the resource allocation method for a WiFi module provided in this embodiment of the invention can be executed by a resource allocation device for the WiFi module, or a control module within the resource allocation device for executing the method of loading resource allocation for the WiFi module. This embodiment of the invention uses the execution of the method of loading resource allocation for the WiFi module by a resource allocation device for the WiFi module as an example to illustrate the resource allocation method for the WiFi module provided in this embodiment of the invention.

[0094] Reference Figure 3 The diagram illustrates a structural block diagram of a resource allocation device for a WiFi module according to an embodiment of the present invention, which may specifically include the following modules: The acquisition module 301 is used to acquire the resource status data and task list of the WiFi module; Prediction module 302 is used to predict resource usage based on the resource status data and task list; The determining module 303 is used to determine the target functional modules that need to be loaded in each functional module of the WiFi module and the loading order of the target functional modules when the resource usage meets the resource warning conditions. The allocation module 304 is used to allocate resources to the target functional modules for loading according to the loading order of the target functional modules.

[0095] In one embodiment, the determining module includes: The priority acquisition submodule is used to acquire the priority of each task in the task list; The first determining submodule is used to determine the functional modules required by the tasks in the task list as target functional modules in descending order of priority, and to determine the loading order of the target functional modules.

[0096] In one embodiment, the determining module further includes: The frequency acquisition submodule is used to acquire the usage frequency of each functional module of the WiFi module. The second determining submodule is used to determine the target functional modules to be loaded and the loading order of the target functional modules according to the order of their usage frequency from high to low.

[0097] In one embodiment, the determining module further includes: The operation data acquisition submodule is used to acquire users' historical operation data; The prediction submodule is used to predict the functional modules that the user will use based on the user's historical operation data. The third determining submodule is used to determine the predicted functional modules as target functional modules and to determine the loading order of the target functional modules.

[0098] In one embodiment, the device further includes: The settings module is used to configure reserved resources; The allocation module includes: The task type determination submodule is used to determine the task type of the task that uses the target functional module. The allocation submodule is used to allocate resources for loading the target functional module in the reserved resources according to the loading order of the target functional modules, based on the task type; or, to allocate resources for loading the target functional module in resources other than the reserved resources, according to the loading order of the target functional modules.

[0099] In one embodiment, the prediction module includes: The prediction model acquisition submodule is used to acquire resource usage prediction models; The prediction submodule is used to predict resource usage based on the resource status data and the task list, using the resource usage prediction model.

[0100] In one embodiment, the resource warning condition is that the resource utilization rate is greater than a preset threshold.

[0101] In one embodiment, the device further includes: The second allocation module is used to allocate resources to all functional modules of the WiFi module for loading when the resource usage does not meet the resource warning conditions.

[0102] The resource allocation device of the WiFi module in this embodiment of the invention can be a device, or a component, integrated circuit, or chip in a terminal. This device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This embodiment of the invention does not impose specific limitations.

[0103] The resource allocation device of the WiFi module in this embodiment of the invention can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment of the invention does not impose specific limitations.

[0104] The resource allocation device for the WiFi module provided in this embodiment of the invention can achieve Figure 1 The various processes implemented by the resource allocation device of the WiFi module in the method embodiment shown in Figure N will not be described again here to avoid repetition.

[0105] This invention provides a resource allocation device for a WiFi module. An acquisition module acquires resource status data and a task list of the WiFi module; a prediction module predicts resource usage based on the resource status data and task list; a determination module determines the target functional modules to be loaded and their loading order among the various functional modules of the WiFi module, provided that resource usage meets resource warning conditions; and an allocation module allocates resources to the target functional modules according to their loading order. By collecting and analyzing the resource usage within the WiFi module in real time, resource bottlenecks are predicted, and the program loading order and resource allocation are dynamically adjusted. This ensures that important tasks are executed first, improving device response speed, stability, and user experience, and can adapt to complex and ever-changing application scenarios and resource requirements.

[0106] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the resource allocation method embodiment of the WiFi module described above and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0107] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0108] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0110] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.

Claims

1. A resource allocation method for a WiFi module, characterized in that, include: Obtain resource status data and task list of the WiFi module; Based on the resource status data and task list, predict resource usage; If the resource usage meets the resource warning conditions, determine the target functional modules that need to be loaded in each functional module of the WiFi module and the loading order of the target functional modules; Resources are allocated to the target functional modules for loading according to their loading order.

2. The resource allocation method for a WiFi module according to claim 1, characterized in that, The step of determining the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules includes: Obtain the priority of each task in the task list; According to the priority order from high to low, the functional modules required by the tasks in the task list are identified as target functional modules, and the loading order of the target functional modules is determined.

3. The resource allocation method for a WiFi module according to claim 1, characterized in that, The step of determining the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules further includes: Obtain the usage frequency of each functional module of the WiFi module; The target functional modules to be loaded and their loading order are determined according to the order of their usage frequency from high to low.

4. The resource allocation method for a WiFi module according to claim 1, characterized in that, The step of determining the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules further includes: Obtain user's historical operation data; Based on the user's historical operation data, predict the functional modules that the user will use; The predicted functional modules are identified as target functional modules, and the loading order of the target functional modules is determined.

5. The resource allocation method for a WiFi module according to claim 1, characterized in that, Also includes: Set up reserved resources; The step of allocating resources to the target functional modules for loading according to their loading order includes: Determine the task type of the task that uses the target functional module; Depending on the task type, resources are allocated to the target functional modules in the reserved resources according to their loading order for loading; or, resources are allocated to the target functional modules in resources other than the reserved resources according to their loading order for loading.

6. The resource allocation method for a WiFi module according to claim 1, characterized in that, The step of predicting resource usage based on the resource status data and the task list includes: Acquire resource usage prediction models; Based on the resource status data and the task list, the resource usage prediction model is used to predict resource usage.

7. The resource allocation method for a WiFi module according to claim 1, characterized in that, The resource early warning condition is that the resource utilization rate is greater than a preset threshold.

8. The resource allocation method for a WiFi module according to claim 1, characterized in that, Also includes: If the resource usage does not meet the resource warning conditions, resources are allocated to all functional modules of the WiFi module for loading.

9. A device for resource allocation of a WiFi module, characterized in that, include: The acquisition module is used to acquire resource status data and task list of the WiFi module; The prediction module is used to predict resource usage based on the resource status data and the task list; The determination module is used to determine the target functional modules to be loaded in each functional module of the WiFi module and the loading order of the target functional modules when the resource usage meets the resource warning conditions. The allocation module is used to allocate resources to the target functional modules for loading according to the loading order of the target functional modules.

10. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the resource allocation method for the WiFi module as described in claims 1-8.

11. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the resource allocation method for the WiFi module as described in claims 1-8.