An end-cloud collaborative air monitoring lightweight model inference method

By using an edge-cloud collaborative approach, hardware configuration data of edge devices is acquired and a multi-dimensional constraint framework is built in the cloud to generate an adapted lightweight model. This solves the problem of low model deployment efficiency on edge devices and enables efficient and stable air quality monitoring.

CN122154925APending Publication Date: 2026-06-05盐城市生态环境监测监控中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610262147.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing intelligent air monitoring models, when running on edge devices, struggle to balance computational complexity, resource consumption, and energy requirements, resulting in low deployment efficiency and complex management. Furthermore, hardware differences between different devices lead to inconsistent model performance.

Method used

By using an edge-cloud collaborative approach, hardware configuration data of edge devices is obtained, a multi-dimensional hardware constraint framework is constructed, model compression strategies are searched and filtered in the cloud, an adapted lightweight model is generated, and the model is loaded and inferred on the edge device to ensure that the model runs efficiently within resource constraints.

Benefits of technology

It enables the automatic generation of adapted models based on different device hardware conditions, reduces reliance on manual parameter tuning, improves the operating efficiency and stability of the model on edge devices, and enhances the real-time analysis capabilities of the air quality monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154925A_ABST
    Figure CN122154925A_ABST
Patent Text Reader

Abstract

The application discloses an air monitoring lightweight model inference method based on end-cloud cooperation, relates to the technical field of air quality monitoring and artificial intelligence, and comprises the following steps: obtaining hardware configuration data of a target edge monitoring device, collecting in detail processor load boundaries, memory occupation thresholds and energy consumption budget limits, determining specific numerical ranges of hardware time delay upper limits and storage access frequencies through analysis and real-time monitoring of device operation logs, and uploading the hardware configuration data to a cloud-end cooperative processing platform. The air monitoring lightweight model inference method based on end-cloud cooperation can effectively reduce model calculation costs and resource occupation while ensuring monitoring accuracy, improve the operation efficiency and stability of the model on the edge monitoring device, and further improve the real-time analysis capability and overall operation efficiency of the air quality monitoring system in complex application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of air quality monitoring and artificial intelligence technology, specifically to a lightweight inference method for air monitoring models that integrates edge and cloud computing. Background Technology

[0002] With the accelerating pace of urbanization and increasing public concern about environmental quality, air quality monitoring technology is gradually evolving from traditional fixed monitoring stations to high-density, distributed, and intelligent systems. In practical applications, numerous air monitoring devices are deployed in various scenarios, including urban roads, streetlights, industrial parks, and mobile monitoring platforms, to dynamically monitor and assess ambient air quality by collecting real-time data on pollutant concentrations. To further enhance the intelligence of monitoring systems, an increasing number of air monitoring systems are incorporating artificial intelligence models to automatically analyze the collected data, thereby identifying pollution sources and predicting air quality trends.

[0003] However, most existing intelligent air quality monitoring models are designed and trained on high-performance server environments. Their models are typically complex, with large parameter scales, placing high demands on computing power, storage space, and energy consumption. In practical applications, most air quality monitoring devices are edge devices, usually employing low-power processors and limited by small memory capacity and limited energy supply. In this context, server-level air quality monitoring models are difficult to deploy directly on edge devices, thus limiting the application scope of intelligent monitoring technology in real-world environments. To address these issues, existing technologies typically lightweight air quality monitoring models through model compression, pruning, or quantization to reduce computational complexity and resource consumption during operation, enabling them to perform inference tasks on edge devices. However, in actual deployment, different air quality monitoring devices exhibit significant differences in hardware performance. For example, different devices vary considerably in processor performance, memory capacity, storage access speed, and energy consumption limits, leading to significant differences in the performance of the same lightweight model on different devices. If the model compression process does not fully consider the hardware constraints of the target device, it may result in high inference latency, excessive resource consumption, or instability on some devices. Furthermore, in practical applications of air monitoring systems, air quality data typically requires continuous collection and real-time analysis, placing high demands on both model inference efficiency and resource utilization efficiency. Existing technologies for lightweighting models often rely on manual experience to repeatedly adjust model compression strategies to achieve a balance between model accuracy and resource consumption. However, this process usually requires multiple trials and manual parameter tuning, which is not only inefficient but also makes it difficult to quickly obtain adapted models for the hardware conditions of different edge devices. On the other hand, in real-world applications, air monitoring devices are usually numerous and widely distributed. If each device independently completes model optimization and deployment, it will not only increase the overall computational burden of the system but also complicate the model management and update process. Summary of the Invention

[0004] The purpose of this invention is to provide a lightweight inference method for edge-cloud collaborative air monitoring models, thereby solving the problems existing in the prior art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a lightweight model inference method for edge-cloud collaborative air monitoring, comprising: S1, acquiring hardware configuration data of the target edge monitoring device, collecting detailed data on processor load boundaries, memory usage thresholds, and energy consumption budget limitations, determining the specific numerical ranges of hardware latency upper limits and storage access frequency through parsing and real-time monitoring of device operation logs, and uploading the hardware configuration data to a cloud-based collaborative processing platform; S2, in the cloud-based collaborative processing platform, constructing a multi-dimensional hardware constraint framework based on the hardware latency upper limit and memory usage threshold, integrating heat dissipation performance constraints and task priority allocation constraints, and obtaining a set of boundary conditions for the device's resource usage through analysis of hardware compatibility requirements; S3, in the cloud-based collaborative processing platform, acquiring... Using a pre-trained air quality monitoring benchmark model as initial input, a preliminary analysis is conducted on its network layer simplification mode and parameter sparsity. By analyzing the hierarchical structure of the model, its adaptability under hardware constraints is determined, and the initial compression requirement range is identified. S4: Based on the initial compression requirement range, a search is initiated among preset compression strategy combinations, incorporating pruning rate adjustment range and quantization bit count options. By applying the pruning rules of the computational units layer by layer, a set of candidate model compression schemes is obtained. S5: For each candidate model compression scheme, its performance under hardware latency limits and storage access frequency is estimated on a cloud-based collaborative processing platform. If the estimated result exceeds the processor load boundary in the hardware constraint framework, the scheme is eliminated. By comparing each scheme individually, a set of compression schemes that meet resource constraints is determined.

[0006] Preferably, step S1 includes acquiring the original hardware configuration data of the target edge monitoring device, which includes processor load boundaries, memory usage thresholds, and energy consumption budget limits; parsing the device operation logs based on the energy consumption budget limits in the original hardware configuration data to determine the upper limit of hardware latency; dynamically mapping the processor load boundaries using the upper limit of hardware latency and determining the specific numerical range of storage access frequency in conjunction with the memory usage threshold; performing feature annotation on the original hardware configuration data using the specific numerical range of storage access frequency to obtain enhanced hardware configuration data; and uploading the enhanced hardware configuration data to a cloud-based collaborative processing platform to achieve hardware configuration data acquisition and cloud-based collaborative processing.

[0007] Preferably, step S2 includes obtaining the hardware latency upper limit and memory usage threshold from the cloud-based collaborative processing platform; performing multi-dimensional mapping processing on the hardware latency upper limit and memory usage threshold by integrating heat dissipation performance constraints to obtain an initial constraint framework structure; dynamically adjusting the constraint structure based on task priority allocation conditions to determine the basic dataset for analyzing hardware compatibility requirements; quantitatively evaluating the hardware compatibility requirements by analyzing the basic dataset; if the evaluation result exceeds a preset threshold, integrating and fusing the constraints to obtain an intermediate value of resource usage boundaries; obtaining relevant indicators of the device resource set for the intermediate value of resource usage boundaries, forming a set of boundary conditions through iterative optimization of the multi-dimensional constraint framework; and verifying the compatibility of the data uploaded by the cloud processing platform based on the set of boundary conditions to obtain a set of boundary conditions for quantifying the device's resource usage.

[0008] Preferably, step S3 includes obtaining a pre-trained air quality monitoring benchmark model from a cloud-based collaborative processing platform; performing a preliminary analysis of the model's network layer simplification mode and parameter sparsity; processing the model structure using hierarchical parsing technology to determine its adaptability under hardware constraints, thereby obtaining a preliminary assessment dataset for compressing the demand range; fusing the network layer simplification mode of the air quality monitoring benchmark model with the assessment dataset, performing multi-dimensional quantification of the parameter sparsity, and determining the hierarchical parsing adjustment value of the model structure through compatibility mapping of the hardware constraints; comparing the hierarchical parsing adjustment value with a preset adaptability threshold; if the comparison result exceeds the threshold, iteratively optimizing the network layer simplification mode to fuse the parameter sparsity, thereby obtaining an intermediate index set for compressing the demand range; performing adaptability verification on the pre-trained air quality monitoring benchmark model based on the intermediate index set, and determining the preliminary compression demand range through comprehensive processing of the network layer simplification mode and the parameter sparsity.

[0009] Preferably, step S4 includes extracting the hierarchical topology of the air quality monitoring benchmark model from the initial compression demand range; retrieving operator distribution features matching the hierarchical topology from a preset compression strategy combination to determine the pruning rate adjustment range; performing sparse mapping on the weight tensor of the air quality monitoring benchmark model according to the pruning rate adjustment range to obtain the quantization bit number option; obtaining the quantized weight distribution matrix by discretizing the numerical distribution of the weight tensor; applying a computational unit pruning rule to the quantized weight distribution matrix; if the computational unit pruning rule conflicts with the convolution kernel size of the air quality monitoring benchmark model, determining the pruned neuron connection mapping table by adjusting the stride parameter of the convolution kernel; reorganizing the structure of each layer of the air quality monitoring benchmark model using the pruned neuron connection mapping table; and obtaining a set of candidate model compression schemes by performing bit width alignment processing on the reorganized network layers.

[0010] Preferably, step S5 includes mapping the configuration information in the candidate compression scheme set to the virtual simulation environment of the cloud collaborative processing platform, obtaining the hardware latency estimate corresponding to the configuration information; comparing the hardware latency estimate with the hardware latency upper limit, and if the hardware latency estimate is less than the hardware latency upper limit, extracting the memory address mapping sequence corresponding to the configuration information; determining the storage access frequency based on the memory address mapping sequence, and matching the storage access frequency with the bandwidth threshold to obtain the storage pressure assessment result; converting the storage pressure assessment result into a processor load prediction vector, and if the processor load prediction vector is within the processor load boundary, determining the compression scheme set that meets the resource constraints.

[0011] Preferably, the method further includes S6: generating corresponding simplified models one by one from the set of compression schemes that meet resource constraints; conducting calibration data tests on the accuracy loss and inference speed improvement after compression; and obtaining performance data of each simplified model in the contamination identification task. Specifically, this includes extracting configuration parameters from the set of compression schemes that meet resource constraints, generating a sequence of simplified models on a cloud-based collaborative processing platform, and obtaining a structural simplification index for each model in the simplified model sequence; calculating the accuracy loss based on the structural simplification index and obtaining a comparison result of the deviation between the accuracy loss value and the original model; using the deviation comparison result to drive an evaluation mechanism for the improvement in inference speed and determining the time-saving vector corresponding to the improvement in inference speed; constructing a performance data matrix for each simplified model through a joint mapping of the time-saving vector and the accuracy loss value; if the elements in the performance data matrix exceed a preset contamination identification threshold, triggering a data calibration iteration to adjust the internal correlation of the performance data matrix; and summarizing the performance data of each simplified model in the contamination identification task based on the adjusted performance data matrix.

[0012] Preferably, the process also includes S7: Based on the performance data of each simplified model and its compliance with memory usage thresholds and energy consumption budget limits, a final deployment version that balances accuracy and resource consumption is determined in the cloud collaborative processing platform through a weighted sorting mechanism. Specifically, this includes obtaining the performance data matrix of each simplified model; extracting the corresponding accuracy feature vector and resource consumption feature from the performance data matrix; performing hardware mapping analysis based on the resource consumption feature to obtain the memory usage value and energy consumption budget value corresponding to each simplified model; if the memory usage value does not exceed the preset memory usage threshold and the energy consumption budget value does not exceed the preset energy consumption budget limit, then the corresponding accuracy feature vector is input into the pre-established weighted sorting mechanism to obtain an initial sorting sequence; calculating the balance between accuracy and resource consumption for the elements in the initial sorting sequence to obtain a balance score set; and using the balance score set to match the highest score in the cloud collaborative processing platform to determine a final deployment version that balances accuracy and resource consumption.

[0013] Preferably, the process also includes S8, which involves sending the final deployment version to the target edge monitoring device, and adapting and loading the model on the target edge monitoring device through format conversion and instruction optimization based on hardware compatibility requirements and task priority allocation rules. The final deployment version is then used to perform pollution identification and inference on the collected air monitoring data to generate air quality monitoring results. Specifically, this includes obtaining the hardware architecture description file, parsing the hardware architecture description file to obtain the initial operator graph, and converting the format of the initial operator graph that does not meet compatibility requirements to obtain the target operator graph.

[0014] Preferably, step S8 further includes optimizing and rearranging the target operator graph to determine the appropriate instruction sequence; loading the edge inference model using the appropriate instruction sequence; using the edge inference model to infer the air monitoring data; and generating the air quality monitoring results of the air monitoring data.

[0015] As can be seen from the above technical solution, the present invention has the following beneficial effects: This edge-cloud collaborative lightweight air monitoring model inference method acquires the hardware configuration data of the target edge monitoring device and constructs a multi-dimensional hardware constraint framework in the cloud collaborative processing platform. It performs compression requirement analysis, compression strategy search, and candidate model screening on the air quality monitoring benchmark model. Under the conditions of meeting processor load boundaries, memory usage thresholds, and energy consumption budget constraints, multiple simplified models are generated. The final deployment version is determined through calibration testing and a weighted sorting mechanism. Subsequently, the model is distributed to the target edge monitoring device for adaptation loading and execution of pollution identification inference based on air monitoring data. This achieves collaborative processing between cloud model optimization and edge device inference execution. It not only automatically generates adapted models based on the hardware constraints of different devices, reducing reliance on manual parameter tuning during model deployment, but also effectively reduces model computational overhead and resource consumption while ensuring monitoring accuracy. This improves the model's operating efficiency and stability on edge monitoring devices, thereby enhancing the real-time analysis capabilities and overall operating efficiency of the air quality monitoring system in complex application scenarios. Attached Figure Description

