Acquisition gateway-oriented function module dynamic configuration method and system
By constructing a module resource demand profile and a device resource supply view in the data acquisition gateway, and combining them with a resource contention prediction model, hierarchical loading and resource reservation pool management are implemented to solve the resource conflict problem in the dynamic loading of functional modules of the data acquisition gateway, thereby improving the robustness and resource utilization of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHUOZHEN SIZHONG (GUANGZHOU) TECH CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies fail to accurately model resource requirements when dynamically loading functional modules in the data acquisition gateway, leading to temporary resource shortages, loading failures, system response delays, or functional abnormalities. Furthermore, traditional methods have low resource utilization in high-frequency dynamic task switching scenarios.
By performing static analysis on the functional modules in the acquisition gateway, a resource demand profile of the modules is generated. Combined with real-time device status data, a resource supply capacity view is constructed. A resource competition prediction model is built using a logistic regression and gradient boosting tree ensemble algorithm. Resource conflict early warning signals are generated, and hierarchical loading and resource reservation pool management are implemented to ensure that high-priority modules are loaded under resource protection.
It significantly improves the accuracy of resource adaptation and system stability during the loading process of functional modules, reduces loading latency and failure rate, and improves resource utilization and system response sensitivity. It is suitable for industrial IoT environments with limited resources and drastic load fluctuations.
Smart Images