[0016] Figure 1 This is a flowchart of the inference method for the lightweight air monitoring model of the present invention. Detailed Implementation

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

[0018] like Figure 1 As shown, this invention provides a technical solution: a lightweight inference method for edge-cloud collaborative air monitoring models, comprising: S1. Obtain the hardware configuration data of the target edge monitoring device, collect detailed data on processor load boundaries, memory usage thresholds and energy consumption budget limits, determine the specific numerical range of hardware latency upper limit and storage access frequency by parsing the device operation logs and real-time monitoring, and upload the hardware configuration data to the cloud collaborative processing platform. S2. In the cloud-based collaborative processing platform, a multi-dimensional hardware constraint framework is constructed based on the hardware latency limit and memory usage threshold. This framework integrates heat dissipation performance constraints and task priority allocation limitations. Through analysis of hardware compatibility requirements, a set of boundary conditions for the resource usage of the quantified device is obtained. S3. In the cloud-based collaborative processing platform, a pre-trained air quality monitoring benchmark model is used as the initial input. A preliminary analysis is conducted on its network layer simplification mode and parameter sparsity. By analyzing the hierarchical structure of the model, its adaptability under hardware constraints is determined, and the preliminary compression requirement range is identified. S4. Based on the initial compression requirement range, start the search in the preset compression strategy combination mode, integrate the pruning rate adjustment range and quantization bit number option, and obtain a set of candidate model compression schemes by applying the operation unit pruning rules layer by layer. S5. For each candidate model compression scheme, estimate its performance under the hardware latency limit and storage access frequency in the cloud collaborative processing platform. If the estimation result exceeds the processor load boundary in the hardware constraint framework, the scheme is eliminated. By comparing them one by one, determine the set of compression schemes that meet the resource constraints. S6. By generating corresponding simplified models one by one from the set of compression schemes that meet resource constraints, calibration data tests are conducted on the accuracy loss and inference speed improvement after compression to obtain the performance data of each simplified model in the contamination identification task. S7. Based on the performance data of each simplified model and its compliance with memory usage thresholds and energy consumption budgets, a final deployment version that balances accuracy and resource consumption is determined in the cloud collaborative processing platform through a weighted sorting mechanism. S8. The final deployment version is sent to the target edge monitoring device. Based on the hardware compatibility requirements and task priority allocation rules, the model is adapted and loaded on the target edge monitoring device through format conversion and instruction optimization. The final deployment version is used to perform pollution identification and inference on the collected air monitoring data to generate air quality monitoring results.

[0019] In air quality monitoring systems, edge monitoring devices are typically deployed on urban roads, in industrial parks, or at environmental monitoring stations. Their hardware resources are limited, including processor computing power, memory capacity, and power consumption constraints. Therefore, this implementation first obtains the hardware configuration data of the target edge monitoring device through step S1. Combined with device operation log analysis and real-time monitoring, it determines the processor load boundary, memory usage threshold, energy consumption budget limit, and hardware latency upper limit of the device under actual operating conditions. By statistically analyzing storage access frequency, the storage bandwidth requirements during model runtime can be further determined, thereby forming a complete hardware resource description and uploading it to the cloud-based collaborative processing platform.

[0020] In step S2, the cloud-based collaborative processing platform constructs a multi-dimensional hardware constraint framework based on the acquired hardware parameters. This framework not only includes limitations on computing and storage resources but also integrates thermal performance constraints and task priority allocation rules. For example, when an edge device simultaneously performs environmental monitoring and communication tasks, processor resources need to be allocated according to task priorities. By uniformly modeling these constraints, a set of quantified resource boundary conditions can be obtained, providing a basis for subsequent model compression strategy searches.

[0021] In step S3, the cloud platform introduces a pre-trained air quality monitoring benchmark model. This model can be a convolutional neural network model, a lightweight visual network, or a multimodal environmental monitoring model, used to identify air pollution types or air quality levels. By performing hierarchical analysis of the model structure, including the network layer structure, the number of convolutional kernels, parameter scale, and sparsity, the model's adaptability under the current hardware constraints is determined, and the potential model compression ratio is calculated.

[0022] In step S4, based on the obtained compression requirement range, the system searches within a preset compression strategy combination space. Compression strategies include, but are not limited to, network pruning, weight quantization, and structural pruning. By setting the pruning rate adjustment range and quantization bit count options, pruning rules are applied layer by layer to the model's computational units, such as reducing the number of channels in convolutional layers or lowering the precision of weight representation, thereby generating multiple candidate model compression schemes.

[0023] In step S5, the cloud-based collaborative processing platform performs performance prediction for each set of candidate model compression schemes. The prediction process calculates the computational complexity, memory access requirements, and processor load during model inference to predict the model's performance on the target edge device. If a candidate scheme might exceed processor load limits or storage access restrictions during inference, that scheme is eliminated. After screening, a set of compression schemes that meet the hardware constraints is obtained.

[0024] In step S6, corresponding simplified models are generated one by one according to the selected set of compression schemes, and calibration tests are performed using an air pollution identification dataset. The tests include changes in accuracy and improvements in inference speed after model compression. Through experimental evaluation of the pollution identification task, performance data for each simplified model in air quality classification or pollution source identification tasks can be obtained.

[0025] In step S7, the cloud platform performs a comprehensive evaluation based on the performance data of each streamlined model. The evaluation considers model recognition accuracy, inference speed, memory usage, and energy budget constraints. A weighted ranking mechanism is used to comprehensively score each indicator, thereby determining a final deployment version that achieves a balance between model accuracy and resource consumption.

[0026] In step S8, the final deployment version of the model is distributed to the target edge monitoring device. To ensure the model can run efficiently on the device, the model format needs to be converted according to the device's processor architecture and hardware compatibility requirements, for example, converting it to a model format suitable for the edge device's inference framework. Simultaneously, the inference computation process is accelerated through instruction optimization, such as using vectorized computation or hardware-accelerated instructions, thereby completing the model loading and deployment. After deployment, the edge monitoring device can use the model to perform pollution identification inference on the collected air monitoring data and generate air quality monitoring results.

[0027] S1 includes acquiring the raw hardware configuration data of the target edge monitoring device, which includes processor load boundaries, memory usage thresholds, and energy consumption budget limits; parsing the device operation logs based on the energy consumption budget limits in the raw hardware configuration data to determine the hardware latency upper limit; dynamically mapping the processor load boundaries using the hardware latency upper limit and determining the specific numerical range of storage access frequency in conjunction with the memory usage threshold; performing feature annotation on the raw hardware configuration data using the specific numerical range of storage access frequency to obtain enhanced hardware configuration data; and uploading the enhanced hardware configuration data to the cloud collaborative processing platform to realize hardware configuration data acquisition and cloud collaborative processing.

[0028] In the above implementation, the hardware acquisition process is first initiated on the target edge monitoring device side to form raw hardware configuration data. The raw hardware configuration data includes a processor load boundary, which refers to the highest allowed utilization rate of the processor under continuous operation. Its determination process is as follows: during a period of continuous, alarm-free operation of the device, the processor utilization rate is collected at a sampling period of 1 second. Simultaneously, the thermal management status flag is read to remove sampling points that trigger frequency reduction. The remaining sampling points are sorted by utilization rate from smallest to largest, and the utilization rate at the end of the sorted list is taken as the processor load boundary, thus making this boundary correspond to the upper limit of the actual continuously operating processor load. The raw hardware configuration data also includes a memory utilization threshold, which refers to the maximum memory capacity allowed for inference tasks. Its determination process is as follows: the total physical memory of the device is read, and a memory utilization curve is collected when the device is only running basic system services and not executing inference tasks. The peak value of this curve is taken as the system reserved memory, and then the system reserved memory is subtracted from the total physical memory. The available memory limit for the inference task is stored, and this available memory limit is set as the memory usage threshold, so that the threshold directly corresponds to the allocatable memory space of the device in actual operation. The original hardware configuration data also includes energy consumption budget limits, which refer to the maximum amount of energy that can be consumed per unit time. The determination process is as follows: read the continuous power supply limit given by the power management module, read the continuous heat dissipation limit given by the thermal management module, select the lower power limit of the two as the device's sustainable power consumption limit, and then convert the sustainable power consumption limit into the energy amount per unit time as the energy consumption budget limit, so that the energy consumption constraint simultaneously satisfies the power supply capacity and heat dissipation capacity.

[0029] After obtaining the energy consumption budget limit, the device operation log is analyzed to determine the hardware latency limit. The hardware latency limit refers to the longest execution time allowed for a single inference task under the premise of meeting the energy consumption budget limit. The determination process is as follows: extract the time interval between two adjacent inference triggers from the task scheduling record, and calculate the allowable energy consumption within the time interval based on the energy quota per unit time; then extract the start time and end time of each inference from the inference operation log, calculate the execution time of the inference, and simultaneously extract the power consumption sequence during the inference from the sampling record of the power consumption metering module. Calculate the arithmetic mean of the power consumption sequence with a sampling period of 100 milliseconds to obtain the average power consumption of the inference; multiply the average power consumption of the inference by the execution time of the inference to obtain the energy consumption of the inference; compare the energy consumption of the inference with the allowable energy consumption within the time interval, and retain the inference records that do not exceed the allowable quota; sort the execution times of the retained inference records in ascending order, and take the execution time at the end of the sort as the hardware latency limit. Thus, the inference latency control limit that can be maintained for a long time under energy consumption constraints is obtained.

[0030] After determining the hardware latency limit, the processor load boundary is dynamically mapped, and the specific numerical range of the storage access frequency is determined in conjunction with the memory usage threshold. Dynamic mapping refers to segmenting the processor load boundary based on changes in inference execution time. The process is as follows: The average processor usage ratio and execution time during each inference period are extracted synchronously from the aforementioned retained inference records, and the execution times are sorted from smallest to largest. The hardware latency limit is divided by 3 to obtain the interval length, forming three execution time intervals. Within each execution time interval, the lowest value of the sorted average processor usage ratio corresponding to the inference record in that interval is taken as the mapped processor load boundary for that interval, thus obtaining three sets of processor load boundaries corresponding to the execution time. When it is necessary to evaluate the resource usage of a certain inference task, the execution time interval it falls into is first determined based on the predicted execution time, and then the processor load boundary corresponding to that interval is used for constraint, so that the processor load limit tightens synchronously with changes in inference time. The specific numerical range of storage access frequency refers to the range of values ​​for the sum of memory reads and memory stores occurring per unit time. The determination process is as follows: During the retention of inference records, a hardware performance counter is used to collect the number of memory reads and memory stores, which are then summed to obtain the total number of accesses for a single inference iteration. The total number of accesses is then divided by the execution time of that inference iteration to obtain the storage access frequency for that iteration. Simultaneously, the peak memory usage during that inference iteration is collected, and the peak memory usage is compared with a memory usage threshold. Inference records with peak memory usage not exceeding the memory usage threshold are retained. The storage access frequencies of the retained records are sorted from smallest to largest. The starting value of the sort is taken as the lower bound of the storage access frequency, and the ending value is taken as the upper bound of the storage access frequency. This forms the specific numerical range of the storage access frequency, ensuring that this range simultaneously satisfies memory capacity constraints and actual access bandwidth capabilities.

[0031] After obtaining the mapping results of the processor load boundary and the memory access frequency range, the original hardware configuration data is characterized to obtain enhanced hardware configuration data. Enhanced hardware configuration data refers to a set of hardware features with semantic identifiers for runtime constraints. The process is as follows: the processor load boundary is labeled as the upper limit of computing resources and the upper limit of latency-related computing, respectively, based on the original boundary and the mapped boundary; the memory usage threshold is labeled as the upper limit of storage capacity; the energy consumption budget limit is labeled as the upper limit of energy consumption; the hardware latency upper limit is labeled as the upper limit of inference latency; and the memory access frequency range is labeled as the storage access bandwidth constraint range. Subsequently, the labeled parameters are organized into structured data items in the order of device identifier, collection timestamp, computing resource characteristics, storage resource characteristics, and energy consumption constraint characteristics. Each parameter has a clear name, unit, value source, and constraint meaning, enabling the cloud platform to directly use it for constraint modeling and strategy selection.

[0032] After completing the construction of enhanced hardware configuration data, an upload operation is performed to achieve hardware configuration data acquisition and cloud-based collaborative processing. The process is as follows: the device communication module establishes a secure transmission channel with the cloud-based collaborative processing platform; the enhanced hardware configuration data is serialized and encapsulated according to the field order of structured data items, and device identifiers and data integrity verification values ​​are attached; subsequently, the encapsulated data is sent to the cloud platform's receiving interface in the sending queue order. After verification, the cloud platform archives the enhanced hardware configuration data to the device resource database and generates a resource constraint index entry for the device, enabling the subsequent model compression scheme evaluation stage to directly call this index entry to complete the loading of device-side resource boundary constraints.

[0033] S2 includes obtaining the hardware latency upper limit and memory usage threshold from the cloud-based collaborative processing platform; performing multi-dimensional mapping processing on the hardware latency upper limit and memory usage threshold by integrating thermal performance constraints to obtain the initial constraint framework structure; dynamically adjusting the constraint conditions based on task priority allocation according to the initial constraint framework structure to determine the basic dataset for hardware compatibility requirements analysis; quantitatively evaluating the hardware compatibility requirements by analyzing the basic dataset; if the evaluation result exceeds the preset threshold, integrating and fusing the constraints to obtain the intermediate value of resource usage boundaries; obtaining relevant indicators of the device resource set for the intermediate value of resource usage boundaries; forming a boundary condition set through iterative optimization of the multi-dimensional constraint framework; and verifying the compatibility of the data uploaded by the cloud processing platform based on the boundary condition set to obtain a quantitative set of boundary conditions for device resource usage.

[0034] In one specific implementation, the cloud-based collaborative processing platform first retrieves the hardware latency limit corresponding to the target device. The hardware latency limit refers to the maximum execution time allowed for a single inference process under the premise of meeting energy consumption budget constraints and thermal management strategy constraints. The determination process is as follows: extract the start and end times of each inference from the inference run records reported by the device, and calculate the execution time of each inference record one by one; simultaneously extract the power consumption sampling sequence of the same time period, calculate the average power consumption during the inference period according to the sampling period, and multiply the average power consumption by the execution time to obtain the energy consumption of the inference; then compare the energy consumption of the inference with the energy budget within the inference trigger interval, and retain the inference records whose energy consumption does not exceed the budget; sort the execution times of the retained records from smallest to largest, and take the execution time at the end of the sort as the hardware latency limit. The cloud-based collaborative processing platform simultaneously retrieves the memory usage threshold, which refers to the maximum memory capacity allowed for the inference process. The determination process is as follows: read the total physical memory of the device, collect the peak memory usage when the device is only running basic system services as the system reserved memory, subtract the system reserved memory from the total physical memory to obtain the upper limit of the memory available for inference, and use this upper limit as the memory usage threshold.

[0035] After obtaining the hardware latency limit and memory usage threshold, the cloud-based collaborative processing platform introduces heat dissipation performance constraints and performs multi-dimensional mapping processing to generate an initial constraint framework structure. The heat dissipation performance constraints consist of an upper temperature limit, a frequency reduction trigger temperature, fan speed status, and a chassis temperature rise rate. The upper temperature limit and the frequency reduction trigger temperature are determined by data reported by the device's thermal management strategy, the fan speed status is determined by data reported by the fan control module, and the chassis temperature rise rate is determined by a temperature sensor sequence. Specifically, a statistical window of 10 consecutive seconds is used, the difference between the initial temperature and the final temperature of the window is taken as the temperature change, and the temperature change is divided by the window duration to obtain the temperature rise rate. The implementation process of multidimensional mapping is as follows: each time the temperature sequence of the receiving device is received, the current temperature is taken and the temperature upper limit is subtracted from the current temperature to obtain the temperature difference margin; the temperature difference margin and the temperature rise rate are used as the basis for judging the heat dissipation state, and the heat dissipation state is divided into 3 interval identifiers. The interval boundary is jointly determined by the minimum temperature difference margin and the maximum temperature rise rate in the historical stable operation segment; a delay tightening coefficient and a memory tightening coefficient are generated for each interval identifier. The value of the coefficient is obtained by back-calculation through the frequency reduction trigger record of the historical stable operation segment. Specifically, the combination range of temperature difference margin and temperature rise rate in the operation segment where no frequency reduction trigger occurs is counted, and the coefficient corresponding to the range is set to 1; when the temperature difference margin decreases or the temperature rise rate increases, the coefficient is gradually reduced according to the interval boundary; then the hardware delay upper limit is multiplied by the delay tightening coefficient to obtain the mapped delay upper limit, and the memory occupancy threshold is multiplied by the memory tightening coefficient to obtain the mapped memory upper limit, thereby forming an initial constraint framework structure that includes the computational dimension, storage dimension and thermal constraint dimension.

[0036] After the initial constraint framework structure is generated, the cloud-based collaborative processing platform introduces constraints for task priority allocation and performs dynamic adjustments to form a basic dataset for analysis based on hardware compatibility requirements. The constraints for task priority allocation are determined by the data reported by the device scheduling policy, including the task priority sequence, scheduling cycle length, time slice quota for each task, and preemption rules. Within a scheduling cycle, the cloud-based collaborative processing platform calculates the upper limit of processor usage and the peak memory usage of high-priority tasks. The upper limit of processor usage is obtained by sorting the processor usage ratios within that cycle and taking the lowest value, while the peak memory usage is obtained by taking the maximum value from the memory usage sequence within that cycle. Then, the upper limit of processor usage for high-priority tasks is subtracted from the mapped upper limit of processor load to obtain the upper limit of available processor load for inference tasks. The upper limit of available memory for inference tasks is then subtracted from the peak memory usage of high-priority tasks to obtain the upper limit of available memory for inference tasks. Finally, the available boundaries of inference tasks, along with device instruction set characteristics, operator support lists, memory alignment constraints, and acceleration unit availability status, are organized into structured entries to form the basic dataset for analysis. The instruction set characteristics and acceleration unit availability status are determined by the data reported by the device capability description, the operator support list is determined by the data reported by the device inference runtime support list, and the memory alignment constraints are determined by the data reported by the device memory allocator configuration.

[0037] Based on the analysis of the basic dataset, the cloud-based collaborative processing platform conducts a quantitative assessment of hardware compatibility requirements. The quantitative assessment process is as follows: The list of operators required for the model inference chain is compared item by item with the device's supported operator list; the number of mismatches is counted and compared with the total number of operators to obtain the operator mismatch ratio; the model deployment format requirements are compared item by item with the device instruction set characteristics; the number of non-compliant items is counted and compared with the total number of compared items to obtain the instruction mismatch ratio; the memory layout required for model operation is compared item by item with the device's memory alignment constraints; the number of conflicting items is counted and compared with the total number of compared items to obtain the layout conflict ratio; the inference task prediction processor load is subtracted from the inference task's available processor load limit to obtain the load excess, and the ratio of positive load excess counts to the total number of assessments is used as the scheduling conflict risk ratio; the peak memory usage of the inference task prediction is subtracted from the inference task's available memory limit to obtain the memory excess, and the ratio of positive memory excess counts to the total number of assessments is used as the memory out-of-bounds risk ratio; the above ratios are weighted and summed according to pre-set weights to obtain the compatibility risk value. The preset threshold refers to the upper limit of the compatibility risk value allowed. Its determination process is as follows: Select the running records of the same model device in historical stable deployment versions, extract the compatibility risk values ​​of these versions, and filter out records with frequency reduction alarms, memory reclamation alarms, and task backlog alarms. Set the maximum value among the filtered risk values ​​as the preset threshold, so that the threshold corresponds to the alarm-free running boundary. When the compatibility risk value exceeds the preset threshold, the cloud collaborative processing platform integrates thermal constraints, scheduling restrictions, and storage constraints to form an intermediate value for resource usage boundaries. The calculation process for the intermediate value is as follows: The intermediate latency upper limit is obtained by further tightening the mapping of the latency upper limit using the latency tightening coefficient corresponding to the heat dissipation state interval identifier; the intermediate memory upper limit is obtained by multiplying the available memory upper limit of the inference task by the scheduling compression coefficient using the peak usage of high-priority tasks as the scheduling compression coefficient; and the intermediate memory upper limit is obtained by multiplying the available memory upper limit of the inference task by the scheduling compression coefficient using the difference between the storage bandwidth index reported by the device and the peak storage access in the past hour as the bandwidth margin. The bandwidth margin is converted into the number of accesses allowed per unit time and used as the intermediate storage access upper limit, thus obtaining the intermediate boundary parameter set for subsequent convergence.

[0038] After obtaining the intermediate values ​​of resource usage boundaries, the cloud-based collaborative processing platform retrieves relevant metrics of the device resource set and performs iterative optimization of the multi-dimensional constraint framework to form a set of boundary conditions. These metrics include the number of processor cores, clock speed, cache level capacity, available memory capacity, storage bandwidth, acceleration unit throughput, upper limit of temperature rise rate, and scheduling cycle time slice quota. These metrics are jointly determined by the device capability description reported data and recent operational summaries. The cloud-based collaborative processing platform verifies the consistency between the device identifier and timestamp of these two types of data before using them as valid input. The iterative optimization process is as follows: using the intermediate latency limit, intermediate memory limit, and intermediate storage access limit as initial boundaries, the compatibility risk value is recalculated. When the risk value still exceeds the preset threshold, the boundaries corresponding to the indicators that contribute the most to the risk are tightened first. Specifically: when the operator mismatch ratio is the highest, the deployment format constraints are tightened and the requirement to replace unsupported operators is marked as a rejection item; when the layout conflict ratio is the highest, the memory alignment boundary is tightened and the model memory layout constraint item is set as a mandatory constraint; when the scheduling conflict risk ratio is the highest, the available processor load limit for the inference task is tightened and the execution window allowed for the inference task is shortened simultaneously; when the thermal-related risk item has the highest proportion, the latency boundary is lowered again according to the heat dissipation state interval identifier and the memory boundary is lowered simultaneously. After each tightening, the risk value is recalculated until the risk value does not exceed the preset threshold and the rejection item is not triggered. After convergence, the boundary condition set is output. The boundary condition set includes the final latency limit, the final memory limit, the final storage access limit, the final processor load limit, the thermal constraint segment item, and the scheduling scenario item, and an effective condition description and data source identifier are appended to each item.

[0039] After the boundary condition set is formed, the cloud-based collaborative processing platform performs compatibility verification on the uploaded data based on the boundary condition set and outputs quantified resource boundaries. The compatibility verification process is as follows: the uploaded data is checked field by field for device identification, unit description, collection timestamp, and value range. Value range verification is completed by comparing the uploaded parameters with the corresponding upper limits in the boundary condition set. Then, the final boundaries are substituted into the hot constraint segmentation entries and scheduling scenario entries respectively to verify that the inference task prediction latency does not exceed the final latency upper limit, the peak prediction memory usage does not exceed the final memory upper limit, the prediction storage access frequency does not exceed the final storage access upper limit, and the average prediction processor usage does not exceed the final processor load upper limit. After the verification is passed, the cloud-based collaborative processing platform outputs a quantified set of boundary conditions for the device's resource usage and marks this set as the constraint input for subsequent compression scheme selection.

[0040] S3 includes obtaining a pre-trained air quality monitoring benchmark model from a cloud-based collaborative processing platform, performing a preliminary analysis of the model's network layer simplification mode and parameter sparsity, processing the model structure using hierarchical parsing techniques, determining its adaptability under hardware constraints, and obtaining a preliminary assessment dataset for compressing the demand range; fusing the network layer simplification mode of the air quality monitoring benchmark model with the assessment dataset, performing multi-dimensional quantification of the parameter sparsity, and determining the hierarchical parsing adjustment value of the model structure through compatibility mapping of the hardware constraints; comparing the hierarchical parsing adjustment value with a preset adaptability threshold; if the comparison result exceeds the threshold, iteratively optimizing the network layer simplification mode to fuse the parameter sparsity, obtaining an intermediate index set for compressing the demand range; performing adaptability verification on the pre-trained air quality monitoring benchmark model based on the intermediate index set, and determining the preliminary compression demand range through comprehensive processing of the network layer simplification mode and the parameter sparsity.

[0041] In one implementation, the cloud-based collaborative processing platform first acquires a pre-trained air quality monitoring benchmark model. This acquisition is accomplished by retrieving structural description data and parameter data from the model repository. The structural description data characterizes the hierarchical order, branch-convergence relationships, and operator types at each layer of the inference chain; the parameter data characterizes the weight tensors and normalized parameters at each layer. After receiving the model, the platform first performs a consistency check on the model version identifier, input data dimensions, and output category definitions. This consistency check is completed by comparing the field values ​​in the model metadata with the field values ​​registered with the platform. If inconsistencies are found, the registration is terminated, and the platform reverts to the previous stable version. After successful verification, the structural description data is parsed into a hierarchical structure list. The hierarchical structure list assigns a hierarchical number to each layer according to the inference execution order and records the input size, output size, weight size, presence of branch inputs, presence of branch outputs, and participation in convergence for that layer, thus providing a definite indexing basis for subsequent hierarchical parsing.

[0042] After completing the hierarchical structure list, a preliminary analysis of the network layer simplification patterns is conducted. The network layer simplification pattern refers to the lightweight form already present in the baseline model at the structural level and the structural locations where further simplification is possible. The determination process is as follows: The platform scans the operator types layer by layer according to the layer number, identifying the occurrence locations of depthwise convolution, grouped convolution, channel compression and expansion structures, residual shorting, and feature fusion structures, and counting the occurrence frequency and stage of each type of structure. The stage division is based on the feature map resolution change nodes. The platform reads the output size layer by layer, and when the output size undergoes a downsampling change, the preceding and following layers are divided into different stages. Subsequently, the parameter quantity of each layer is calculated, obtained by accumulating the number of elements in the weight tensor. Simultaneously, the computational cost of each layer is calculated, obtained by multiplying the number of elements in the output feature map by the number of spatial elements covered by the convolution kernel, the number of input channels, and the number of output channels. When encountering a fully connected layer, the computational cost is obtained by multiplying the input feature length by the output feature length. When encountering element-wise operators, the computational cost is obtained by the number of elements in the output feature map. The platform sums the computational load of each layer within the same stage to obtain the stage computational load, and calculates the ratio of the stage computational load to the total model computational load to obtain the computational proportion of each stage, thereby identifying the computationally intensive stage. The platform calculates the peak memory usage of the output feature maps of each layer in hierarchical order. The memory usage of the output feature map is obtained by multiplying the number of elements in the output size by the number of bytes occupied by the data precision. When encountering a branch structure, the memory usage of the feature maps that need to be retained at the same time on the branch path is superimposed to obtain the branch retained memory. The maximum memory usage across the entire link is taken as the peak feature map memory, thereby identifying the storage-intensive stage. The above statistical results together constitute a structural profile of the simplified network layer pattern, and each layer is appended with its stage identifier, its computational contribution, and its contribution to the peak memory usage.