Figure CN121967197A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource scheduling technology for dynamic loading of functional modules of data acquisition gateways and device status awareness, and particularly to a method and system for dynamic configuration of functional modules of data acquisition gateways. Background Technology
[0002] Currently, with the rapid development of the Industrial Internet of Things (IIoT) and edge computing, data acquisition gateways are widely used in smart manufacturing, remote equipment operation and maintenance, industrial control, and energy consumption monitoring. As the core hub connecting field devices and upper-level platforms, the dynamic configuration and flexible loading of the internal functional modules of the data acquisition gateway have become a key technological direction for improving system adaptability and scalability.
[0003] In practical engineering applications, typical dynamic module loading implementations are mostly based on operating system-level thread / process isolation and synchronization mechanisms, using methods such as queuing, polling, and load balancing to coarsely schedule resources. However, these solutions often fail to finely model the resource requirements of each module or fully integrate the current actual operating state of the device. Therefore, when multiple functional modules are loaded concurrently, they are prone to temporary shortages of critical resources such as memory, CPU time slices, and I / O channels, leading to loading failures, system response delays, or functional abnormalities. Meanwhile, some existing technologies attempt to reduce the probability of conflicts by adding external buffer resources or forcibly serializing the loading process. While this improves stability, it significantly sacrifices concurrency efficiency and resource utilization, making it unsuitable for industrial IoT scenarios with high-frequency dynamic task switching. Summary of the Invention
[0004] This application provides a method and system for dynamic configuration of functional modules for a data acquisition gateway, aiming to solve one of the problems or issues of the prior art mentioned in the background.
[0005] This application provides a method for dynamically configuring functional modules of a data acquisition gateway, specifically including: S1: Perform static analysis on all loadable functional modules in the data acquisition gateway, extract the resource types and peak usage required by each module during the loading process, and generate a module resource requirement profile.
[0006] S2: Based on real-time device operating status data, including available memory capacity, CPU load rate, network bandwidth utilization, and task queue length, construct a view of device resource supply capacity.
[0007] S3: A resource contention prediction model is jointly constructed by combining logistic regression and gradient boosting tree ensemble algorithms and trained and converged based on historical loading logs. The resource demand profile of the modules and the resource supply capacity view of the equipment are input into the resource contention prediction model to determine whether there is a risk of specific resource overload when multiple modules are loaded concurrently, and a resource conflict early warning signal is generated.
[0008] S4: Based on the resource conflict warning signal, a resource scheduling strategy is initiated, in which high-priority business modules are given priority in resource allocation, and the loading operations of low-priority modules are marked as delayed execution or phased injection, forming a hierarchical loading instruction sequence.
[0009] S5: Based on the hierarchical loading instruction sequence, a resource reservation pool is dynamically created before the module is loaded, temporarily locking the memory space, CPU time slice and I / O channel required by the module to be loaded, and generating a resource reservation status record.
[0010] S6: Based on the resource pre-occupancy status record, trigger the dynamic loading process of functional modules in priority order to ensure that high-priority modules complete loading under resource guarantee conditions and generate a module loading completion confirmation signal.
[0011] S7: After loading is complete, automatically release the locked resources in the resource reservation pool and update the device resource supply capacity view to form the latest resource status snapshot.
[0012] S8: It asynchronously processes subsequent loading requests through an event-driven architecture, and uses the updated resource state snapshot as the input condition for the next round of resource coordination to achieve closed-loop resource management in the module loading process.
[0013] This application also provides a dynamic configuration system for functional modules of a data acquisition gateway, which uses the above-described dynamic configuration method for functional modules of a data acquisition gateway to dynamically configure the loading of functional modules of the data acquisition gateway.
[0014] This application provides a method and system for dynamically configuring functional modules of a data acquisition gateway, which has the following advantages: (1) By constructing a two-way matching mechanism between module resource demand profiles and equipment resource supply capacity views, this solution significantly improves the accuracy of resource adaptation and system stability during the functional module loading process. Traditional dynamic loading methods usually adopt sequential execution or simple queuing strategies, which are difficult to predict resource conflicts when facing concurrent requests from multiple modules, and are prone to loading failure or system jitter due to memory overflow, CPU overload, and other problems. This invention introduces a technical means that combines static resource analysis and real-time status perception before loading, so as to fully grasp the peak resource occupancy characteristics of each module and the actual carrying capacity of the current equipment, and conduct a loading feasibility assessment based on this. Furthermore, combined with the rule-based resource competition prediction model generated by training from historical logs, the system can accurately identify potential resource over-limit risks before scheduling, make intervention decisions in advance, and avoid the passive processing mode of "loading first and then crashing". This mechanism effectively ensures the reliable loading capability of high-priority business modules under complex working conditions, and is especially suitable for application scenarios with limited resources and drastic load fluctuations in the industrial Internet of Things environment, which significantly enhances the robustness and availability of the system.
[0015] (2) By introducing a dynamic resource reservation pool and an event-driven asynchronous scheduling architecture, this solution achieves determinism and timing controllability of resource allocation during module loading, significantly reducing loading latency and failure rate. Unlike traditional approaches that rely on external caching or runtime retries, this invention pre-locks the key resources (such as memory segments, I / O channels, etc.) required by the target module after confirming the loading instruction and before actually injecting the module, forming a temporary resource isolation zone to prevent other tasks or processes from preempting key resources during the loading window, thereby ensuring the continuity and integrity of the loading process. At the same time, the resource scheduling strategy supports delayed loading or phased resource injection for low-priority modules according to business priority, which avoids system oscillations caused by a surge in instantaneous resource demand and improves the overall resource utilization. The entire coordination process is based on an event-driven framework to achieve non-blocking processing, without affecting the normal flow of the main control logic, and improving the system's response sensitivity and concurrent processing capabilities. In addition, this design does not require additional deployment of dedicated caching middleware or complex virtualization layers, has good lightweight characteristics and engineering deployability, and is suitable for large-scale applications of resource-sensitive edge devices.
[0016] The aforementioned technologies work synergistically to construct a closed-loop modular loading management system integrating resource awareness, competition prediction, intelligent scheduling, and dynamic safeguards. This system not only overcomes the shortcomings of traditional methods, such as blind resource scheduling and high failure recovery costs, but also achieves a technological leap from "passive fault tolerance" to "proactive risk avoidance." While ensuring rapid deployment of critical functions, the system also considers resource utilization efficiency and multi-task collaboration stability, possessing strong adaptability and scalability, providing solid support for the modular evolution of industrial gateways in dynamic environments. Attached Figure Description
[0017] Figure 1 This is the main flowchart of a method for dynamically configuring functional modules of a data acquisition gateway.
[0018] Figure 2 This is a sub-flowchart of a method for dynamically configuring functional modules of a data acquisition gateway.
[0019] Figure 3 This is another sub-flowchart of a method for dynamically configuring functional modules of a data acquisition gateway. Detailed Implementation
[0020] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0021] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0022] like Figure 1 As shown, this application provides a method for dynamically configuring functional modules of a data acquisition gateway, specifically including: S1: Perform static analysis on all loadable functional modules in the data acquisition gateway, extract the resource types and peak usage required by each module during the loading process, and generate a module resource requirement profile.
[0023] S2: Based on real-time device operating status data, including available memory capacity, CPU load rate, network bandwidth utilization, and task queue length, construct a view of device resource supply capacity.
[0024] S3: A resource contention prediction model is jointly constructed by combining logistic regression and gradient boosting tree ensemble algorithms and trained and converged based on historical loading logs. The resource demand profile of the modules and the resource supply capacity view of the equipment are input into the resource contention prediction model to determine whether there is a risk of specific resource overload when multiple modules are loaded concurrently, and a resource conflict early warning signal is generated.
[0025] S4: Based on the resource conflict warning signal, a resource scheduling strategy is initiated, in which high-priority business modules are given priority in resource allocation, and the loading operations of low-priority modules are marked as delayed execution or phased injection, forming a hierarchical loading instruction sequence.
[0026] S5: Based on the hierarchical loading instruction sequence, a resource reservation pool is dynamically created before the module is loaded, temporarily locking the memory space, CPU time slice and I / O channel required by the module to be loaded, and generating a resource reservation status record.
[0027] S6: Based on the resource pre-occupancy status record, trigger the dynamic loading process of functional modules in priority order to ensure that high-priority modules complete loading under resource guarantee conditions and generate a module loading completion confirmation signal.
[0028] S7: After loading is complete, automatically release the locked resources in the resource reservation pool and update the device resource supply capacity view to form the latest resource status snapshot.
[0029] S8: It asynchronously processes subsequent loading requests through an event-driven architecture, and uses the updated resource state snapshot as the input condition for the next round of resource coordination to achieve closed-loop resource management in the module loading process.
[0030] Step S1: Perform static analysis on all loadable functional modules in the data acquisition gateway, extract the resource types and peak resource usage required by each module during loading, and generate a module resource requirement profile. Specifically, this includes: S1.1: Obtain the binary executable files or bytecode packages of all dynamically loadable functional modules in the acquisition gateway system, and perform static reverse analysis on the executable files based on decompilation and symbol resolution technology to identify the system interface types and resource request functions called during the initialization phase, and generate the original system call trajectory sequence.
[0031] The input conditions are the binary executable files or bytecode packages of all dynamically loadable functional modules in the data acquisition gateway system. The file formats cover ELF, PE and custom image formats of specific embedded platforms. Corresponding parsers need to be adapted for different formats to ensure the consistency of input for static analysis.
[0032] A decompilation method (parameters: target platform instruction set type, decompilation depth threshold) is used to convert binary executable files into intermediate representation code, thereby eliminating the interference of instruction reordering and function inlining introduced by compilation optimization on interface recognition.
[0033] Furthermore, through a symbol resolution algorithm (parameters: symbol table path, address space mapping rules), the precise location of function symbols, global variable symbols, and system call entry points in the intermediate representation code is achieved, and a resolution result dataset containing call addresses and symbol names is obtained.
[0034] Furthermore, by using the interface classification mapping method (parameters: system kernel API classification table, resource request function keyword list), the symbols in the parsed result dataset are labeled with categories, functions that meet the resource request characteristics are included in the resource call candidate set, and a candidate call symbol sequence is generated.
[0035] Furthermore, a call chain backtracking algorithm (parameters: control flow graph generation strategy, call depth limit) is adopted to trace the function call relationship in the initialization phase starting from the module entry point, extract the execution order and call frequency of the resource call candidate set in this phase, and generate the call path set in the initialization phase.
[0036] The system call trajectory builder (parameters: path set, time series reconstruction rules) transforms the initialization phase call path set into a raw system call trajectory sequence arranged in the call order, thereby achieving structured output of call data in the static analysis phase.
[0037] For example, in a Linux embedded environment of a certain type of data acquisition gateway, three dynamically loadable functional modules were selected. Their ELF format binary files totaled 48MB in size, and the instruction set architecture was ARM Cortex-A53. The decompilation method set a decompilation depth threshold of 5 levels, resulting in intermediate representation code lines of 12000, 9500, and 10200 respectively. A symbol resolution algorithm read the DWARF debug symbol table corresponding to the .bin file, identifying 15 memory allocation interfaces (malloc, mmap), 9 thread creation interfaces, 6 network interface (socket), and 5 I / O channel opening interfaces (open). An interface classification mapping method, based on a list of resource allocation function keywords, labeled the above call points as resource allocation categories and removed irrelevant log printing interfaces. A call chain backtracking algorithm, under the condition that the control flow graph recursion depth is limited to 4, traced the complete call relationship of the resource allocation functions in the initialization phase, obtaining a total of 30 nodes in the call path set. The system call trajectory builder transforms the path set into a trajectory sequence according to the time series reconstruction rules. Each trajectory contains fields such as call timestamp, call symbol name, parameter pointer, and return code, forming the original system call trajectory sequence output. This sequence is directly called in the subsequent S1.2 pattern matching stage to realize the rapid extraction of resource request parameters and the calculation of the maximum potential resource demand, which significantly improves the data integrity and processing efficiency in the static analysis stage.
[0038] S1.2: Based on the original system call trajectory sequence, use a pattern matching algorithm to identify the call patterns related to resource allocation, including memory allocation functions malloc and mmap, thread creation functions, network sockets and I / O channels open, etc., extract the corresponding resource request parameters, calculate the maximum potential resource demand of each module during the loading phase, and generate a module-level resource request feature vector.
[0039] Based on the original system call trajectory sequence, a pattern matching algorithm (parameters: call pattern template library, matching threshold λ) is used to identify the type of resource request functions triggered during the initialization phase, and the matching results are labeled as the corresponding resource category tag set.
[0040] Furthermore, by using a regularization parsing method (parameters: function call syntax rule set, key parameter position index), the call parameters of the memory allocation functions malloc and mmap are extracted, and the initial value data set M of memory requirement is obtained. set .
[0041] S1.3: Input the module-level resource request feature vector into the resource classification mapper. The mapper performs standardization and normalization processing based on the predefined resource type ontology (including memory capacity unit MB, CPU time slice unit ms, number of I / O channels, and network bandwidth unit Kbps) to convert it into a structured resource description tuple of a unified dimension, forming a preliminary snapshot of module resource requirements.
[0042] The input condition is the module-level resource request feature vector output by the preceding sub-step S1.2, which contains peak demand parameters related to memory, CPU time slice, I / O channels and network bandwidth during the loading phase.
[0043] A resource classification mapper is used to call a predefined resource type ontology (parameters in MB, ms, I / O channel count, and Kbps network bandwidth) to achieve type matching and semantic mapping of feature vectors. Furthermore, a standardization method (parameters: maximum and minimum values for each resource type are taken from the ontology definition range) is employed to unify the dimensions of resource demand data with different scales, resulting in a normalized set of multidimensional resource indicators. Further, the normalization formula is used:
[0044] in This represents the original peak demand for a certain resource in the current module. This is the minimum value for this resource type. For the maximum value of this resource type, a standardized resource vector component in the interval [0,1] is generated. Further, the normalized components are sequentially filled into structured tuple fields using a resource type mapping table, forming a unified-dimensional resource description tuple data structure. Through resource mapping processing, the feature vector results from the previous step are transformed into a preliminary snapshot of module resource requirements, enabling standardized semantic resource metrics that can be directly invoked in subsequent context fusion steps.
[0045] S1.4: Combine the module deployment configuration metadata, including module function categories, business priority tags, and typical operating scenario constraints, to perform context enhancement processing on the module resource requirement snapshot, and generate an extended resource feature matrix containing functional semantic information through a weighted fusion mechanism, which serves as the core data structure for the module resource requirement profile.
[0046] S1.5: Persistently store the extended resource feature matrix in a local lightweight database and establish a unique index identifier for it. This identifier is bound to the module name, version number and hash value to generate a queryable and updatable module resource demand profile library for subsequent resource competition prediction models to call in real time.
[0047] The input condition is the extended resource feature matrix generated in step S1.4. This matrix already contains structured resource description fields that have undergone functional semantic enhancement processing, including multi-dimensional attributes such as memory capacity, CPU time slice, number of I / O channels and network bandwidth, as well as tag information such as module function category, business priority and running scenario constraints.
[0048] A lightweight embedded database write interface (parameters: SQLite engine version 3.36, cache page size 4KB) is used to implement local persistent storage of extended resource feature matrices, and a fixed field mapping structure is assigned to each matrix record to support efficient retrieval by structured query language.
[0049] Furthermore, a unique identifier for each resource requirement profile record is calculated using a unique index generation algorithm (parameters: SHA-256 hash function, index fields are combined as module name + version number + matrix digest), and an index mapping table is generated for subsequent rapid data location and conflict detection.
[0050] Furthermore, through the index binding mechanism (parameters: metadata field binding rules, binding scope includes module name, version number, hash value), the index identifier and the core fields of the resource requirement profile are consistently bound, ensuring that the uniqueness constraint continues after version iteration or module recompilation.
[0051] Furthermore, a database transaction control mechanism (parameter: ACID isolation level is Serializable) is adopted to realize the queryable and updatable characteristics of the resource requirement profile library, and historical versions are saved through incremental update strategy to support retrospective analysis, ultimately forming a complete module resource requirement profile library.
[0052] By using persistent storage and unique index binding, the extended resource feature matrix from the previous step is transformed into a dataset that can be stored long-term, retrieved quickly, and dynamically maintained. This achieves the expected technical effects of real-time calling capability and data consistency guarantee required by the resource contention prediction model.
[0053] Step S2: Based on real-time device operating status data, including available memory capacity, CPU load rate, network bandwidth utilization, and task queue length, construct a view of device resource supply capacity. Specifically, this includes: S2.1: Acquire raw resource status data collected by sensors and system monitoring components under the current operating status of the acquisition gateway. The input conditions are real-time monitoring signals inside the device, including physical memory usage, idle CPU time slice ratio, uplink / downlink network bandwidth utilization, and the number of pending processes in the operating system task queue. Perform data polling and normalization preprocessing based on the industrial-grade embedded monitoring agent to eliminate data jitter caused by sampling period differences, and output a standardized set of real-time resource indicators.
[0054] The input conditions are a set of real-time monitoring signals from inside the acquisition gateway device, including physical memory usage, idle CPU time slice percentage, uplink network bandwidth utilization, downlink network bandwidth utilization, and the number of pending processes in the operating system task queue, which are jointly output by hardware sensors and system monitoring components.
[0055] An industrial-grade embedded monitoring agent is used to poll data (parameters: sampling period 5s, sampling window length 60s) to achieve periodic acquisition of various monitoring signals and generate time-series raw data streams.
[0056] Furthermore, a normalization preprocessing algorithm (parameters: Z-score normalization, mean μ and standard deviation σ calculated from historical 30-minute monitoring data) is used to unify the dimensions of data from different resource types and eliminate instantaneous fluctuations caused by differences in sampling frequency. The normalization formula is as follows:
[0057] in, This is the current sampled value. The sample mean. The standard deviation of the sample is 1. This is the normalized value.
[0058] Furthermore, a weighted moving average method (parameters: weight vectors are configured according to resource importance, such as memory 0.4, CPU 0.3, network 0.2, and task queue 0.1) is used to smooth the normalized data, generating a low-noise real-time index set to improve the stability of subsequent feature extraction.
[0059] Furthermore, the smoothed data is synchronized and aligned using the timestamps of the monitoring signals to form a parallel mapping matrix of resource status, ensuring that different types of resource indicators have cross-correlation at a unified point in time.
[0060] Through the above normalization and synchronization processing, the original multi-source sensor data is transformed into a structured, comparable, and standardized set of real-time resource indicators, thereby providing high-precision basic data support for the view of equipment resource supply capacity.
[0061] For example, in an industrial IoT data acquisition gateway, the raw values output by the physical memory usage sensor range from 350MB to 420MB, the CPU idle time slice percentage is between 0.25 and 0.45, the network monitoring module reports an uplink utilization rate of 0.15% and a downlink utilization rate of 0.18%, and the task queue length sensor outputs 12 to 20 processes. An embedded monitoring agent polls and collects data at a 5-second cycle, forming a 60-second sampling window, and calculates the average memory sequence value. (MB), standard deviation (MB), substituting the current sampled memory value of 400MB into the normalization formula, we get ≈ After CPU, network, and task queue data are normalized using the same method, they are then smoothed using a moving average based on the weight vector. The resulting standardized real-time resource metric set is {Memory: 1.25; CPU: -0.18; Network: 0.30; Queue: 0.15}. This set is reliably stored in the base layer of the device resource supply capacity view, providing a stable data entry point for the subsequent multi-dimensional feature extraction in S2.2, and maintaining a significantly improved fluctuation suppression effect during load surges or resource releases.
[0062] S2.2: Perform multi-dimensional feature extraction on the standardized set of real-time resource indicators, where the input is preprocessed memory, CPU, network and task queue data; use the sliding window statistical method to calculate the trend feature parameters of each resource item, including memory change slope, CPU load fluctuation variance, bandwidth utilization growth rate and task queue length moving average, in order to capture the dynamic evolution of resource usage and generate a resource trend feature vector.
[0063] The input is a standardized set of real-time resource metrics, including quantified data for memory, CPU, network, and task queues, after polling and normalization preprocessing by the industrial-grade embedded monitoring agent in step S2.1.
[0064] A sliding window statistical method (parameters: window length W, step size Δt) is used to perform linear gradient fitting on the memory usage index within the time series dimension, calculating the slope of change to characterize the growth or release rate of memory resources per unit time. Furthermore, a variance calculation method (parameter: number of sample points n) is used to solve for the fluctuation variance of the CPU load rate time series data within the window interval, characterizing the instantaneous fluctuation intensity of CPU resources and obtaining load fluctuation characteristic values. Further, a differential growth rate calculation method (parameters: window start value v0 and end value v) is used. N The network bandwidth utilization sequence is subjected to normalized difference calculation to obtain the bandwidth utilization growth rate index, which measures the trend of network resource usage. Furthermore, a moving average method (parameter: window length m) is used to smooth the task queue length data, obtaining a moving average of the task queue length to reflect the system task backlog trend and processing pressure.
[0065] The memory change slope, CPU load fluctuation variance, bandwidth utilization growth rate, and task queue length moving average obtained by the above statistical methods are concatenated to form a multidimensional resource trend feature vector, which is then used as the output data of step S2.2 and input into step S2.3 for resource health matching.
[0066] S2.3: Match the resource trend feature vector with the preset resource health threshold matrix, where the input is the resource trend feature vector and the dynamic threshold strategy table issued by the system configuration management module; perform limit detection and status classification judgment based on the rule engine to identify the current status category of various resources as 'idle', 'stressed' or 'overloaded', and generate a resource health status classification label set.
[0067] S2.4: Integrate the resource health status classification label set and the original resource indicator set to construct a structured resource status snapshot record, where the input is the classification label and the quantitative indicator; by defining a unified resource state model (RSM), map heterogeneous resource information to standardized fields, including memory_status, cpu_load_level, network_utilization_grade and task_queue_state, to generate intermediate resource status instances.
[0068] The input conditions include the resource health status classification label set generated by S2.3 and the original resource indicator set obtained by step S2.1. These are heterogeneous data structures, containing qualitative status classifications and quantitative numerical parameters. A label-indicator integration method based on field mapping (parameters: resource type mapping table, classification label priority weight) is adopted to achieve a one-to-one correspondence between resource health labels and original quantitative indicators along the resource dimension, forming a label-indicator mapping table.
[0069] Furthermore, by using a unified resource description model construction algorithm, the label-index mapping table is mapped to a standardized set of model fields, and then organized into structured records according to the field order.
[0070] Furthermore, a field value normalization encoding method is adopted (parameters: classification label numerical encoding table, quantitative indicator unit standardization rules) to assign the memory_status field a value that combines the health label and available memory capacity, the cpu_load_level field a value that combines the CPU health label and current load rate, the network_utilization_grade field a value that combines the network health label and bandwidth utilization, and the task_queue_state field a value that combines the queue health label and task length.
[0071] Furthermore, by instantiating the generation algorithm (parameters: Unified Resource Description Model field set, encoded value set), the standardized field set is transformed into a data structure object that can be directly called in the system kernel, forming an intermediate resource state instance with type definition, field value filling and state binding.
[0072] Through the above-mentioned field mapping, model building and coding instantiation processing methods, the health labels and original indicator data of the previous step are transformed into intermediate resource status instances that conform to the unified resource description model, thereby realizing the standardized intermediate data output of the equipment resource supply capacity view.
[0073] S2.5: Inject the intermediate resource state instance into the device resource supply capability view cache area, where the input is the intermediate resource state instance; update the globally accessible resource view object based on the memory mapping sharing mechanism, and mark the timestamp to support version consistency control, and finally generate a device resource supply capability view with timeliness guarantee that can be called by the resource contention prediction model.
[0074] like Figure 2As shown, step S3 involves jointly constructing a resource contention prediction model using a combination of logistic regression and gradient boosting tree ensemble algorithms, training and converging based on historical loading logs, inputting the module resource demand profile and equipment resource supply capacity view into the resource contention prediction model, determining whether there is a risk of specific resource overload when multiple modules are loaded concurrently, and generating a resource conflict early warning signal. Specifically, this includes: S3.1: Based on the module resource demand profile and device resource supply capacity view generated in the previous steps, extract the resource types and peak occupancy required by each module to be loaded as input feature vectors. The resource types include memory capacity, CPU time slice, number of I / O channels and network bandwidth requirements, forming a module-level resource demand feature matrix. At the same time, obtain the current available memory capacity, CPU load rate, network bandwidth utilization and task queue length from the device operation status monitoring subsystem to construct the device resource supply status feature vector, providing a two-way data input basis for resource competition prediction.
[0075] Based on the module resource requirement profile and equipment resource supply capacity view generated in the previous steps, a feature vector extraction algorithm (parameters: resource type set, peak occupancy, resource unit standardization rule) is used to realize the structured parsing of the resource requirement data of each functional module to be loaded, and obtain a preliminary feature list including memory capacity, CPU time slice, number of I / O channels and network bandwidth requirements.
[0076] Furthermore, through a matrix construction algorithm (parameters: number of modules M, number of resource types R), the resource requirement list of each module is arranged according to the resource type dimension to generate a module-level resource requirement feature matrix. Each row in the matrix corresponds to a module, each column corresponds to a resource type, and the matrix element is the peak occupancy of that resource type.
[0077] Furthermore, through the device operation status sampling interface (parameters: memory monitoring unit ID, CPU monitoring unit ID, network interface ID, task queue monitoring process ID), real-time indicators of the current device's resource supply are obtained, including available memory capacity, CPU load rate, network bandwidth utilization rate, and task queue length, and stored as raw supply data streams according to resource type consistency requirements.
[0078] Furthermore, by using a feature vector construction method (parameters: resource type consistency mapping table, unit conversion rules), the above-mentioned original supply data stream is converted into a feature vector of equipment resource supply status, ensuring that the dimensions and units of each resource type are consistent in the supply and demand data, thus forming a set of supply-side input features.
[0079] By using a bidirectional feature mapping method, the module-level resource demand feature matrix and the equipment resource supply status feature vector are stored in parallel to form a bidirectional data input basis that can be directly input into the resource competition prediction model, thereby providing a highly consistent and highly correlated supply and demand data structure for subsequent prediction models.
[0080] For example, in an industrial IoT data acquisition gateway system, the module resource requirement profile shows that module A has a peak memory usage of 512MB, a CPU time slice of 200ms, a requirement of 2 I / O channels, and a network bandwidth requirement of 1500Kbps. The currently available memory obtained from the device operation status monitoring subsystem is 1024MB, the CPU load rate is 40%, the network bandwidth utilization rate is 30%, and the task queue length is 5. After processing with a feature vector extraction algorithm, the requirement feature vector of module A is obtained. Equipment supply status feature vector Inputting both into the matrix construction algorithm generates the following module-level resource requirement feature matrix: The system provides the resource supply status feature vector of the equipment to the resource competition prediction model for conflict risk assessment. The execution results show that the module has sufficient resource guarantee under the current equipment status, meets the subsequent dynamic loading conditions, and the system still maintains high stability when the load pressure changes.
[0081] S3.2: Normalize the module resource demand feature matrix and the equipment resource supply status feature vector to eliminate the dimensional differences between different resource dimensions. Use the Min-Max standardization method to map each resource index to the [0,1] interval to generate a standardized resource supply and demand matching degree input space, so as to improve the convergence stability and classification accuracy of the subsequent prediction model, and output the standardized resource supply and demand matching degree feature tensor.
[0082] S3.3: Construct a resource contention label dataset based on historical loading logs. Each record contains a combination of module loading requests, the corresponding device resource status, and whether a resource overrun event actually occurred. Each record is labeled as a binary category: 'conflict' or 'non-conflict'. Use this dataset to train a lightweight classification model. By combining logistic regression and gradient boosting tree ensemble algorithms, a resource contention prediction model is generated. Its output is the probability value of resource overruns occurring in concurrent loading scenarios, realizing the transformation from historical experience to real-time prediction capabilities.
[0083] Based on the normalized resource supply and demand matching feature tensor and historical module loading log records, a data tagging method (parameters: module combination identifier, equipment resource status, actual over-limit flag) is used to realize the function of constructing a resource competition tag dataset.
[0084] Furthermore, by using the time series slicing method (parameters: loading request trigger time, resource occupation duration window), the characteristics of complex loading scenarios are preserved, and a training dataset containing multiple time slice samples is obtained.
[0085] Furthermore, through the feature mapping encoding method (parameters: resource type encoding table, business priority encoding table), the non-numerical fields in the label dataset are transformed into numerical representations, and a set of feature-label pairs in a unified format is generated.
[0086] Furthermore, by using a sample equalization processing algorithm (parameters: undersampling ratio, oversampling ratio), the distribution of conflict and non-conflict samples is balanced, avoiding model class bias during training and obtaining training data with equalized class distribution.
[0087] Furthermore, an ensemble algorithm combining logistic regression and gradient boosting tree (parameters: logistic regression regularization coefficient C, gradient boosting tree depth d, and learning rate η) is employed to jointly model the relationship between resource supply and demand matching features and conflict labels, and to generate the output function of the resource competition prediction model. ,in To standardize the feature tensor, This represents the probability of resource overrun occurring.
[0088] By using the integrated algorithm described above, the historical experience data from the previous step is transformed into a predictive model that can output conflict probabilities in real-time concurrent loading scenarios, achieving the technical effect of moving from static logs to dynamic decision-making.
[0089] For example, in an industrial data acquisition gateway scenario, the historical loading log contains 5000 records. The module combination identifier field ranges from any concurrent combination of 10 functional modules. The device resource status field includes real-time monitoring data such as memory capacity (MB), CPU load rate (%), network bandwidth utilization (Kbps), and task queue length. The actual over-limit flag field is a binary category based on the event records where resources reach the threshold during loading. After data labeling, a feature-label set is obtained, where memory capacity is encoded to the unit MB, CPU load rate is normalized to [0,1], and business priority labels are mapped to values from 0 to 3. A 30-second time window slicing method is used to construct composite scenario samples, with an undersampling ratio of 0.5 and an oversampling ratio of 1.5 to balance the number of conflicting and non-conflicting samples. The regularization coefficient of the logistic regression model... Gradient boosting tree sets the tree depth Learning rate After training, the prediction function is obtained. where e is the Euler number. This is a fusion of the weighted outputs of logistic regression and gradient boosting tree. On the test set, this model significantly improves the accuracy of predicting over-limit events in resource quota evaluation for concurrent loading of multiple modules, enabling early triggering of resource scheduling strategies and improving system loading success rate and stability.
[0090] S3.4: Input the standardized resource supply and demand matching feature tensor into the trained resource competition prediction model, perform forward inference calculation, and obtain the resource over-limit probability score under the current multi-module concurrent loading request; perform binarization judgment on the score according to the preset threshold (such as 0.65). If the score is higher than the threshold, generate a Boolean flag of 'there is a risk of resource competition' as the core content of the resource conflict early warning signal.
[0091] The input conditions are the resource supply and demand matching feature tensor after S3.2 standardization and the resource competition prediction model trained by S3.3. The two maintain the same feature dimension in structure and the values are normalized to a unified range.
[0092] The forward inference method of the model (parameters: standardized resource supply and demand matching feature tensor, resource competition prediction model weight vector) is used to realize the calculation of resource over-limit risk in the current multi-module concurrent loading scenario.
[0093] Furthermore, by integrating the linear combination function of the logistic regression component with the gradient boosting tree component through an output fusion method (parameter: fusion weight is set according to the principle of minimizing cross-validation error during the training phase), a weighted synthesis of multi-model predictions is achieved, and a resource over-limit probability score is obtained.
[0094] Furthermore, a linear combination of probability scores is calculated using the formula:
[0095] in, Score the probability of resource overrun. For the Sigmoid function, For the model weight vector, The input feature tensor.
[0096] Furthermore, a probability scoring threshold determination method is used (parameter: preset threshold). This implements binarization of the score, compares the score value with a threshold, and outputs a Boolean flag if the score value is higher than the threshold. Otherwise output .
[0097] By using a binarization judgment processing method, the continuous probability results of the previous step are transformed into Boolean indicators of whether resource competition risk exists, thereby realizing the generation of core data for resource conflict early warning signals.
[0098] For example, in a real-world operating scenario of an industrial IoT data acquisition gateway, the input feature tensor has a dimension of 4, corresponding to a memory matching degree value of CPU matching degree value Network bandwidth matching score I / O channel matching degree value The model weight vector is determined through training. The linear combination value is calculated using logistic regression: , obtain the combined value Input the combined value into the Sigmoid function. The logistic regression probability output is calculated. The probability output of the gradient boosting tree components. According to the fusion weight, each The final risk score is obtained by linear averaging. With threshold The comparison and judgment result are as follows: Therefore, a Boolean flag indicating a resource contention risk is output, and the system proceeds to the subsequent S3.5 warning message encapsulation process. In this scenario, the system can trigger priority scheduling in advance, significantly improving the success rate and stability of concurrent loading.
[0099] S3.5: The generated resource conflict warning signal is encapsulated into a structured event message, which includes the warning level, the type of resource involved, a list of high-risk module IDs, and a suggested response action field. It is then published to the operation control module through the internal message bus to trigger the condition judgment process of the subsequent resource scheduling strategy, ensuring that the system can enter the hierarchical loading and control stage in a timely manner when potential resource competition is detected.
[0100] like Figure 3 As shown, step S4 involves initiating a resource scheduling strategy based on the resource conflict warning signal. High-priority modules are given priority in resource allocation, while the loading operations of low-priority modules are marked as delayed execution or phased injection, forming a hierarchical loading instruction sequence. Specifically, this includes: S4.1: Based on the resource conflict warning signal generated in the previous steps, obtain the set of functional modules to be loaded and their corresponding module resource requirement profiles. Each module resource requirement profile includes the memory capacity, CPU time slice and I / O channel required by the module during the loading process and their peak occupancy, which serve as the input basis for resource scheduling decisions.
[0101] Based on the resource conflict warning signal generated in the previous steps, the event parsing method (parameters: warning level, resource type involved, list of high-risk module IDs) is used to accurately identify potential resource competition scenarios in the current system.
[0102] Furthermore, by using a module set extraction algorithm (parameters: high-risk module ID in the warning signal, local module registry index field), the set of functional modules that have triggered loading requests under device status awareness is extracted, and a module list dataset containing the unique identifier, version number, and image file path of the module to be loaded is obtained.
[0103] Furthermore, a resource requirement profile association and matching method is adopted (parameters: module ID, local resource requirement profile library index key) to achieve a one-to-one mapping between the set of modules to be loaded and the stored module resource requirement profiles, and to generate a resource requirement matching set, in which each element contains memory capacity. CPU time slice Number of I / O channels and network bandwidth Quantitative description of the types and their peak occupancy.
[0104] Furthermore, by using a resource peak extraction algorithm (parameter: resource demand matching set), the maximum potential resource demand of each module during the loading phase is analyzed, and a module resource peak vector matrix is generated, where the rows of the matrix correspond to the modules and the columns correspond to the normalized values of each resource type.
[0105] By using the matrix persistence writing method (parameters: module resource peak vector matrix, scheduling decision cache identifier), the results of the previous step are transformed into the input basis for the upcoming resource scheduling strategy stage, thereby achieving precise control of the resource competition situation during module loading.
[0106] For example, in an industrial IoT data acquisition gateway scenario, a resource conflict warning signal contains a list of high-risk module IDs {M1, M3, M8}, with a warning level of 3, involving memory and CPU resources. The system uses an event parsing method to extract the resource risk characteristics corresponding to this signal. A module set extraction algorithm retrieves the following path from the local module registry: M1 version 1.2 image file path / mnt / module / M1.bin, M3 version 2.0 path path / mnt / module / M3.bin, and M8 version 3.1 path path / mnt / module / M8.bin. A resource requirement profile association matching method retrieves the memory requirements of M1 during the loading phase from the resource requirement profile database. CPU requirements Time slice; Memory requirements during M3 loading phase CPU requirements Time slice; M8 loading phase memory requirements CPU requirements Time slice. The matrix generated by the resource peak extraction algorithm is: rows [M1, M3, M8], columns [Memory (MB), CPU (ms)], corresponding values [[128, 50], [256, 80], [512, 120]]. The matrix is persistently written to the scheduling decision cache and is directly called in subsequent resource priority policy calculations, significantly improving the accuracy of resource allocation and system stability when multiple modules are loaded concurrently.
[0107] S4.2: According to the business priority strategy table preset by the acquisition gateway, the functional modules to be loaded are classified by priority. The business priority strategy table is pre-configured based on the functional criticality in the industrial control scenario, and outputs the priority label of each module as the basis for subsequent resource allocation order determination.
[0108] S4.3: Based on the intensity level of the resource conflict early warning signal and the available resource balance in the equipment resource supply capacity view, calculate the current system carrying capacity index, use fuzzy logic reasoning mechanism to determine whether parallel loading is allowed, if the carrying capacity index is lower than the threshold, trigger the hierarchical scheduling mechanism and enter the module loading sorting process.
[0109] Using the intensity level of the resource conflict early warning signal and the available resource balance in the equipment resource supply capacity view as input conditions, a weighted parameter fusion method (parameters: early warning level weight coefficient α, resource balance weight coefficient β, business priority influence coefficient γ) is adopted to achieve the preliminary calculation of the system carrying capacity index.
[0110] Furthermore, by using a normalization mapping algorithm (parameter: Min-Max normalization interval [0,1]), the dimensionality of the original carrying capacity calculation results is unified, and standardized carrying capacity scoring data that can be used for fuzzy logic reasoning is obtained.
[0111] Furthermore, the formula for calculating the bearing capacity index C is adopted:
[0112] Where α is the warning level weight coefficient, β is the resource reserve weight coefficient, and γ is the business priority impact coefficient. Score the intensity of resource conflict early warning. Rate the available resource balance of the equipment. Weight values for business priorities.
[0113] Furthermore, through a fuzzy logic reasoning mechanism (parameters: membership function type - triangle, rule base size - 15), the mapping between the carrying capacity index and the parallel loading permission status is realized, and a binary judgment result is generated to determine whether the current system allows parallel loading.
[0114] Furthermore, if the assessment results show that the carrying capacity index is below the threshold... The module loading and sorting process is initiated by triggering a hierarchical scheduling mechanism, and a sorting list with conflict risk labels is generated.
[0115] By using the above-mentioned fuzzy logic reasoning processing method, the resource conflict warning signal and resource supply margin in the previous step are transformed into quantitative carrying capacity judgment indicators, thereby achieving the technical effect of precise control over the feasibility of parallel loading.
[0116] For example, in a certain industrial IoT data acquisition gateway, the resource conflict early warning signal strength level is: The available memory capacity rating in the device resource supply capacity view is: The business priority weighted value is Configure weight coefficients , , Calculate using the formula: The calculated bearing capacity index is Fuzzy logic reasoning mechanisms use triangular membership functions to... The system is mapped to a "parallel loading is allowed" state and a flag indicating that parallel loading is enabled is output. Based on this result, the system enters a parallel loading priority sorting process. High-priority modules are placed in the immediate loading queue, while medium- and low-priority modules are scheduled according to a delay strategy. Tests show that the loading success rate is significantly improved under this configuration, system resource utilization is optimized, and resource contention during the loading process is significantly reduced.
[0117] S4.4: Mark high-priority modules as immediately executed and place their loading requests into the emergency loading queue; perform delay strategy analysis on medium and low-priority modules, and generate delay time windows or phased resource injection plans based on their functional timeliness requirements and historical loading frequency, forming a hierarchical loading instruction sequence with time constraints.
[0118] S4.5: Write the generated hierarchical loading instruction sequence into the task list of the module loading task scheduler, and attach resource reservation flags and execution condition constraints, so that subsequent steps can implement resource pre-allocation and sequential loading control based on the instruction sequence, ensuring that high-priority modules complete dynamic loading first under resource guarantee conditions.
[0119] Based on the generation result of the hierarchical loading instruction sequence, the task registration interface of the module loading task scheduler is input to call the structured task generation method (parameters: module ID, priority label, execution order index) to realize the orderly arrangement of the loading actions of each module to be loaded and form a task list data structure.
[0120] Furthermore, by using the task attribute enhancement method (parameters: resource reservation flag setting rules, execution condition constraint rule set), the resource guarantee status of each task list item is logically marked, and loading trigger preconditions are attached to form task metadata with resource occupancy protection and execution access verification capabilities.
[0121] Furthermore, by utilizing a conditional constraint compilation algorithm (parameters: business priority mapping table, resource supply capability view version number), the execution conditional constraints are converted into Boolean logic expressions that the scheduler can parse, and embedded into the control field of the task metadata, resulting in a task description unit that can perform conditional judgments at runtime.
[0122] Furthermore, a task sequence persistence method (parameters: transaction isolation level, version locking strategy) is adopted to permanently store the task list with attached resource reservation flags and execution condition constraints in the task queue storage field inside the scheduler, and to ensure that each task sequence maintains version consistency and sequential integrity in the subsequent resource reservation process.
[0123] Through the above processing method, the hierarchical loading instruction sequence is transformed into a task list in the task scheduler that has execution order, resource guarantee status and conditional admission logic, so as to achieve the expected technical effect of high-priority modules completing dynamic loading first under resource guarantee conditions.
[0124] Step S5: Based on the hierarchical loading instruction sequence, a resource reservation pool is dynamically created before module loading, temporarily locking the memory space, CPU time slice, and I / O channels necessary for the module to be loaded, and generating a resource reservation status record. Specifically, this includes: S5.1: Based on the module resource requirement profile of each functional module to be loaded in the hierarchical loading instruction sequence, extract the set of resource types required by it in the loading stage, including memory capacity threshold, CPU time slice quota, I / O channel identifier and minimum guaranteed network bandwidth, to form a module-level resource request list, which serves as the input basis for the construction of the resource reservation pool.
[0125] S5.2: Based on the total amount of available resources in the equipment resource supply capacity view and combined with the module-level resource request list, calculate the comprehensive resource window required for the resource reservation pool. For concurrent requests from multiple modules, a time-resource two-dimensional matrix model is used to generate a resource occupancy time sequence planning table to optimize resource space allocation and avoid instantaneous over-limit.
[0126] For example, in an industrial data acquisition gateway scenario, the available memory is 2048MB, the total CPU idle time slice is 500ms, the number of I / O channels is 8, and the available network bandwidth is 20000Kbps. Module A requires 512MB of memory, 200ms CPU time slice, 2 I / O channels, and 2000Kbps network bandwidth; Module B requires 1024MB of memory, 300ms CPU time slice, 4 I / O channels, and 5000Kbps network bandwidth; and Module C requires 256MB of memory, 100ms CPU time slice, 1 I / O channel, and 1000Kbps network bandwidth. In the time-resource two-dimensional matrix modeling, the time slice Δt = 50ms is set, resource types are mapped to row indices, and time slices are mapped to column indices, filling in the requirements of each module in each slice. Through superposition calculation, the peak memory requirement in a certain slice is found to be 1792MB, and the utilization ratio is calculated. The result is approximately 0.875, which is lower than the memory risk threshold of 1.0; the peak CPU demand is 580ms, and the utilization rate is... The CPU time slice allocation for module B is approximately 1.16, which is higher than the CPU risk threshold of 1.0. Therefore, in the optimization of the timing schedule, a phased injection is performed on the CPU time slice allocation for module B, dividing its loading into two time windows, each allocated 150ms, to reduce the risk of exceeding the limit in a single window. The final generated resource usage timing schedule satisfies the margin constraint in all slices, ensuring that the resource reservation pool can lock the required resources according to the plan, significantly improving the stability of the dynamic loading process of multiple modules.
[0127] S5.3: The resource allocation timing planning table drives the dynamic memory allocator to perform reservation operations and performs page table locking on the physical memory region to reserve contiguous address space to meet peak memory demand; at the same time, the real-time scheduler reserves CPU time slice quotas and registers exclusive channel access permissions with the I / O management unit to generate resource pre-allocation control policies.
[0128] The input condition is the resource usage timing plan table generated by S5.2. The plan table defines the timing distribution of memory, CPU time slices and I / O channels required by a module under multiple concurrent loading requests.
[0129] The dynamic memory allocator call interface (parameters: peak memory requirement field of resource usage time series planning table, address continuity constraints) is used to realize the reservation operation of physical memory area to ensure that the maximum memory usage requirement of consecutive time segments in the planning table is matched.
[0130] Furthermore, by using the page table locking method (parameters: contiguous physical address range, locking policy mode LRU-Pinned), the non-preemptible state of the memory region is maintained, and an address space block equal to the peak memory demand is obtained as the locking result.
[0131] Furthermore, by executing the CPU time slice reservation algorithm (parameters: CPU load peak value and thread priority label in the resource occupancy timing plan table) through the real-time scheduler, time slice quotas dedicated to the modules to be loaded are allocated, and a CPU quota mapping table is generated inside the scheduler.
[0132] Furthermore, through the channel registration interface of the I / O management unit (parameters: I / O channel identifier set, exclusive access flag), the exclusive access permission registration of the corresponding channel is realized, and a set of dedicated channel control handles that can be occupied by a single module is obtained.
[0133] By integrating the locked memory block information, CPU quota mapping table, and I / O channel control handles, a resource pre-emption control strategy data structure is generated to achieve comprehensive reservation and non-preemption of critical resources required by the modules to be loaded.
[0134] S5.4: Inject the resource pre-occupancy control policy into the resource management module of the operating system kernel layer of the acquisition gateway, trigger the kernel to execute the resource isolation mechanism, so that the declared resources enter the non-preemptible state, and generate a resource pre-occupancy status record, which includes the type, quantity, owner module and valid timestamp of the locked resources.
[0135] After receiving the resource pre-occupancy control policy parameter set generated by S5.3, the kernel-mode resource management call interface (parameters: resource type identifier, quantity threshold, access mode) is used to load the control policy from user mode into the core resource management module of the acquisition gateway operating system.
[0136] Furthermore, by using the kernel module injection method (parameters: target kernel symbol table address, policy execution entry pointer), the existing kernel resource scheduling routines are dynamically extended, so that the resource pre-emption policy is registered as a high-priority uninterruptible processing task at the kernel level and enters the first execution queue of the scheduling table.
[0137] Furthermore, by utilizing the kernel resource isolation mechanism to call the group (parameters: resource descriptor set, isolation domain ID), the state migration of the resources declared by the module to be loaded is realized, transferring them from the shared resource pool to the isolation domain, and marking the access permission of the isolation domain as exclusive mode to prevent other processes or threads from preempting them.
[0138] Furthermore, a resource locking atomic operation algorithm (parameters: lock type = write lock, timeout threshold = 0) is adopted to achieve global locking of memory page table entries, CPU time slice allocation units, and I / O channel handles, and generate the corresponding resource pre-occupancy status data structure after successful locking.
[0139] By using a status record generation function (parameters: resource type enumeration, quantity value, module UUID, timestamp), the detailed information of locked resources is written into the resource pre-occupancy status record, and a validity label is set for subsequent loading access verification, thereby realizing full-process control of resources entering the non-preemptible state.
[0140] S5.5: Record the resource pre-occupancy status in the module loading transaction log and update it synchronously to the runtime context of the configuration management module. This serves as an admission credential for the subsequent loading process, ensuring that the actual module loading stage can only begin when resource pre-occupancy is successfully completed, thus forming a closed loop for resource protection.
[0141] Step S6: Based on the resource pre-occupancy status record, the dynamic loading process of functional modules is triggered in priority order to ensure that high-priority modules complete loading under resource guarantee conditions, and a module loading completion confirmation signal is generated. Specifically, this includes: S6.1: Based on the locked memory space, CPU time slice and I / O channel information in the resource pre-occupancy status record, parse the resource allocation configuration parameters corresponding to each functional module to be loaded, and generate a module loading resource configuration list to clarify the exclusive resource boundaries that each module can call during the loading process.
[0142] S6.2: Based on the business priority tags in the hierarchical loading instruction sequence, sort the module loading resource configuration list to form a module loading scheduling queue arranged in descending order of priority, which serves as the basis for the execution of the dynamic loading process.
[0143] The input conditions are the module loading resource configuration list output from step S6.1 and the business priority label data within the hierarchical loading instruction sequence generated in step S4, which serve as the dual basis for sorting.
[0144] A priority-weighted fast sorting algorithm (parameters: priority label, resource type weight coefficient) is adopted to perform preliminary priority sorting of each module entry in the module loading resource configuration list, and generate a temporary queue structure with sorting index.
[0145] Furthermore, a secondary sorting correction is performed on the above temporary queue structure through a resource usage peak correction mechanism (parameters: existing available amount in the resource reservation pool, peak usage of each module), ensuring that high-priority modules with reasonable resource usage are at the top of the sorting list, thus obtaining an optimized priority sequence matrix.
[0146] Furthermore, a conflict avoidance filtering algorithm (parameters: optimized priority sequence matrix, resource conflict early warning signal) is adopted to adjust the position of modules that may cause resource competition or mark their delay attributes, and generate a conflict avoidance flag queue.
[0147] Furthermore, a dynamic queue reconstruction method (parameters: conflict avoidance flag queue, time dependency constraints) is used to form the final module loading scheduling queue in descending order of priority, ensuring that modules that meet the conditions of business criticality and resource adaptability are loaded first.
[0148] By using the sorting and restructuring methods described above, the resource configuration list and priority tags from the previous step are transformed into a structured module loading scheduling queue, thereby optimizing the execution order of the dynamic loading process and significantly improving the efficiency of system resource utilization.
[0149] For example, a hierarchical loading instruction sequence of a data acquisition gateway contains 5 modules to be loaded, with the following service priority labels: Module A = High, Module B = High, Module C = Medium, Module D = Low, and Module E = Lowest. The resource requirements for each module are 500MB, 200MB, 300MB, 150MB, and 100MB of memory, and 200ms, 150ms, 180ms, 100ms, and 80ms of CPU time slices, respectively. A fast sorting algorithm based on priority weight mapping is used, with weight coefficients set to 5, 4, 3, 2, and 1 for priorities from highest to lowest, to initially sort the module set, forming an index sequence [A, B, C, D, E]. A resource usage peak correction mechanism is used to calculate the resource usage ratio of each module: , , , , The overall resource suitability is calculated based on the CPU time slice occupancy ratio, and the sequence is adjusted to [A,B,C,E,D] to avoid conflicts caused by instantaneous peak occupancy. The conflict avoidance filtering algorithm detects a conflict risk between module C and module E in terms of network bandwidth requirements. Module E is marked with a delay attribute, forming a conflict avoidance flag queue [A,B,C,D,E]. The dynamic queue reconstruction method adjusts the final scheduling queue [A,B,D,C,E] based on the time dependency constraint (module C must be executed after module B is loaded). In actual loading, modules A and B can be loaded continuously and completed smoothly, module D is loaded after resource release, module C is loaded after the dependency conditions are met and resources are restored, and module E is executed as a delayed loading item under low load. This method significantly improves the stability of module loading and resource utilization in the test scenario.
[0150] S6.3: Extract the first module to be loaded from the module loading scheduling queue, obtain its corresponding module binary image file and its dependency library list, perform the initialization operation of the module loader, create an independent loading execution context environment, and generate a module loading execution instance.
[0151] S6.4: In the module loading execution instance, based on the resource type and peak occupancy defined in the module resource requirement profile, verify whether the actual pre-occupancy status in the current resource reservation pool meets the loading conditions of the module. If it does, trigger the dynamic linking and symbol resolution process, inject the module image into the runtime address space, and generate the mapped module entity.
[0152] In the module loading and execution instance, the resource types and peak usage data, such as memory capacity, CPU time slice, number of I / O channels, and network bandwidth, defined in the module resource requirement profile, are imported into the resource verification unit. A resource matching verification algorithm is then used (parameter: requirement feature vector R). req Pre-occupied resource status R lock This enables a step-by-step comparison of module requirements with reserved resources.
[0153] Furthermore, by using the difference detection method, the actual available margin for each resource type is calculated, and a Boolean judgment matrix is obtained to determine whether each resource meets the loading conditions.
[0154] Furthermore, a multi-condition logic combination algorithm is adopted to achieve comprehensive judgment of loading conditions and generate a single Boolean value as a process advancement signal. The algorithm combines all resource satisfaction flags according to AND logic to ensure that the loading process is blocked when any resource is insufficient.
[0155] Furthermore, when the determination result is that the condition is loadable, the dynamic linker interface (parameters: module binary image path, dependency library list) is called to implement the module dependency resolution and symbol binding functions, and obtain the resolved symbol table data structure.
[0156] Furthermore, a runtime address space injection method is adopted (parameters: parsed module image, target virtual memory region address) to load the module image into the specified address region in the acquisition gateway runtime environment and generate a mapped module entity object for subsequent use by calling the entry point function to start the internal initialization logic.
[0157] Through the above verification, parsing and injection processing methods, the actual locking state of the resource reservation pool is accurately matched with the module loading requirements, and when conditions permit, the module image is transformed into an executable and schedulable runtime entity object, thereby ensuring resource availability and execution environment readiness during the module loading phase.
[0158] S6.5: Execute the entry point function call on the mapped module entity to start the module's internal initialization logic and listen for its return status; when the initialization success signal is detected, generate the module loading completion confirmation signal for the module and feed it back to the running control module, while updating the module running status field in the local module registry to 'activated'.
[0159] After the module loading and execution instance completes the mapping, the input conditions are the entry point function address of the mapped module entity, the module initialization parameter set, and the runtime resource access control handle.
[0160] The entry point call method (parameters: entry point function address, initialization parameter set) is used to trigger the module's own initialization logic and establish runtime resource binding relationships.
[0161] Furthermore, by using the state listener method (parameters: runtime resource access control handle, initialization process event stream), continuous monitoring of state changes during the module initialization phase can be achieved, and a sequence of state events covering initialization execution progress and exception information can be obtained.
[0162] Furthermore, by using a return code analysis method (parameters: status event sequence, predefined success code set), the initialization result events are filtered and identified, and a Boolean judgment value is generated to determine whether the module loading was successful or not.
[0163] Furthermore, by using a confirmation signal generation method (parameters: Boolean judgment value, module unique identifier), the successful judgment result is transformed into a structured module loading completion confirmation signal data structure, which includes module ID, loading completion timestamp, and resource binding information.
[0164] The confirmation signal is transmitted to the operation control module by calling a method through the operation control interface (parameters: module loading completion confirmation signal data structure, operation control module entry address) to trigger subsequent operation state monitoring initialization.
[0165] By using the module registry update method (parameters: module unique identifier, running status field 'activated'), the result of the previous step is converted into status update data in the local module registry, thereby marking the module's running status in the global registration system as a technical effect of the end of the system's dynamic loading process.
[0166] Step S7: After loading is complete, automatically release the locked resources in the resource reservation pool and update the device resource supply capacity view to form the latest resource status snapshot. Specifically, this includes: S7.1: Based on the module loading completion confirmation signal, a resource release determination mechanism is triggered. This mechanism determines the memory space, CPU time slice and I / O channel set to be released according to the locked resource types and quantities registered in the resource pre-occupancy status record, and generates a resource release list to clarify the specific resource items to be reclaimed this time.
[0167] The input conditions include a module loading completion confirmation signal output by S6.5 and the associated resource pre-occupancy status record, which includes information such as the locked memory space size, CPU time slice quota, I / O channel identifier and lock timestamp.
[0168] A signal listener-driven determination method (parameters: module loading completion confirmation signal, resource pre-occupancy status record index) is adopted to identify the end status of the loading process and trigger the resource release determination process.
[0169] Furthermore, by using a structured data parsing method (parameter: resource pre-occupancy status record), the record fields are read item by item to obtain the locked resource category set and its quantity parameters.
[0170] Furthermore, a resource type mapping algorithm (parameters: memory capacity in MB, CPU time slice in ms, number of I / O channels) is adopted to realize the transformation from the original lock identifier to a unified resource description model and generate a computable resource occupancy list.
[0171] Furthermore, by using the set difference operation method (parameters: locked resource set, current available resource set of the device), the set of resources to be released is determined, and a resource release list containing the types and quantities of each resource is generated.
[0172] Furthermore, a multi-condition filtering algorithm (parameters: valid timestamp, module affiliation, resource category priority) is used to verify the legality of the release list and output the final filtered resource release list.
[0173] By using resource determination and set operation processing, the module loading completion signal from the previous step is transformed into a structured and executable resource release list, achieving precise positioning and classification of resource recycling.
[0174] For example, in an industrial data acquisition gateway device, during the loading process of the resource pre-occupancy status recording and display module A, 256MB of memory space, 400ms of CPU time slice, and I / O channel number #3 are locked, with a lock timestamp of 1687392000 seconds. After the signal listener detects the confirmation signal that module A has completed loading, the judgment process is initiated. The data parser reads the lock field in the record, and the resource type mapping algorithm converts 256MB into a uniform description tuple <memory, 256>, and CPU into...<CPU,400> The I / O channel is converted to <I / O,3>[a specific resource]. Set difference operations determine that none of these three resources are currently in the available set of the device and must be released. A multi-condition filtering algorithm confirms that the lock is still within the release window based on the valid timestamp and confirms that the resource is not shared by other modules based on module affiliation. Finally, a release list is generated: 256MB of memory, 400ms of CPU time slice, and I / O channel #3. This list is then passed to the resource unbinding module to ensure that the available resources on the device increase after resource release, significantly improving the system's carrying capacity.
[0175] S7.2: Perform unbinding operations on each resource in the resource release list, release the occupied physical memory page frames using the operating system-level resource management interface, return the CPU time slice quota reserved by the scheduler, close the exclusive lock state of the dedicated I / O channel, and generate a resource unbinding completion signal as the basis for the actual resource reclamation.
[0176] S7.3: Based on the resource unbinding completion signal, update the dynamic parameter fields in the device resource supply capacity view, including restoring the available memory capacity to the value after release, resetting the CPU load baseline, marking the I / O channel as idle, and combining the real-time sampled value of the task queue length to calculate the updated comprehensive resource reserve index and generate incremental update data of resource status.
[0177] The input conditions are the resource unbinding completion signal output by S7.2 and its associated resource release list, which includes the real-time sampled values of the memory capacity to be released, the number of CPU time slices, the I / O channel identifier set, and the current length of the task queue.
[0178] The memory parameter recovery method (parameters: released memory capacity value, current available memory capacity counter) is adopted to adjust the memory_status field of the device resource supply capacity view to the value after memory release, so as to ensure that the available memory capacity dynamically reflects the latest status.
[0179] Furthermore, by using the CPU load baseline reset algorithm (parameters: number of CPU time slices released, historical baseline of CPU load rate), the cpu_load_level field of the device resource supply capacity view is reset, so that the CPU load rate is restored to the baseline level after resource release, thereby reducing the interference of historical occupancy on the new round of load assessment.
[0180] Furthermore, an I / O channel flag update method (parameter: release I / O channel identifier list) is adopted to set the channel status flag associated in the network_utilization_grade field of the device resource supply capability view to idle, so that subsequent concurrent loading requests can directly reuse channel resources.
[0181] Furthermore, by combining task queue sampling with resource reserve calculation methods (parameters: real-time task queue length, available memory capacity, available CPU time slices, number of idle I / O channels), the updated comprehensive resource reserve is calculated based on the weighted comprehensive index formula. The following calculation formula is used:
[0182] in, This represents the available memory capacity after the memory has been freed. The number of available CPU time slices after release. This represents the number of idle I / O channels. The current length of the task queue. , , This refers to the resource weighting coefficient. It is obtained through calculation. The value serves as a comprehensive indicator of resource surplus.
[0183] By generating incremental update data of resource status through comprehensive resource surplus indicators, the dynamic parameters of the equipment resource supply capacity view are updated synchronously, providing a high-precision resource status benchmark for subsequent steps.
[0184] For example, in a data acquisition gateway device, S7.2 releases 512MB of memory, 200ms of CPU time slice, and 2 I / O channels. The current task queue length is 5, and the weighting coefficient is... =0.4、 =0.35、 =0.25. Update memory_status from 1024MB to 1536MB, reset cpu_load_level from 70% to 45%, and update the channel status corresponding to network_utilization_grade from "occupied" to "idle". Substitute into the formula to calculate. value:
[0185] Calculated ≈ This value represents the overall resource reserve after this resource release. During the verification process, this value was significantly higher than the value before the release, reflecting the optimization effect of the resource status and providing high availability assurance for resource matching in the next round of module loading.
[0186] S7.4: Bind the incremental update data of the resource status with the system timestamp to build a structured resource status snapshot record, and write it into the global status database in shared memory. At the same time, publish the status change event to notify the configuration management module and the operation control module to obtain the latest resource view and generate the latest resource status broadcast signal.
[0187] S7.5: Based on the latest resource status broadcast signal, activate the resource coordination listener in the event-driven architecture, so that it uses the updated resource status snapshot as the initial evaluation condition for the next round of concurrent loading requests, ensuring that subsequent module loading decisions are based on the latest resource supply and demand relationship, forming a closed-loop resource awareness-allocation-release-reuse link.
[0188] Step S8: Subsequent loading requests are processed asynchronously using an event-driven architecture, utilizing the updated resource state snapshot as input for the next round of resource coordination, thus achieving closed-loop resource management during the module loading process. Specifically, this includes: S8.1: Based on the latest device resource supply capacity view output in the previous step S7, generate a standardized resource status snapshot. The resource status snapshot includes quantified values of the current available memory capacity, CPU load rate, network bandwidth utilization rate, and task queue length, which are encapsulated in a unified data structure and used as the benchmark input conditions for subsequent resource coordination processes.
[0189] S8.2: Register the loading requests for new functional modules received by the acquisition gateway, cache the requests using the message queue mechanism in the event-driven architecture, extract the trigger source information and module identifier carried in each request, and generate loading event instances with timestamps to achieve non-blocking decoupled processing of loading operations.
[0190] S8.3: Associate and match the resource status snapshot generated in S8.1 with the loading event instance generated in S8.2. Based on the matching result, call the resource contention prediction model. This mechanism performs a conflict risk assessment on the resource demand profile of the current module to be loaded based on the rule model trained by the historical loading log, and outputs a binary judgment result of whether a resource warning is triggered.
[0191] S8.4: Based on the resource conflict warning signal output by S8.3, execute the hierarchical resource scheduling strategy: If there is a risk of resource over-limit, sort multiple concurrent loading events according to the preset business priority strategy, and generate a hierarchical loading instruction sequence that is executed in a delayed manner or injected in stages, so as to optimize the system resource allocation order and avoid competition conflicts.
[0192] S8.5: The hierarchical loading instruction sequence generated by S8.4 is passed to the module loading execution engine, triggering a new round of resource reservation, dynamic loading and status update processes defined by S5 to S7, thereby forming a closed-loop control loop with resource status snapshots as feedback input and loading decisions as output, improving the system's adaptive capability under frequent state changes.
[0193] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0194] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0195] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for dynamically configuring functional modules of a data acquisition gateway, specifically including: S1: Perform static analysis on all loadable functional modules in the acquisition gateway, extract the resource types and peak usage required by each module during the loading process, and generate a module resource requirement profile. S2: Construct a view of equipment resource supply capacity based on real-time equipment operating status data; S3: A resource contention prediction model is jointly constructed by combining logistic regression algorithm and gradient boosting tree ensemble algorithm and trained and converged based on historical loading logs. The resource demand profile of the module and the resource supply capacity view of the equipment are input into the resource contention prediction model to determine whether there is a risk of specific resource overload when multiple modules are loaded concurrently, and a resource conflict early warning signal is generated. S4: Based on the resource conflict warning signal, a resource scheduling strategy is initiated, in which high-priority business modules are given priority in resource allocation, and the loading operations of low-priority modules are marked as delayed execution or phased injection, forming a hierarchical loading instruction sequence. S5: Based on the hierarchical loading instruction sequence, dynamically create a resource reservation pool before the module is loaded, temporarily lock the memory space, CPU time slice and I / O channel required by the module to be loaded, and generate a resource reservation status record; S6: Based on the resource pre-occupancy status record, trigger the dynamic loading process of functional modules in priority order to ensure that high-priority modules complete loading under resource guarantee conditions and generate a module loading completion confirmation signal; S7: Automatically release locked resources in the resource reservation pool after loading is complete.
2. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 1, characterized in that, Step S7 also includes automatically releasing locked resources in the resource reservation pool and updating the device resource supply capacity view to form the latest resource status snapshot.
3. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 1, characterized in that, Step S7 is followed by: S8: It asynchronously processes subsequent loading requests through an event-driven architecture, and uses the updated resource state snapshot as the input condition for the next round of resource coordination to achieve closed-loop resource management in the module loading process.
4. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 1, characterized in that, The real-time operating status data of the device in step S2 includes available memory capacity, CPU load rate, network bandwidth utilization rate, and task queue length.
5. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 1, characterized in that, The module resource requirement profile generated in step S1 is a queryable and updatable module resource requirement profile library.
6. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 1, characterized in that, Step S3 specifically includes: Based on the resource demand profile and the device resource supply capacity view, the resource types and peak usage of each module to be loaded are extracted as input feature vectors to form a module-level resource demand feature matrix; at the same time, the current available memory capacity, CPU load rate, network bandwidth utilization rate and task queue length are obtained to construct a device resource supply status feature vector. The module resource demand feature matrix and the equipment resource supply status feature vector are normalized to output a standardized resource supply and demand matching degree feature tensor. A resource contention label dataset is constructed based on historical loading logs. A resource contention prediction model is jointly constructed by combining logistic regression and gradient boosting tree ensemble algorithms and trained and converged based on historical loading logs. The standardized resource supply and demand matching feature tensor is input into the trained resource contention prediction model, and forward inference calculation is performed to obtain the resource over-limit probability score under the current multi-module concurrent loading requests. The score is binarized according to a preset threshold. If the score is higher than the threshold, a Boolean flag indicating resource contention risk is generated, which serves as the core content of the resource conflict early warning signal. The generated resource conflict warning signals are encapsulated into structured event messages and published to the operation control module through the internal message bus.
7. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 6, characterized in that, The preset threshold is 0.
65.
8. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 6, characterized in that, The structured event message includes the warning level, the type of resource involved, a list of high-risk module IDs, and a suggested response action field.
9. The method for dynamic configuration of functional modules for a data acquisition gateway according to claim 1, characterized in that, Step S5 specifically includes: Based on the module resource requirement profile of each functional module to be loaded in the hierarchical loading instruction sequence, the set of resource types required by it in the loading stage is extracted to form a module-level resource request list. Based on the total amount of available resources in the equipment resource supply capacity view, and combined with the module-level resource request list, calculate the comprehensive resource window required for the resource reservation pool, and generate a resource occupancy time sequence planning table. The resource allocation timing planning table drives the dynamic memory allocator to perform reservation operations and performs page table locking on the physical memory region; at the same time, the real-time scheduler reserves CPU time slice quotas and registers exclusive channel access permissions with the I / O management unit to generate resource reservation control policies. The resource pre-emption control policy is injected into the resource management module of the operating system kernel layer of the acquisition gateway, triggering the kernel to execute the resource isolation mechanism, causing the declared resources to enter a non-preemptive state, and generating a resource pre-emption state record. The resource pre-occupancy status is recorded and written to the module loading transaction log, and synchronously updated to the runtime context of the configuration management module, serving as the access credential for subsequent loading processes.
10. A dynamic configuration system for functional modules of a data acquisition gateway, characterized in that, The dynamic configuration method for the functional modules of the data acquisition gateway as described in any one of claims 1-9 is used to dynamically configure the loading of the functional modules of the data acquisition gateway.