[0043] While the simplified pattern analysis of the network layers is being conducted simultaneously, the platform performs a preliminary analysis of the parameter sparsity. Parameter sparsity refers to the proportion of weights close to zero in the weight tensor and whether their distribution satisfies the structured pruning conditions. The platform reads each element of the weight tensor of each layer and calculates its absolute value, then sorts the absolute value sequence in ascending order. Subsequently, the sparsity decision threshold for this layer is determined. The sparsity decision threshold refers to the boundary value at which weights with absolute values ​​below the threshold are considered as sparsifiable candidates. The determination process is as follows: The platform selects a calibration sample set, which consists of samples covering the main pollution categories in the air monitoring dataset, and the number of samples for each category is evenly extracted; the platform selects multiple candidate threshold points from the sorted absolute value sequence, and the candidate threshold points are obtained by uniformly sampling according to the sequence position; for each candidate threshold point, the platform resets the weights below the threshold to zero, performs one forward inference, and calculates the ratio of the number of consistent category predictions on the calibration sample set to the total number of samples to obtain the consistency rate. Then, the consistency rate is subtracted from the consistency rate of the original model on the same calibration sample set to obtain the consistency rate decrease; the accuracy degradation alarm threshold is pre-registered in the platform strategy. This threshold is determined by the maximum consistency rate decrease of historical stable deployment versions under the same data distribution. The maximum decrease of these stable versions is taken as the alarm threshold, so that the alarm threshold is consistent with the boundary of stable operation experience; the platform selects the largest threshold point among the candidate threshold points that makes the consistency rate decrease not exceed the alarm threshold, as the sparsity decision threshold for this layer. After determining the sparsity threshold, the platform counts the number of weights in a layer whose absolute value is below the threshold and calculates the ratio of this number to the total number of weights in that layer to obtain the sparsity ratio of that layer. Simultaneously, the platform also discriminates the structured distribution of sparse weights, counting the number of channels with integer zero values ​​by output channel dimension, the number of convolutional kernels with integer zero values ​​by convolutional kernel dimension, and the number of blocks with integer zero values ​​by contiguous block region. These values ​​are then compared with the corresponding total numbers to obtain the channel sparsity ratio, convolutional kernel sparsity ratio, and block sparsity ratio. The platform uses these sparsity ratios and structured distribution ratios as quantitative descriptions of the degree of parameter sparsity and links them layer by layer to the hierarchical structure list.

[0044] After completing the structural profiling and sparse quantization description, the platform processes the model structure through hierarchical parsing and determines its adaptability under the hardware constraint framework, forming a preliminary evaluation dataset for compressing the scope of requirements. The implementation process of hierarchical parsing is as follows: The platform loads the set of boundary conditions in the hardware constraint framework as the current device constraint entries. The set of boundary conditions includes the upper limit of end-to-end latency, the upper limit of memory usage, the upper limit of storage access frequency, the upper limit of processor load, and an operator compatibility list. The platform first calculates the memory usage of the full model parameters. The parameter memory usage is obtained by multiplying the number of weight elements in each layer by the number of bytes occupied by data precision and then summing them. Then, the platform calculates the peak memory usage of the full model feature map. The peak memory usage of the feature map is obtained by taking the maximum value layer by layer according to the aforementioned branch superposition rule. The parameter memory usage is added to the peak memory usage of the feature map to obtain the predicted value of the model memory peak. The difference between the predicted value of the model memory peak and the upper limit of memory usage is used to obtain the memory excess value. A positive memory excess value indicates that the memory constraint is not satisfied. The platform then calculates the number of model storage accesses. The number of storage accesses is obtained by summing the number of times weights are read, the number of times input features are read, the number of times intermediate caches are read, and the number of times output features are stored. The number of times weights are read is counted according to the number of weight elements in each layer, and the number of times features are read and stored is counted according to the number of input and output elements in each layer. Branch paths are counted repeatedly according to the retention time. The platform divides the number of storage accesses by the upper limit of the total link latency to obtain the predicted storage access frequency, and the difference between the storage access frequency and the upper limit of the storage access frequency is used to obtain the bandwidth excess value. When the bandwidth excess value is positive, it indicates that the bandwidth constraint is not met. The platform then calculates the end-to-end predicted latency, which is obtained through layered conversion: The platform establishes a computing power calibration table for the target device, consisting of the number of operations per second and the number of storage accesses per second reported by the device under standard load; the platform converts the computational load of each layer into the computational time of that layer, and the number of storage accesses of each layer into the access time of that layer, and takes the larger of the two as the predicted time of that layer; the predicted times of each layer are accumulated in execution order to obtain the end-to-end predicted latency, and then the difference between the end-to-end predicted latency and the end-to-end latency limit is obtained to obtain the latency excess value. A positive latency excess value indicates that the latency constraint is not met. The platform also performs operator compatibility verification, which is completed by comparing each operator type in the hierarchical structure list with the operator compatibility list. When a mismatch is found, it is registered as a compatibility risk item and marked with the corresponding hierarchical number. The evaluation base dataset consists of the computational cost, parameter count, feature map usage, prediction time, access count, sparsity ratio, structured content ratio, and compatibility risk item annotations for each layer. In addition, latency excess, memory excess, and bandwidth excess values ​​are added at the model level.

[0045] Based on the evaluation dataset, the platform integrates simplified network layer patterns and performs multi-dimensional quantization processing on the sparsity of parameters. Layer resolution adjustment values ​​are determined through compatibility mapping within a hardware constraint framework. The multi-dimensional quantization process is as follows: The platform generates sparsity level identifiers for each layer's sparsity ratio by dividing it into intervals. The interval boundaries are determined by statistical results of sparsity ratios of similar layer types in historically stable deployment versions. The minimum and maximum values ​​of these statistical results are taken as boundary ranges and divided into several continuous intervals. The platform generates structured shaving identifiers for each layer's structured proportion. When the channel sparsity ratio is higher than the channel shaving threshold, it is identified as channel shaving priority; when the convolutional kernel sparsity ratio is higher than the convolutional kernel shaving threshold, it is identified as convolutional kernel shaving priority; when the block sparsity ratio is higher than the block shaving threshold, it is identified as block shaving priority. The channel shaving threshold, convolutional kernel shaving threshold, and block shaving threshold are determined by stable operation records after shaving in historically successfully deployed versions on similar hardware devices. The maximum value of the corresponding proportion in these records is taken as the threshold, ensuring that the threshold is consistent with the deployable shaving boundary. The platform then ranks the latency contribution, memory contribution, and bandwidth contribution of each layer. The latency contribution is obtained by the ratio of the prediction time of that layer to the total predicted latency of the entire link; the memory contribution is obtained by the ratio of the peak memory usage of that layer to the peak predicted memory value of the model; and the bandwidth contribution is obtained by the ratio of the number of accesses to that layer to the number of accesses to the model storage. The platform merges the ranking results of the three types of contributions to form a hardware sensitivity ranking, and the layers with higher rankings are marked as priority adjustment layers. The layer resolution adjustment value is used to characterize the compression intensity that the layer needs to achieve. The calculation process is as follows: the platform distributes the model-level latency excess value, memory excess value, and bandwidth excess value to each layer according to the contribution ratio, obtaining the latency excess value, memory excess value, and bandwidth excess value of each layer; the maximum value of the three types of distribution values ​​for each layer is taken as the dominant excess value of that layer; then, based on the structured shavingable identifier and sparse tier identifier of that layer, the priority path is determined. Under the channel shaving priority path, the dominant excess value is converted into the number of channels that need to be reduced. The conversion process is carried out by converting the layer unit The reduction in computational and memory usage brought by the channel is pre-calculated and then gradually deducted according to the dominant excess value. Under the quantization-first path, the dominant excess value is converted into the required reduction level of data precision. The conversion process involves evaluating the reduction in parameter memory usage and access frequency at different precision levels and selecting the smallest level that meets the deduction requirements. Under the structure merging-first path, the dominant excess value is converted into the number of adjacent structure entries to be merged. The conversion process involves statistically analyzing the reduction in computational and access frequency before and after merging and calculating it item by item according to the deduction requirements. The above conversion outputs are the hierarchical parsing adjustment values ​​for that level and are registered in the evaluation base dataset according to the hierarchical number.

[0046] The platform compares the hierarchical resolution adjustment value with the preset adaptability threshold. The adaptability threshold refers to the judgment boundary for whether the benchmark model meets the deployment boundary under the target hardware constraint framework. The determination process is as follows: The platform selects versions from the historical stable operation records of the same model of equipment that meet the requirements of no frequency reduction alarm, no memory reclamation alarm, and no task backlog alarm within a continuous operation cycle. It extracts the corresponding model-level latency excess value, model-level memory excess value, and model-level bandwidth excess value for these versions, and takes the maximum value as the latency adaptability threshold, memory adaptability threshold, and bandwidth adaptability threshold, respectively, so that the threshold is consistent with the upper limit of stable operation. At the same time, the mismatch items in the operator compatibility verification are registered as rejection conditions. Once a rejection condition occurs, it is determined that the model is not compatible. The comparison action is completed by the platform comparing the three types of excess values ​​of the current benchmark model with the three types of adaptability thresholds item by item. When any excess value exceeds the corresponding threshold or a rejection condition is triggered, iterative optimization is initiated, and an intermediate index set for compressing the requirement range is generated.

[0047] During the iterative optimization phase, the platform iteratively optimizes the parameter sparsity by integrating the simplified network layer model to form an intermediate index set. The specific implementation process is as follows: The platform selects preceding layers as the first batch of optimization targets based on hardware sensitivity. For each layer, it generates structural adjustment candidates and parameter processing candidates based on the layer-level resolution adjustment values. Structural adjustment candidates include channel reduction schemes, adjacent structure merging schemes, and operator replacement schemes. The generation process prioritizes maintaining consistent output size and branch convergence relationships, and is achieved by systematically filtering the mergeable relationships and pruning channel sets in the structural profile. Parameter processing candidates include structured sparsity utilization schemes and quantization level selection schemes. The structured sparsity utilization scheme determines the set of structural units that can be directly pruned based on the channel sparsity ratio, convolution kernel sparsity ratio, and block sparsity ratio. The quantization level selection scheme is determined based on the dominant excess value and accuracy level evaluation table. The platform applies candidate combinations to the hierarchical structure list to form a candidate structure list, and simultaneously generates a candidate parameter processing list. Then, it re-executes computational load statistics, parameter count statistics, feature map peak statistics, access count statistics, and prediction latency conversion on the candidate structure list and candidate parameter processing list to obtain the latency excess value, memory excess value, and bandwidth excess value of the candidate models. The platform subtracts the three types of excess values ​​from the corresponding excess values ​​of the benchmark model to obtain three types of convergence amplitudes, and records the number of channel reductions, the number of structure merging entries, changes in quantization levels, and changes in the proportion of structured sparsity utilization, forming the intermediate indicator set for this round. The platform repeats the above calculations and recording incrementally in each round until all three types of excess values ​​of the candidate models fall within the adaptation threshold range and do not trigger the rejection condition. Then, the intermediate indicator set that meets the conditions is merged into a candidate set for compressing the demand range.

[0048] The platform performs adaptability verification on the benchmark model based on the intermediate indicator set and determines the initial compression requirement range. The adaptability verification consists of two parts: the first part is resource boundary verification, where the platform recalculates the end-to-end prediction latency, peak predicted model memory value, and predicted storage access frequency for each intermediate indicator set in the candidate set, and compares them item by item with the corresponding boundaries in the hardware constraint framework. If any exceedance occurs, the set is removed. The second part is output consistency verification, where the platform uses a calibration sample set from the same source as the sparse decision threshold determination stage to perform inference on each candidate set, counts the number of samples that are consistent with the benchmark model's prediction results and calculates the consistency rate, then calculates the decrease in consistency rate and compares it with the accuracy degradation alarm threshold. If the threshold is exceeded, the set is removed. The verified set is used to summarize the initial compression requirement range. The summarization process is as follows: the minimum and maximum values ​​of the channel reduction quantity of the verified set are taken to form the structural compression range; the minimum and maximum change values ​​of the quantization level change are taken to form the quantization level range; and the minimum and maximum values ​​of the structured sparse utilization ratio change are taken to form the sparse utilization target range. The platform associates and archives the above ranges with the hardware constraint framework index, which serves as the input boundary for subsequent compression strategy combination search.

[0049] S4 includes extracting the hierarchical topology of the air quality monitoring benchmark model from the initial compression demand range; retrieving operator distribution features matching the hierarchical topology from a preset compression strategy combination to determine the pruning rate adjustment range; performing sparse mapping on the weight tensor of the air quality monitoring benchmark model according to the pruning rate adjustment range to obtain the quantization bit number option; obtaining the quantized weight distribution matrix by discretizing the numerical distribution of the weight tensor; applying the computational unit pruning rule to the quantized weight distribution matrix; if the computational unit pruning rule conflicts with the convolution kernel size of the air quality monitoring benchmark model, determining the pruned neuron connection mapping table by adjusting the stride parameter of the convolution kernel; restructuring the network structure of each layer of the air quality monitoring benchmark model using the pruned neuron connection mapping table; and obtaining a set of candidate model compression schemes by performing bit width alignment processing on the restructured network layers.

[0050] In the above implementation, the cloud-based collaborative processing platform searches for compression strategy combinations around the initial compression requirements, first extracting the hierarchical topology of the air quality monitoring benchmark model. The specific implementation process is as follows: The model computation graph is retrieved, and each layer of operator nodes is traversed according to the inference execution order. The operator type, input tensor size, output tensor size, weight tensor size, predecessor node identifier, and successor node identifier are read layer by layer. When a branch node is encountered, the relationship between the output of the branch's starting point and multiple successor nodes is recorded, as well as the relationship between the branch's converging node and multiple predecessor node outputs. After completing the full graph traversal, a topology sequence is generated according to the data dependencies between nodes, and a hierarchical number is appended to each node, thus forming a hierarchical topology. The platform synchronously extracts operator distribution features, which are obtained by counting: counting the number of convolutional operators, element-wise operators, normalization operators, pooling operators, and fully connected operators, and then dividing each by the total number of operators to obtain the proportion of each type of operator; then, based on the position where the output size is downsampled, the entire link is divided into multiple stages, and the above counting and stage proportion are repeated in each stage to obtain the operator concentration degree of each stage, so as to provide a structural basis for subsequent strategy retrieval.

[0051] After obtaining the hierarchical topology and operator distribution characteristics, the platform searches within a preset compression strategy combination and determines the pruning rate adjustment range. The preset compression strategy combination is contained in a strategy library. Each record in the strategy library includes the appropriate topological keypoint type, the appropriate operator proportion range, the appropriate pruning granularity, the pruning rate range, and the quantization bit width range. The search process is as follows: the current model's topological keypoint list is compared item by item with the keypoint list recorded in the strategy library, the number of consistent entries is calculated, and then this number is divided by the total number of keypoint entries to obtain the topological consistency. The proportion of each type of operator in the current model is compared item by item with the target proportion range recorded in the strategy library, the number of proportion items falling into the range is counted, and then this number is divided by the total number of proportion items to obtain the distribution consistency. The topological consistency and distribution consistency are synthesized according to pre-registered weights on the platform to obtain a strategy matching value. The platform selects the strategy records with the highest matching values ​​as the candidate strategy set. The pruning rate adjustment range is obtained by summarizing the candidate strategy set. Specifically, the lower and upper bounds of structural compression amplitude are read from the initial compression requirement range and mapped to the lower and upper bounds of the full model pruning rate. Then, the pruning rate boundaries are allocated according to the hierarchical contribution. The hierarchical contribution is determined by the computational contribution and the memory contribution. The computational contribution is obtained by calculating the proportion of the computational amount of the layer to the total computational amount of the full model. The memory contribution is obtained by calculating the proportion of the output feature map of the layer on the peak superposition path to the peak memory prediction value of the model. The platform calculates the hierarchical contribution value by weighted summing of the computational contribution and the memory contribution, and sorts them from high to low. The layers with higher hierarchical contribution values ​​are assigned a lower upper bound of the hierarchical pruning rate, and the layers with lower hierarchical contribution values ​​are assigned a higher upper bound of the hierarchical pruning rate, so that the pruning intensity forms a controllable gradient within the link. The above-mentioned upper bound of the hierarchical pruning rate and the upper and lower bounds of the full model pruning rate together constitute the pruning rate adjustment range. A source identifier is added after each layer, pointing to the initial compression requirement range and the strategy library record number.

[0052] After determining the pruning rate adjustment range, the platform performs sparsity mapping on the baseline model weight tensor and obtains the quantization bit count option. The sparsity mapping process is as follows: the importance of the weight tensor is evaluated on a hierarchical basis, including weight magnitude contribution, channel response contribution, and structured sparsity contribution. The weight magnitude contribution is calculated by traversing the weight tensor of the layer and taking its absolute value, then summing the absolute values ​​of the weights corresponding to the same output channel to obtain the total magnitude of the output channel. The channel response contribution is calculated by performing forward inference on the calibration sample set, recording the channel response intensity of the output feature map of the layer channel by channel, and obtaining the channel response intensity by summing the absolute values ​​of the output feature maps of the channel. The structured sparsity contribution is calculated by counting the number of weights whose absolute value is lower than the sparsity threshold of the layer, and dividing by the total number of weights in the channel to obtain the sparsity ratio of the channel. The sparsity threshold was determined in the previous stage through the consistency descent boundary of the calibration sample set, and in this stage, the threshold is directly called with the threshold source identifier attached. The platform synthesizes a channel importance score by combining the sum of amplitudes, channel response strength, and channel sparsity ratio according to pre-registered weights, and sorts the channels by importance score from high to low. Then, based on the adjustment range of the pruning rate for that layer, it selects the pruning rate value for this round, multiplies the total number of channels by this pruning rate to obtain the number of channels to be pruned, and takes the integer part of the number of channels to be pruned as the actual pruning quantity. The platform selects the corresponding number of channels from the bottom of the sorted list as the pruning channel set, and the remaining channels form the retained channel set, generating a sparse mask based on this. The sparse mask consists of channel indices and retained identifiers. The process of determining the quantization bit number option is as follows: the platform reads the set of integer bit widths and vector instruction bit widths supported by the target device from the hardware constraint framework, removes bit width items that trigger operator compatibility rejection conditions, and uses the remaining bit width items as the quantization bit number option. A hardware source identifier and an instruction source identifier are added to each bit width item to ensure that subsequent bit width selection is consistent with hardware capabilities.

[0053] After generating the sparse mask, the platform discretizes the weight tensor numerical distribution according to the quantization bit count option to obtain the quantized weight distribution matrix. The discretization process is as follows: For each layer, a sparse mask is first applied to filter out the weights corresponding to the clipped channels, and only the weights of the retained channels participate in discretization; the retained weights of the layer are traversed, the minimum and maximum weight values ​​are counted, and the maximum absolute value of the weights in the layer is recorded as the upper bound of the dynamic range; for each bit width option, the platform determines the number of discrete segments according to the number of discrete values ​​corresponding to the bit width. The number of discrete segments is directly determined by the number of representation states supported by the bit width and is used as the number of discrete segments in this layer; the platform determines the coverage interval based on the minimum and maximum weight values, divides the coverage interval into continuous discrete segments according to the number of discrete segments, and assigns a discrete value to each discrete segment; then the weight tensor is traversed again, each weight is located to its corresponding discrete segment and replaced with the discrete value corresponding to that discrete segment, while recording the discrete segment number to which the weight belongs. The process of generating the quantized weight distribution matrix is ​​as follows: the number of weights mapped to each discrete segment is counted, and the results are organized into a two-dimensional statistical table according to the hierarchical number and the discrete segment number. This two-dimensional statistical table represents the dense region of the discrete segment on the one hand, and provides a basis for the sparse density for subsequent pruning rules on the other hand.

[0054] The platform then applies computational unit pruning rules to the quantized weight distribution matrix and adjusts the stride parameter when convolutional kernel size conflicts occur, forming a pruned neuron connection mapping table. The computational unit pruning rules align the pruning granularity with the hardware execution granularity. The pruning granularity is provided by the policy library, including channel group pruning granularity and block pruning granularity; the hardware execution granularity is provided by the hardware constraint framework, including vector width alignment requirements, parallel computational unit group size alignment requirements, and cache line alignment requirements. The platform first performs secondary aggregation on the sparse mask based on the pruning granularity. Under the channel group pruning granularity, channels are grouped according to the hardware-aligned size, and a group importance score is calculated for each group. The group importance score is obtained by summing the channel importance scores within the group. Under the block pruning granularity, weights are divided into continuous blocks, and the discrete segment density and response sensitivity are statistically analyzed for each block. The discrete segment density is obtained by the proportion of weights within the block falling into high-density discrete segments, and the response sensitivity is obtained by the decrease in output channel consistency for that block under the calibration sample set. The platform selects a set of clipping units from low to high importance scores (either group or block) and generates a list of clipping units. The platform then performs convolutional kernel size conflict determination, which includes two types of consistency checks: first, checking the consistency between the number of output channels after clipping and the hardware alignment scale; if the number of output channels after clipping is not divisible by the alignment scale, a conflict is determined; second, checking the consistency between the feature map size after clipping and the input size of the subsequent layer. The platform derives the output feature map size based on the input size, convolutional kernel size, padding parameters, and stride parameters. The derivation process involves sliding the convolutional kernel from the input boundary according to the stride, with the number of slides determining the output width and height. The obtained output size is then compared with the expected input size of the subsequent layer; if inconsistencies are found, a conflict is determined. When conflicts occur, the platform adjusts the convolution kernel stride parameter. The adjustment process involves: reading the allowed stride set from the hardware constraint framework and selecting candidate strides in ascending order; re-deriving the output size for each candidate stride and comparing it with the expected input size of the subsequent layer, while simultaneously verifying the alignment requirements for the number of output channels; the candidate stride that meets both verifications is selected as the stride parameter for that layer, and the size association record between that layer and the subsequent layer is updated synchronously. After conflict resolution, the platform generates a neuron connection mapping table. The mapping table records the retained input channel index set, retained output channel index set, convolution kernel index set, stride parameter values, branch path index, and convergence node index by layer number, thus giving the pruned connection relationships a clear direction.

[0055] After obtaining the neuron connection map, the platform performs structural reorganization and bit-width alignment on the baseline model layer by layer, forming a set of candidate model compression schemes. The structural reorganization process is as follows: the platform reconstructs the shape of the weight tensors of each layer according to the connection map, removes the weight slices corresponding to the pruning channels, reconstructs the output reference relationships of branch nodes, and reconstructs the input set order of the convergence nodes, so that the topological sequence remains continuous and connected after pruning. After reorganization, the platform recalculates the number of parameters, the amount of computation per layer, the peak memory prediction value of the full-link feature map, and the prediction value of the full-link access count for each layer. The prediction values ​​are used to verify that the reorganized structure does not exceed the constraints of the initial compression requirements. The bit-width alignment process is as follows: the platform traverses the bit-width configuration of adjacent layers according to the topological sequence, counts the number of precision conversion nodes caused by the inconsistency of bit widths of adjacent layers, and uses this number as a conversion overhead indicator. The platform selects the bit-width combination that minimizes the conversion overhead indicator and does not trigger hardware compatibility rejection conditions from the quantization bit number options, re-discretizes the affected layers, and updates the quantized weight distribution statistics table, thereby reducing the additional memory access and additional latency caused by precision conversion. Finally, the platform encapsulates the pruning rate, pruning granularity, bit width combination, step size parameter, and neuron connection mapping table version number into a candidate scheme description. It also adds recalculated parameter quantity, computational complexity, peak memory prediction value, and access frequency prediction value to each candidate scheme, so that the candidate model compression scheme set has a directly usable computational foundation when entering the next stage of resource estimation.

[0056] S5 includes mapping configuration information from the candidate compression scheme set to the virtual simulation environment of the cloud-based collaborative processing platform to obtain the hardware latency estimate corresponding to the configuration information; comparing the hardware latency estimate with the hardware latency limit; if the hardware latency estimate is less than the hardware latency limit, extracting the memory address mapping sequence corresponding to the configuration information; determining the storage access frequency based on the memory address mapping sequence, and matching the storage access frequency with the bandwidth threshold to obtain the storage pressure assessment result; converting the storage pressure assessment result into a processor load prediction vector; if the processor load prediction vector is within the processor load boundary, determining the set of compression schemes that meet the resource constraints.

[0057] In the above implementation, the cloud-based collaborative processing platform first maps the configuration information in the candidate compression scheme set to the virtual simulation environment to obtain the hardware latency estimate corresponding to the configuration information. The configuration information refers to the pruning rate value, pruning granularity value, bit width level value, step size parameter value, connection mapping table identifier, and hierarchical topology change entry. The virtual simulation environment on the platform consists of two parts of data: one part is the device performance profile, which is determined by the target device's reported computational throughput, storage throughput, cache access latency, parallel execution unit size, and scheduling cycle length. The computational throughput is determined by reading the device's computation count record during a stable operating cycle and converting it into the number of computations that can be completed per unit time. The storage throughput is determined by reading the memory access byte count record during a stable operating cycle and converting it into the number of memory access bytes that can be completed per unit time. The cache access latency is determined by reading the cache hit and miss latency statistics in the performance counter and taking the maximum latency value in the no-alarm period. The scheduling cycle length is determined by reading the time slice length in the task scheduling policy record. The other part is the inference execution profile, which is determined by the computational load, memory access load, tensor size changes, branch convergence paths, and bit-width conversion nodes of each layer under the hierarchical structure list of candidate schemes. The platform recalculates each candidate solution layer by layer: First, it derives the output feature map size of the layer based on the number of channels after pruning, the convolution kernel size, the stride parameter, and the input and output dimensions. Then, it derives the computational cost of the layer based on the number of elements in the output feature map, the number of elements covered by the convolution kernel, the number of input channels, and the number of output channels. Simultaneously, it derives the memory access cost of the layer based on the number of elements in the weight tensor, the number of elements in the input feature map, the number of elements in the output feature map, and the number of intermediate cache elements, and converts the number of elements into bytes based on the bit width level. Then, it divides the computational cost of the layer by the computation throughput per unit time in the device performance profile to obtain the estimated computation time of the layer; it divides the memory access bytes of the layer by the storage throughput per unit time in the device performance profile to obtain the estimated memory access time of the layer; finally, it takes the larger of the estimated computation time and the estimated memory access time as the estimated execution time of the layer. The platform accumulates the execution time estimates of each layer along the topology sequence to obtain the total link latency estimate, and performs a conversion on the execution time of branch paths: when branch paths are advanced in parallel within the same scheduling window, the maximum time of the parallel segment is taken; when branch paths are advanced serially within the scheduling window, the time is accumulated sequentially. After conversion, the hardware latency estimate is obtained. The hardware latency estimate refers to the prediction time required for the candidate solution to complete one inference on the target device side.

[0058] After obtaining the estimated hardware latency, the platform compares it with the hardware latency cap. The hardware latency cap refers to the maximum allowed duration for a single inference attempt, provided that both energy consumption budget constraints and thermal management constraints are met. The determination process involves extracting the execution duration of each inference attempt from the device's historical inference records and calculating the corresponding energy consumption. Records with energy consumption exceeding the energy limit per unit time are removed, and the maximum execution duration from the remaining records is taken as the hardware latency cap. The comparison process involves the platform directly determining whether the estimated hardware latency is less than the hardware latency cap. Candidate solutions with a latency less than the cap proceed to the next stage, while those that fail are removed from the candidate set.

[0059] For candidate solutions that pass the latency threshold, the platform extracts the memory address mapping sequence corresponding to the configuration information. The memory address mapping sequence refers to the allocation segments of various tensor buffers in the address space and their access order during a single inference. The implementation process is as follows: The virtual simulation environment starts memory allocation simulation, and allocates continuous logical address segments to the weight buffer, input feature buffer, output feature buffer, and intermediate cache buffer according to the hierarchical topology and tensor lifecycle of the candidate solution, and marks the allocation time and release time for each address segment; then, the simulation is executed according to the topology sequence, and the start position, access length, and access type of the access address segment are recorded for each layer's read and store actions, and they are concatenated in chronological order to form a sequence; when there are branches and convergences, the multi-way reads at the branch starting point and the multi-way stores at the convergence node are marked as concurrent access segments and aggregated access segments, respectively.

[0060] The platform determines the storage access frequency based on the memory address mapping sequence and matches the storage access frequency with the bandwidth threshold to obtain the storage pressure assessment result. Storage access frequency refers to the intensity of memory access bytes per unit time. Its calculation process is as follows: the duration of one inference cycle is divided into multiple consecutive time windows, with the window length taken from the scheduling cycle length in the device performance profile, aligning the statistical window with the scheduling resource allocation; within each time window, the access length of each access record falling into that window in the memory address mapping sequence is accumulated to obtain the window's memory access bytes, and then the window's memory access bytes are divided by the window duration to obtain the window's memory access rate; the maximum value of the memory access rates across all time windows is taken as the peak memory access rate, and this peak memory access rate is used as the storage access frequency for the candidate solution. The bandwidth threshold refers to the maximum available storage bandwidth allowed for the target device under stable operating conditions. Its determination process is as follows: the memory access rate sequence is extracted from the device's long-term stable operation logs, time periods with bandwidth congestion alarms and task backlog alarms are removed, and the peak memory access rate records for alarm-free time periods are retained. The maximum value of these peak records is then taken as the bandwidth threshold and registered in the boundary condition set. The matching process involves the platform determining whether the storage access frequency exceeds the bandwidth threshold. If it does not exceed the threshold, the storage pressure assessment result is marked as bandwidth satisfied; if it does exceed the threshold, the storage pressure assessment result is marked as bandwidth exceeding the limit. At the same time, the extent of the exceedance is calculated. The extent of the exceedance is obtained by subtracting the bandwidth threshold from the storage access frequency and is used for blocking compensation in subsequent load prediction.

[0061] The platform converts the storage pressure assessment results into a processor load prediction vector and performs filtering based on processor load boundaries. The processor load prediction vector refers to the sequence of processor occupancy ratios arranged by time slices during inference execution. Its construction process is as follows: using the aforementioned time window division, each time window is considered a time slice; within each time slice, the platform calculates the total computation time and the total memory access wait time based on the hierarchical time consumption breakdown results of the virtual simulation environment. The total computation time is obtained by summing the estimated computation time of each layer falling into the time slice, and the total memory access wait time is obtained by summing the portion of the estimated memory access time of each layer falling into the time slice that exceeds the estimated computation time; then, the total computation time is divided by the time slice duration to obtain the time slice computation occupancy ratio, and the total memory access wait time is divided by the time slice duration to obtain the time slice wait occupancy ratio, and the two are added together to obtain the time slice processor occupancy ratio. When a bandwidth violation occurs, the platform adds congestion compensation to the time slice waiting occupancy ratio. The process for determining the congestion compensation is as follows: The platform extracts corresponding samples of "bandwidth violation amplitude" and "processor waiting occupancy growth" from historical stable and restricted operation records. These samples are then grouped into segments based on the violation amplitude, from smallest to largest. Within each segment, the average waiting occupancy growth is used as the compensation value for that segment, forming a mapping table from violation amplitude to compensation value. During this prediction, the compensation value is extracted based on the segment the violation amplitude falls into and added to the waiting occupancy ratio, ensuring the prediction result reflects the congestion caused by the bandwidth bottleneck. The processor occupancy ratios for each time slice are arranged in chronological order to form a processor load prediction vector.

[0062] The processor load boundary refers to the maximum processor utilization allowed for a target device under stable operating conditions. Its determination process is as follows: During a no-alarm operating cycle, a sequence of processor utilization ratios is collected at a set sampling period. Sampling points that trigger frequency reduction flags are removed, and the maximum utilization ratio among the sampled points is retained as the processor load boundary, which is then registered in the boundary condition set. The platform performs boundary judgment on the processor load prediction vector. The judgment process involves checking whether the processor utilization ratio exceeds the processor load boundary in each time slice. If it exceeds the boundary in any time slice, the candidate scheme is deemed out of bounds and eliminated. If all time slices are within the boundary, the candidate scheme is deemed to meet the processor resource limit and retained. After hardware latency threshold screening, bandwidth threshold matching, and processor load boundary judgment, the platform outputs a set of compression schemes that meet the resource limits.

[0063] S6 includes extracting configuration parameters from a set of compression schemes that meet resource constraints, generating a simplified model sequence on a cloud-based collaborative processing platform, obtaining a structural simplification index for each model in the simplified model sequence; calculating accuracy loss based on the structural simplification index, obtaining a comparison result of the deviation between the accuracy loss value and the original model; using the deviation comparison result to drive an evaluation mechanism for the improvement in inference speed, determining the time-saving vector corresponding to the improvement in inference speed; constructing a performance data matrix for each simplified model through a joint mapping of the time-saving vector and the accuracy loss value; if the elements in the performance data matrix exceed a preset contamination identification threshold, triggering a data calibration iteration to adjust the internal correlation of the performance data matrix; and summarizing the performance data of each simplified model in the contamination identification task based on the adjusted performance data matrix.

[0064] In the above implementation, the cloud-based collaborative processing platform extracts configuration parameters one by one from the set of compression schemes that meet resource constraints and generates a simplified model sequence. The configuration parameters refer to the channel retention index, convolution kernel retention index, pruned topological order, bit width level, stride parameter, quantization mapping relationship identifier, and connection mapping table identifier for each layer. The determination process is as follows: for each compression scheme, the scheme description record is read, the structural change entries corresponding to the layer number are parsed, and the connection mapping table identifier is located to the corresponding connection relationship list, thereby obtaining the connection pairs, branch path numbers, and convergence node numbers of the input and output tensors of each layer. The platform reconstructs the inference graph according to this connection relationship list, slices and preserves the weight tensors according to the channel retention index and convolution kernel retention index, and updates the tensor shape synchronously. The output size of each layer is re-derived according to the stride parameter and checked for consistency with the input size of the subsequent layer. Quantization mapping is performed on the preserved weights according to the bit width level, and the quantized weight storage layout is generated. After the above reconstruction is completed, a simplified model sequence is formed using the scheme number as the sequence number. A structural simplification index is calculated for each model in the sequence. The structural simplification index refers to the quantitative changes brought about by structural compression to parameter size, computational size, access size, and bit width distribution. The calculation process is as follows: The number of weight elements is counted layer by layer and accumulated to obtain the parameter size value. The difference between this parameter size value and the corresponding value of the original model is then calculated, and the corresponding value of the original model is used as a reference to obtain the parameter simplification ratio. The number of operations is derived layer by layer based on the output size, number of input channels, number of output channels, convolution kernel coverage, and stride parameters, and accumulated to obtain the computational size value. The difference between this and the computational size value of the original model is then calculated, and the computational simplification ratio is obtained with reference to the computational size value of the original model. The number of bytes read by weights and the number of bytes read and written by feature maps are counted layer by layer and accumulated to obtain the access size value. The number of bytes is calculated by combining the number of elements with the bit width level. The difference between this and the access size value of the original model is then calculated, and the access simplification ratio is obtained with reference to the access size value of the original model. The bit width levels are summarized layer by layer to form a bit width distribution entry, which is used to characterize the precision configuration distribution of the entire link. The above entries together constitute the structural simplification index of the simplified model.

[0065] The platform calculates accuracy loss based on structural simplification indicators and outputs deviation comparison results. The accuracy loss refers to the decrease in the consistency rate of the simplified model relative to the original model in the pollution identification task. Its determination process is as follows: A pollution identification evaluation set is constructed, obtained by filtering historical collected data and labeled data. The filtering rules are: covering all pollution categories, covering major collection scenarios, and covering major equipment sources. The number of samples for each pollution category is evenly distributed to ensure that the evaluation results are not affected by category distribution shifts. The platform first uses the original model to infer on each sample in the evaluation set, counts the number of samples whose predicted category matches the labeled category, and compares this number with the total number of samples in the evaluation set to obtain the original consistency rate. Then, the above statistics are repeated for each simplified model to obtain the simplified consistency rate. The accuracy loss is obtained by subtracting the simplified consistency rate from the original consistency rate. The deviation comparison result refers to the decomposition result of error in the category dimension and error type dimension. The determination process is as follows: For each pollution category, the number of correctly identified, the number of correctly identified, the number of missed, and the number of incorrectly identified by the simplified model are counted separately, and then compared with the total number of samples in that category to obtain the category-level correct ratio, missed identification ratio, and incorrect identification ratio. The platform sets risk weights for key pollution categories. The risk weights are determined by the monitoring task level and business risk requirements. The determination method is to include the categories that need to be prioritized in the key category list, and assign a higher weight to the missed identification ratio of the key categories than the incorrect identification ratio, forming key risk indicators and comprehensive deviation indicators. The two together constitute the core items of the deviation comparison result.

[0066] The platform employs a deviation comparison result-driven inference speed improvement evaluation mechanism and determines a time-saving vector. The inference speed improvement refers to the proportion by which the average inference time of the simplified model is reduced relative to the original model under the same execution environment. The determination process is as follows: For each model, a consistent inference input batch and a consistent warm-up round are set. The warm-up rounds are used to eliminate the impact of caching and scheduling jitter during the first execution. After warm-up, the platform performs multiple rounds of inference on the original model, recording the start and end times of each round and calculating the inference time. The inference times of multiple rounds are summed and then divided by the number of rounds to obtain the original average inference time. The above process is repeated for each simplified model to obtain the simplified average inference time. The total time saving is obtained by subtracting the simplified average inference time from the original average inference time. The ratio of the total time saving to the original average inference time yields the inference speed improvement. The evaluation mechanism triggers execution path selection based on deviation comparison results. The process for determining the execution path selection is as follows: when a key risk indicator exceeds a set risk line, the platform activates a conservative execution strategy, which reduces the number of operator fusions, reduces the cross-layer memory reuse range, and retains high-precision computation paths for key layers; when a key risk indicator is within the risk line, the platform activates an enhanced execution strategy, which increases the set of fusionable operators and expands the memory reuse window to achieve higher speed gains. The time-saving vector refers to the time-saving distribution summarized by hierarchy. Its determination process is as follows: perform hierarchical profile recording on the original model and the simplified model respectively, calculate the cumulative value of the execution time of multiple rounds for each layer, and divide it by the number of rounds to obtain the average execution time of that layer; subtract the average execution time of the corresponding layer of the simplified model from the average execution time of the original model to obtain the time saving amount of that layer; arrange the time saving amounts of each layer in topological order to form a time-saving vector, which is used to characterize the hierarchical distribution of the time saving sources.

[0067] The platform constructs a performance data matrix through a joint mapping of time-saving vectors and accuracy loss values. This performance data matrix is ​​a structured dataset with model sequence numbers as rows and performance indicators as columns. Its columns include at least the accuracy loss value, key risk indicators, comprehensive deviation indicators, inference speed improvement, total time savings, statistics of the time-saving vector, parameter simplification ratio, computational simplification ratio, and access simplification ratio. The joint mapping is determined as follows: the total time-saving vector, the maximum single-layer savings, and the savings in computationally intensive stages are extracted as statistics for the time-saving vector, where computationally intensive stages are determined by ranking computational contributions in the structural simplification indicators; the accuracy loss value and key risk indicators are included in the matrix to simultaneously constrain overall accuracy and key category risks; the simplification ratio in the structural simplification indicators is included in the matrix for quantitative comparison of resource benefits in the subsequent model selection stage. Each element in the matrix is ​​associated with its source data identifier, which is determined by both the model sequence number and the evaluation batch number.

[0068] When elements in the performance data matrix exceed the preset contamination identification threshold, the platform triggers a data calibration iteration to adjust the internal correlation of the matrix. The contamination identification threshold refers to the acceptable upper limit set for key risk indicators and accuracy loss values. Its determination process is as follows: Versions with no alarms and passed business acceptance within a continuous operating cycle are selected from the platform's historical stable deployment records. Key risk indicators and accuracy loss values ​​of these versions under the same evaluation set standard are extracted, and their maximum allowable levels are taken as the contamination identification thresholds. Simultaneously, the minimum consistency rate required by the business side is converted into an upper limit constraint for accuracy loss, forming a dual threshold constraint. After triggering, the platform first locates the source of the threshold exceedance. The location process is as follows: if a key risk indicator exceeds the threshold, it traces back to the category with the most prominent missed identification ratio by category, and then traces back to the error concentration scenario by sample; if the accuracy loss value exceeds the threshold, it combines the time-saving vector to locate the level with the largest structural change and the level with the largest change in quantization bit width. The calibration iteration then proceeds as follows: When the risk is concentrated at the quantization level, the platform performs quantization calibration on the model. Quantization calibration reduces the quantization error of the key layer by re-statistically analyzing the activation value range of the calibration samples in the key layer and adjusting the mapping between the discrete segment coverage interval and the discrete value. When the risk is concentrated at the structure pruning level, the platform performs structure rollback. Structure rollback restores a portion of the high-sensitivity channels in the pruned channel set and synchronously updates the connection mapping table, thereby improving the representation capability of the key categories. When the risk is concentrated at the category determination boundary, the platform performs output threshold calibration. Output threshold calibration searches the evaluation set for a determination threshold that reduces the proportion of missed identifications of key categories and controls the overall increase in misidentifications, and incorporates this threshold into the post-processing configuration. After each calibration iteration, the platform recalculates the model's structural simplification index, accuracy loss value, bias comparison results, inference speed improvement and time saving vector, and updates the corresponding row of the performance data matrix until the key risk index and accuracy loss value fall back to within the contamination identification threshold, or reach the upper limit of the iteration rounds set by the platform. The upper limit of the iteration rounds is determined by the platform's resource budget and delivery timeliness requirements and is registered in the task configuration.

[0069] The platform summarizes the performance data of each simplified model in the pollution identification task based on the adjusted performance data matrix. The summary process is as follows: extract the accuracy loss value, key risk indicators, comprehensive deviation indicators, inference speed improvement, total time saving, parameter simplification ratio, calculation simplification ratio and access simplification ratio for each model, and attach the corresponding configuration parameter summary and calibration iteration identifier.

[0070] S7 includes acquiring the performance data matrix of each simplified model, extracting the corresponding accuracy feature vector and resource consumption feature from the performance data matrix; performing hardware mapping analysis based on the resource consumption feature to obtain the memory usage value and energy consumption budget value corresponding to each simplified model; if the memory usage value does not exceed the preset memory usage threshold and the energy consumption budget value does not exceed the preset energy consumption budget limit, then the corresponding accuracy feature vector is input into a pre-established weighted sorting mechanism to obtain an initial sorting sequence; by calculating the balance between accuracy and resource usage of the elements in the initial sorting sequence, a balance score set is obtained; the highest score is matched using the balance score set on the cloud collaborative processing platform to determine a final deployment version that balances accuracy and resource usage.

[0071] In the above implementation, the cloud-based collaborative processing platform first obtains the performance data matrix corresponding to each simplified model. The performance data matrix refers to a data set indexed by model sequence number as the row index and by accuracy and resource-related indicators as the column index. Its source is the result generated from the previous stage using the same contamination identification evaluation set and the same statistical caliber for the same inference round. The platform performs a consistency check on the matrix. The check includes: verifying whether the model sequence number and configuration parameter summary of each row match; verifying whether the evaluation batch identifier is consistent; and verifying whether the units of each column of indicators are consistent. After completing the check, the platform extracts the accuracy feature vector and resource consumption feature from the matrix. The accuracy feature vector refers to the combination of accuracy loss value, key pollution category omission risk, comprehensive deviation index, and minimum consistency rate satisfaction mark. The accuracy loss value is directly read from the matrix and is determined by subtracting the simplified model consistency rate from the original model consistency rate. The key pollution category omission risk is directly read from the matrix and is determined by dividing the number of key category omissions by the total number of key category samples. The comprehensive deviation index is directly read from the matrix and is determined by summing the category deviation ratio and risk weight. The minimum consistency rate satisfaction mark is directly read from the matrix and is determined by comparing the simplified model consistency rate with the minimum consistency rate registered by the business side. Resource consumption characteristics refer to the combination of predicted memory peak, parameter scale, access scale, inference latency prediction, and bit width distribution entries. The predicted memory peak is directly read from the matrix and is determined by superimposing the peak occupancy of the concurrent feature buffer and intermediate cache buffer during inference. The parameter scale is directly read from the matrix and is determined by accumulating the number of weight elements in each layer. The access scale is directly read from the matrix and is determined by accumulating the number of bytes read for weights and the number of bytes read and written for feature maps. The inference latency prediction is directly read from the matrix and is determined by converting the calculation time and memory access time by layer in the virtual simulation environment and accumulating them in topological order. The bit width distribution entries are directly read from the matrix and are determined by summing the bit width levels of each layer by layer number.

[0072] The platform performs hardware mapping analysis based on resource consumption characteristics to obtain memory usage and energy consumption budget values. Memory usage refers to the peak number of bytes of memory required for a single inference operation on the target device. Its calculation process is divided into two parts: parameter usage and runtime usage. Parameter usage is obtained by converting parameter size. The conversion is performed layer by layer according to the bit width distribution, multiplying the number of weight elements in each layer by the byte usage corresponding to the bit width of that layer, and accumulating them to form the parameter storage byte size. Runtime usage is obtained by converting the predicted memory peak. The conversion process converts the number of elements in the input feature buffer, output feature buffer, and intermediate buffer that coexist at the peak time into bytes according to their corresponding bit widths, and then adds them together to form the runtime peak byte size. The parameter storage byte size and the runtime peak byte size are added together to obtain the memory usage value. The energy consumption budget value refers to the energy consumption intensity of the simplified model inference per unit time scale. Its determination process uses the inference latency estimate as the time base and combines it with device power consumption mapping entries. The device power consumption mapping entries are obtained by organizing the power consumption sampling sequence reported by the target device during its stable operating cycle. The organization process involves segmenting the power consumption samples according to processor occupancy intervals and memory access occupancy intervals, calculating the average power consumption of each segment, and forming a mapping table. The platform reads the computation time estimate and memory access time estimate output by the virtual simulation environment layer by layer for the simplified model, and obtains the computation occupancy interval and memory access occupancy interval for that layer accordingly. The average power consumption of the corresponding interval is selected from the power consumption mapping table as the power consumption estimate of the layer. The power consumption estimate of the layer is multiplied by the execution time estimate of the layer to obtain the energy consumption of the layer. The energy consumption of a single inference is accumulated layer by layer across the entire link. The platform then combines the inference triggering cycle registered on the deployment side to obtain the number of inferences per unit time. The inference triggering cycle is determined by extracting the inference task triggering interval from the task scheduling policy record and taking the minimum triggering interval within the stable operation segment as the cycle boundary. The energy consumption of a single inference is converted into the energy consumption intensity per unit time according to the cycle to form the energy consumption budget value.

[0073] The platform compares memory usage values ​​with memory usage thresholds and energy consumption budget values ​​with energy consumption budget limits. The memory usage threshold refers to the maximum number of bytes of memory allowed for inference tasks. It is determined by reading the total physical memory of the target device and subtracting the peak system-reserved memory. The peak system-reserved memory is obtained by taking the maximum value from the memory usage sequence when the device is only running basic system services. This maximum inference memory limit serves as the memory usage threshold. The energy consumption budget limit refers to the maximum amount of energy allowed to be consumed per unit time. It is determined by reading the continuous power supply limit reported by the power management module and the continuous heat dissipation limit reported by the thermal management strategy, taking the smaller value as the sustainable power consumption limit, and then converting it to the energy consumption limit per unit time according to the scheduling cycle. The comparison is performed model by model. Models whose memory usage values ​​do not exceed the memory usage threshold and whose energy consumption budget values ​​do not exceed the energy consumption budget limit enter the sorting stage. The remaining models are marked as resource out of bounds and removed from the candidate set.

[0074] For models that pass the resource threshold, the platform inputs the accuracy feature vector into a weighted ranking mechanism to obtain an initial ranking sequence. The weighted ranking mechanism consists of an indicator normalization process, a weight set, and ranking rules. The weight set is pre-defined in the deployment strategy, and its determination method involves converting business risk priority into a weight order, registering the weights as integers: 4 for key pollution category missed identification risk, 3 for comprehensive deviation indicator, 2 for accuracy loss numerical weight, and 1 for minimum consistency rate satisfaction indicator. The indicator normalization process eliminates dimensional differences. The normalization action determines the mapping boundary based on the minimum and maximum values ​​of the same indicator among all shortlisted models, mapping the value of the indicator for each model to the range of 0 to 1. Missed identification risk, comprehensive deviation, and accuracy loss are risk-type indicators; after normalization, the lower the risk, the higher the score, and the direction is reversed. The minimum consistency rate satisfaction indicator is a constraint-type indicator, recorded as 1 if satisfied and 0 if not. The platform multiplies the normalized indicator scores of each model by their corresponding weights and sums them to obtain the model's ranking score, then arranges them from high to low to form the initial ranking sequence.

[0075] The platform calculates a balance score set based on the initial sorted sequence, considering both accuracy and resource usage. The balance calculation first generates accuracy and resource scores: the accuracy score is obtained by merging the normalized scores of the accuracy feature vectors with a weight of 6. This merging process weights and sums the risk of missed identification of key pollution categories, comprehensive deviation indicators, accuracy loss values, and minimum consistency rate compliance indicators, then normalizes them to a range of 0 to 1. The resource score is formed from resource reserves, which refer to the memory reserves obtained by subtracting the memory usage value from the memory usage threshold, and the energy reserves obtained by subtracting the energy consumption budget value from the energy consumption budget limit. The platform normalizes the memory reserves and energy consumption reserves to a range of 0 to 1 within the shortlisted model set, then merges them with a weight of 4 to obtain the resource score. Simultaneously, a boundary penalty is applied to models approaching the threshold boundary. The boundary penalty is determined by lowering the resource score by a preset level when the memory reserves or energy consumption reserves are lower than the median value of the reserves in the shortlisted set. This lower level is registered as 0.1 in the deployment strategy. The platform merges the accuracy-side score and the resource-side score according to the balance weight registered in the deployment strategy. The balance weight is registered as 6 for accuracy-side and 4 for resource-side. After merging, the balance score of each model is obtained, and the balance scores of all models constitute the balance score set.

[0076] The platform determines the final deployment version by performing the highest-score matching based on the balance score set. The highest-score matching process first selects the model with the highest balance score as the first choice and then performs a constraint review on that model. The review includes verifying that the minimum consistency rate is still set to 1, the risk of missing key contamination categories does not exceed the contamination identification threshold, memory usage does not exceed the memory usage threshold, energy consumption budget does not exceed the energy consumption budget limit, and compatibility rejection items are not triggered. The contamination identification threshold refers to the maximum allowed value of key risk indicators, determined by selecting the maximum allowed level of missing key contamination category risk under the same evaluation criteria from historically stable deployment versions and registering it as the threshold. If the review passes, the model is selected as the final deployment version. If the review fails, the next model is selected sequentially from highest to lowest balance score, and the review is repeated until a model that meets all constraints is selected. After determining the final deployment version, the platform records the model sequence number, configuration parameter summary, balance score entries, and resource mapping results for that version.

[0077] S8 includes obtaining a hardware architecture description file, parsing an initial operator graph from the hardware architecture description file, converting the format of the initial operator graph that does not meet compatibility requirements to obtain a target operator graph, optimizing and rearranging the target operator graph to determine an adaptive instruction sequence, loading an edge inference model using the adaptive instruction sequence, and using the edge inference model to infer air monitoring data to generate air quality monitoring results from the air monitoring data.

[0078] In the above implementation, the edge monitoring device first obtains a hardware architecture description file. This file is exported by the device system management module and distributed along with the model package. Its contents include: processor instruction set characteristics (obtained by querying processor capability register information); vector instruction width (directly given by the instruction set capability field); acceleration unit type and availability status (given by the device hardware manifest field and the driver initialization status code); supported data precision set (returned by the precision enumeration interface during inference runtime); operator support list (returned by the operator registry exported by the inference runtime in the current version); memory alignment constraints (given by the memory allocator configuration item, including the number of aligned bytes); cache level and access granularity constraints (given by the processor cache information field and the access granularity by the number of cache line bytes); tensor layout support formats (given by the allowed list of input / output layouts during inference runtime); and runtime version information (given by the inference runtime self-description field). After receiving a file, the edge monitoring device performs an integrity check. The integrity check is completed by calculating the check value of the file byte stream and comparing it with the check value carried in the packet. At the same time, it checks that the version information is consistent with the version running on the local machine. When both conditions are met, the parsing process begins.

[0079] The edge monitoring device parses the hardware architecture description file to obtain the initial operator graph, which is generated from the model structure description of the final deployment version. The generation process is as follows: read the hierarchical order and branch-convergence relationships in the model structure description; generate operator nodes for each layer according to the execution order; and register the operator type, input tensor size, output tensor size, weight tensor size, data precision attribute, and tensor layout attribute for each operator node; generate dependency edges for each data dependency relationship, recording the correspondence between the output of the upstream node and the input of the downstream node; generate multiple parallel dependency edges for the branch structure and multiple convergence dependency edges for the convergence structure, and record path numbers for the parallel segments and convergence segments to ensure that the graph structure remains connected. Input and output tensor dimensions are directly read from the structure description during registration. If the structure description only provides the input dimensions and operator parameters, the output dimensions are derived from the operator parameters. For example, the output width of a convolution node is obtained by subtracting the convolution kernel width from the input width and adding the left and right padding widths, then dividing the result by the stride and adding 1. The output height is derived in the same way. The output dimensions of pooling nodes are derived using the pooling kernel size and stride parameters with the same caliber. The output dimensions of element-wise nodes are obtained by verifying the consistency of the input dimensions. After completing the dimension derivation, the operator support list, supported data precision set, and tensor layout support forms in the hardware architecture description file are mapped to each operator node to form node-level compatibility attributes for subsequent compatibility determination.

[0080] The edge monitoring device performs compatibility checks on the initial operator graph, with each node performing the checks individually. Operator type checks are performed by comparing node operator types against the supported operator list, recording the reason for any mismatch. Data precision checks are performed by comparing node data precision attributes against the supported data precision set, recording the reason for any mismatch. Tensor layout checks are performed by comparing node tensor layout attributes against the supported tensor layout formats, recording the reason for any mismatch. Alignment checks are performed by verifying the alignment of the planned addresses for node input / output buffers. The alignment verification process involves dividing the planned address by the number of aligned bytes and taking the remainder. A remainder of 0 indicates alignment is satisfied; otherwise, the address is increased by the number of aligned bytes minus the remainder padding to obtain the aligned address, and the tensor step offset is increased simultaneously to ensure consistent offset readings by subsequent nodes. Branch convergence checks are performed by verifying the consistency between the tensor layout and precision attributes of parallel segments, recording the reason for any inconsistency. For nodes with incompatibility issues, format conversion is triggered. First, the initial operator graph is converted to an intermediate representation supported by the edge inference runtime, preserving node semantics and dependencies. Then, conversion is performed on incompatible items: if operator types do not match, the node is replaced with a runtime-supported node combination, maintaining input-output semantic consistency during replacement, and the output dimensions of each node after replacement are re-derived to ensure consistency with the input dimensions of subsequent nodes; if data precision does not match, the node precision is converted to supported data precision, and quantization parameters are generated simultaneously. The determination of quantization parameters is based on calibration statistics provided in the model package. The minimum and maximum values ​​of the node's activation range are read. The range is divided into continuous intervals according to the number of discrete values ​​with the target precision, and a discrete value mapping is assigned to each interval to form a transformation mapping table. When the tensor layout is mismatched, layout transformation nodes are inserted before and after the node. The layout transformation nodes are implemented by rearranging the storage order of elements within the tensor. The rearrangement process is based on the tensor's dimension step table, mapping the linear index of the original layout to the linear index of the target layout, and generating transport segments according to the mapping order. When alignment is not satisfied, the buffer plan is updated according to the aforementioned padding calculation results, and the read / write offset descriptions of all affected nodes are updated. After the transformation is completed, the target operator graph is obtained. The target operator graph has no incompatibility reasons at the node level, and the dependent edges remain connected.

[0081] Edge monitoring devices perform instruction optimization and rearrangement on the target operator graph to determine the appropriate instruction sequence. This process begins with backend selection: for each operator node, it is determined whether to enter the acceleration backend based on the acceleration unit type and availability status. Entry conditions are that the node's operator type is in the acceleration backend's supported list and the acceleration unit's availability status is available; those not selected enter the general-purpose processor backend. Subsequently, graph-level optimization is performed, including fusion and constant folding. The fusion process involves scanning adjacent node links in the target operator graph. When there is no branch convergence between adjacent nodes and the intermediate tensor is only used by a single downstream path, multiple nodes are merged into one execution block. After merging, the input and output dimensions of the execution block are recalculated, and the lifetime of the intermediate tensor in the execution block is recalculated for subsequent memory reuse. The constant folding process identifies subgraphs whose input consists entirely of constants. During the loading phase, the subgraph is pre-calculated, and its output is used as a constant parameter in the execution of subsequent nodes, thereby reducing runtime computation. Memory reuse planning is then executed, based on the tensor lifecycle, which is derived from the node topology order: the allocation time of a tensor is the start time of the node that generated the tensor, and the release time is the end time of the last node that used the tensor; all tensors are sorted by allocation time, and address segments are allocated to tensors in sequence; when a new tensor is allocated, an address segment that meets the capacity and alignment requirements is searched in the already released address segments and reused, otherwise a new address segment is allocated; capacity verification is completed by comparing the number of bytes converted from the tensor element count and bit width with the address segment length, and alignment verification is completed by dividing the number of aligned bytes by the remainder. After memory planning is completed, instruction-level optimization begins. Instruction-level optimization first determines the vectorized block length based on the vector instruction width. The block length is the number of elements that the vector instruction width can process in parallel. For convolution and matrix multiplication nodes, output channels are grouped according to the block length to form the main loop. The main loop processes one group of output channels at a time, and channels with fewer than one group form the tail loop. The iteration count of the main loop and tail loop is obtained by dividing the number of output channels by the block length and rounding down. The number of tail channels is obtained by subtracting the product of the main loop count and the block length from the number of output channels, and the tail loop count is generated accordingly. Memory access reordering is then performed: the weight access order is continuously planned according to the number of cache lines of bytes. This continuous planning organizes the linear addresses of weight tensors in memory in an ascending order of adjacent elements, prioritizing the continuous storage of weights within the same output channel group. Input feature map access is organized in a sliding order with a step size, ensuring continuous access within the same line and reducing cross-line jumps. For fusion execution blocks, the sub-segments that generate intermediate results are executed adjacently to reduce the time intermediate tensors remain outside the cache.After completing the above optimizations, the execution block corresponding to each node is expanded into an adaptation instruction sequence. The adaptation instruction sequence records the instruction block number, input buffer address segment, output buffer address segment, weight address segment, quantization parameter address segment, and synchronization barrier position according to the execution order. It also records the expected number of bytes to be read and written and the expected number of computation steps for each instruction block. The expected number of bytes to be read and written is calculated by combining the number of tensor elements involved in the instruction block with the bit width. The expected number of computation steps is calculated by converting the number of operations of the instruction block according to the vector block length. This is used for runtime scheduling verification.

[0082] The edge monitoring device uses an adaptation instruction sequence to load the edge inference model. The loading process is as follows: During inference runtime, the target operator graph, adaptation instruction sequence, weight data, and quantization parameters are read. First, runtime buffer address segments are allocated according to memory reuse planning, and an address mapping table is established. The address mapping table records the correspondence between logical tensor identifiers and physical address segments. Then, the weight data and quantization parameters are loaded into the specified address segments. The loading process is completed by continuously copying address segments, and the byte length and alignment byte number are checked before and after copying to ensure they meet the planning. After loading is completed, the operator scheduling table is registered. The operator scheduling table associates the backend implementation entry and input / output address segments according to the instruction block number, so that runtime is scheduled in sequence. After loading is complete, inference execution begins: When air monitoring data arrives, input preprocessing is performed first. Preprocessing includes missing value removal, dimension normalization, and input tensor layout transformation. Missing value removal is achieved by filtering out invalid flags in the sampling sequence. Dimension normalization is achieved by subtracting the baseline value of the channel from the original sampled value and then dividing by the channel's scale factor. The baseline value and scale factor are provided by the device calibration parameter table. Layout transformation is completed by rearranging elements according to the input layout requirements of the target operator graph. After preprocessing, runtime executes instruction blocks one by one according to the adaptation instruction sequence. During execution, data is read and written according to the input and output address segments recorded in the instruction blocks. The execution order across back-ends is kept consistent according to the synchronization barrier position to obtain the pollution identification output tensor. Finally, output postprocessing is performed, comparing the scores of each category in the output tensor, selecting the category index with the highest score as the pollution category determination, and mapping this category index to air quality level and pollution type text. The mapping relationship is provided by the category dictionary accompanying the model package. The air quality monitoring results of the air monitoring data are generated, and the results are output according to the device reporting strategy.

[0083] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A lightweight inference method for edge-cloud collaborative air monitoring models, characterized in that, include: S1. Obtain the hardware configuration data of the target edge monitoring device, collect detailed data on processor load boundaries, memory usage thresholds and energy consumption budget limits, determine the specific numerical range of hardware latency upper limit and storage access frequency by parsing the device operation logs and real-time monitoring, and upload the hardware configuration data to the cloud collaborative processing platform. S2. In the cloud-based collaborative processing platform, a multi-dimensional hardware constraint framework is constructed based on the hardware latency limit and memory usage threshold. This framework integrates heat dissipation performance constraints and task priority allocation limitations. Through analysis of hardware compatibility requirements, a set of boundary conditions for the resource usage of the quantified device is obtained. S3. In the cloud-based collaborative processing platform, a pre-trained air quality monitoring benchmark model is used as the initial input. A preliminary analysis is conducted on its network layer simplification mode and parameter sparsity. By analyzing the hierarchical structure of the model, its adaptability under hardware constraints is determined, and the preliminary compression requirement range is identified. S4. Based on the initial compression requirement range, start the search in the preset compression strategy combination mode, integrate the pruning rate adjustment range and quantization bit number option, and obtain a set of candidate model compression schemes by applying the operation unit pruning rules layer by layer. S5. For each candidate model compression scheme, estimate its performance under the hardware latency limit and storage access frequency in the cloud collaborative processing platform. If the estimated result exceeds the processor load boundary in the hardware constraint framework, the scheme is eliminated. By comparing them one by one, determine the set of compression schemes that meet the resource constraints.

2. The lightweight inference method for edge-cloud collaborative air monitoring model according to claim 1, characterized in that: S1 includes: Obtain the raw hardware configuration data of the target edge monitoring device. The raw hardware configuration data includes processor load boundaries, memory usage thresholds, and power consumption budget limits. Analyze the device operation logs based on the energy consumption budget limits in the original hardware configuration data to determine the upper limit of hardware latency; The processor load boundary is dynamically mapped using the hardware latency limit, and the specific numerical range of the storage access frequency is determined by combining the memory usage threshold. Enhanced hardware configuration data is obtained by characterizing the original hardware configuration data by specifying the numerical range of storage access frequency. This will enhance the uploading of hardware configuration data to the cloud-based collaborative processing platform, enabling hardware configuration data collection and cloud-based collaborative processing.

3. The lightweight inference method for edge-cloud collaborative air monitoring model according to claim 1, characterized in that: S2 includes: The hardware latency limit and memory usage threshold are obtained from the cloud-based collaborative processing platform. By integrating heat dissipation performance constraints, the hardware latency limit and memory usage threshold are subjected to multi-dimensional mapping processing to obtain the initial constraint framework structure. Based on the initial constraint framework structure, the task priority allocation constraints are dynamically adjusted to determine the basic dataset for hardware compatibility requirements analysis. The hardware compatibility requirements are quantitatively evaluated by analyzing the basic dataset. If the evaluation results exceed the preset threshold, the constraints are integrated to obtain the intermediate value of the resource usage boundary. To obtain relevant indicators of the set of equipment resources based on the intermediate value of resource usage boundaries, a set of boundary conditions is formed through iterative optimization of a multi-dimensional constraint framework. The data uploaded to the cloud processing platform is verified for compatibility based on the set of boundary conditions, thereby obtaining the set of boundary conditions for the quantification device in terms of resource usage.

4. The lightweight inference method for edge-cloud collaborative air monitoring model according to claim 1, characterized in that: S3 includes: A pre-trained air quality monitoring benchmark model is obtained from a cloud-based collaborative processing platform. The model's network layer simplification mode and parameter sparsity are preliminarily analyzed. The model structure is processed through hierarchical parsing technology to determine its adaptability under hardware constraints, and a preliminary evaluation dataset for compressing the scope of requirements is obtained. Based on the simplified network layer pattern of the air quality monitoring benchmark model fused with the evaluation base dataset, the sparsity of parameters is subjected to multi-dimensional quantification. Through the compatibility mapping of the hardware constraint framework, the hierarchical resolution adjustment value of the model structure is determined. The hierarchical parsing adjustment value is compared with a preset adaptability threshold. If the comparison result exceeds the threshold, the sparsity of the fusion parameters is iteratively optimized through the network layer simplification mode to obtain an intermediate index set that compresses the demand range. The adaptability of the pre-trained air quality monitoring benchmark model is verified based on the intermediate index set. The preliminary compression requirement range is determined by comprehensively processing the network layer simplification mode and the sparsity of the parameters.

5. The lightweight inference method for edge-cloud collaborative air monitoring model according to claim 1, characterized in that: S4 includes: Extract the hierarchical topology of the air quality monitoring benchmark model from the initial compression demand range, retrieve the operator distribution characteristics that match the hierarchical topology from the preset compression strategy combination, and determine the pruning rate adjustment range. Based on the pruning rate adjustment range, the weight tensor of the air quality monitoring benchmark model is sparsely mapped to obtain the quantization bit number option. By discretizing the numerical distribution of the weight tensor, the quantized weight distribution matrix is ​​obtained. The computational unit pruning rule is applied to the quantized weight distribution matrix. If the computational unit pruning rule conflicts with the convolution kernel size of the air quality monitoring benchmark model, the pruned neuron connection mapping table is determined by adjusting the stride parameter of the convolution kernel. The structure of each layer of the air quality monitoring benchmark model is restructured using the pruned neuron connection map. By performing bit-width alignment on the restructured network layers, a set of candidate model compression schemes are obtained.

6. The lightweight model inference method for edge-cloud collaborative air monitoring according to claim 1, characterized in that: S5 includes: The configuration information in the candidate compression scheme set is mapped to the virtual simulation environment of the cloud collaborative processing platform to obtain the hardware latency estimate corresponding to the configuration information; The estimated hardware latency is compared with the upper limit of hardware latency. If the estimated hardware latency is less than the upper limit of hardware latency, the memory address mapping sequence corresponding to the configuration information is extracted. The storage access frequency is determined based on the memory address mapping sequence, and the storage access frequency is matched with the bandwidth threshold to obtain the storage pressure assessment result; The storage pressure assessment results are converted into a processor load prediction vector. If the processor load prediction vector is within the processor load boundary, a set of compression schemes that meet the resource constraints is determined.

7. The lightweight inference method for edge-cloud collaborative air monitoring model according to claim 1, characterized in that, This also includes S6, which generates corresponding simplified models one by one from a set of compression schemes that meet resource constraints, performs calibration data tests on the accuracy loss and inference speed improvement after compression, and obtains the performance data of each simplified model in the contamination identification task, specifically including: Configuration parameters are extracted from a set of compression schemes that meet resource constraints, and a simplified model sequence is generated on a cloud-based collaborative processing platform to obtain the structural simplification index of each model in the simplified model sequence. Accuracy loss is calculated based on structural simplification indices, and the deviation between the accuracy loss value and the original model is compared. A deviation comparison result-driven inference speed improvement evaluation mechanism is adopted to determine the time-saving vector corresponding to the inference speed improvement. By jointly mapping the time-saving vector and the accuracy loss value, a performance data matrix for each simplified model is constructed. If the number of elements in the presentation data matrix exceeds the preset contamination identification threshold, a data calibration iteration is triggered to adjust the internal correlation of the presentation data matrix. The performance data of each simplified model in the pollution identification task is summarized based on the adjusted performance data matrix.

8. The lightweight model inference method for edge-cloud collaborative air monitoring according to claim 7, characterized in that, This also includes S7. Based on the performance data of each simplified model, and considering its compliance with memory usage thresholds and energy consumption budget constraints, a weighted sorting mechanism is used to determine a final deployment version that balances accuracy and resource consumption in the cloud-based collaborative processing platform. Specifically, this includes: Obtain the performance data matrix for each simplified model, and extract the corresponding precision feature vector and resource consumption feature from the performance data matrix; Hardware mapping analysis is performed based on resource consumption characteristics to obtain the memory usage and energy consumption budget values ​​corresponding to each simplified model. If the memory usage value does not exceed the preset memory usage threshold and the energy consumption budget value does not exceed the preset energy consumption budget limit, then the corresponding precision feature vector is input into the pre-established weighted sorting mechanism to obtain the initial sorting sequence. A balance score set is obtained by calculating the balance between precision and resource consumption of the elements in the initial sorted sequence. The highest score is matched using a set of balance scores on a cloud-based collaborative processing platform to determine a final deployment version that balances accuracy and resource consumption.

9. The lightweight model inference method for edge-cloud collaborative air monitoring according to claim 8, characterized in that, This also includes S8, distributing the final deployment version to the target edge monitoring device, and, based on hardware compatibility requirements and task priority allocation rules, adapting and loading the model on the target edge monitoring device through format conversion and instruction optimization. Finally, the final deployment version is used to perform pollution identification and inference on the collected air monitoring data to generate air quality monitoring results, specifically including: Obtain the hardware architecture description file, and parse the initial operator graph based on the hardware architecture description file; The initial operator graph that does not meet compatibility requirements is format-converted to obtain the target operator graph.

10. The lightweight model inference method for edge-cloud collaborative air monitoring according to claim 9, characterized in that: S8 further includes: The target operator graph is optimized and rearranged to determine the appropriate instruction sequence; An edge inference model is obtained by loading an adaptation instruction sequence. The edge inference model is then used to infer air quality monitoring data and generate air quality monitoring results.