Iot device adaptive control method and system based on web front-end edge computing

CN120812101BActive Publication Date: 2026-09-25浪潮智慧城市科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510799406.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2026-09-25
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

[0006]本发明的技术任务是提供一种基于Web前端边缘计算的物联网设备自适应控制方法及系统,来解决传统云端控制方案延迟高、弱网不可用及边缘硬件部署成本高的问题

Benefits of technology

[0042](一)本发明针对传统云端控制方案延迟高、弱网不可用及边缘硬件部署成本高等问题,提出将边缘计算能力下沉至浏览器端的技术架构,支持自适应网络环境、设备资源分配及用户交互;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120812101B_ABST
    Figure CN120812101B_ABST
Patent Text Reader

Abstract

The application discloses an Internet of Things device adaptive control method and system based on a Web front-end edge calculation, belongs to the cross technical field of the Internet of Things and the Web front-end, and aims at solving the technical problems of high delay, weak network unavailability and high edge hardware deployment cost of a traditional cloud control scheme.The technical scheme is as follows: browser end edge calculation node: the Web front-end creates an independent thread as a local calculation unit through a Web Worker, collects original data through flume and parses the original data into standard data, sends control instructions supported by a device to terminal equipment and the device through different protocols of the device, compiles high-performance algorithms into local WASM algorithms through Emscripten, loads and calls the local WASM algorithms by using JavaScript, and completes complex calculation in the Web Worker; network self-adaptation and dynamic task distribution; local device control strategy cache and offline execution; visual rule configuration and hot update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intersectional technology of Internet of Things (IoT) and Web front-end, specifically to an adaptive control method and system for IoT devices based on Web front-end edge computing. Background Technology

[0002] Adaptive control of IoT devices is a key direction in the development of IoT technology. It aims to enable devices to automatically optimize operating parameters based on environmental changes, user needs, or system status through intelligent algorithms and dynamic adjustment mechanisms, thereby improving system efficiency, reliability, and user experience. Traditional adaptive control of IoT devices suffers from the following pain points:

[0003] ① Traditional IoT device control relies on cloud servers, resulting in high latency (such as emergency response in industrial equipment) and unavailability in weak network environments (such as agricultural monitoring in remote areas), leading to regional limitations.

[0004] ② Existing edge computing solutions require the deployment of dedicated hardware (such as edge servers), which is costly and lacks flexibility.

[0005] ③ The browser only serves as a data display layer and cannot directly handle device control logic. User interaction and device response are disconnected, resulting in a poor user experience. Summary of the Invention

[0006] The technical objective of this invention is to provide an adaptive control method and system for IoT devices based on Web front-end edge computing, in order to solve the problems of high latency, unavailability in weak network conditions, and high deployment costs of edge hardware in traditional cloud control solutions.

[0007] The technical objective of this invention is achieved as follows: an adaptive control method for IoT devices based on Web front-end edge computing, the method being as follows:

[0008] Browser-side edge computing nodeization: The web frontend creates independent threads as local computing units through Web Workers, collects raw data through Flume and parses it into standard data, sends control commands supported by the device to the terminal device and control device through different protocols of the device, and compiles high-performance algorithms into local WASM (WebAssembly) algorithms through Emscripten, uses JavaScript to load and call the local WASM algorithm, and completes complex calculations within the Web Worker, reducing reliance on the cloud;

[0009] Network Adaptation and Dynamic Task Allocation: A lightweight rule engine framework is implemented using JavaScript. Adaptive rules are stored in the browser's IndexedDB in JSON format for easy offline access and updates. The network status is detected by listening to navigator.onLine or using fetch() timeout to determine whether to enable the local WASM algorithm. Service Worker is used to cache rule configuration files, and new rules are dynamically loaded via CDN.

[0010] Local device control policy caching and offline execution: The device control logic is stored in the browser's IndexedDB in the form of a JSON rule chain; in offline mode, the front end directly drives the device through the WebSocket simulation layer.

[0011] Visual rule configuration and hot update: Based on the visual rule configuration interface of Blockly or Node-RED, users can drag and drop to generate control logic and support hot rule updates, that is, device manufacturers distribute new rules through CDN (Content Delivery Network) and the front end dynamically loads them through Cache API.

[0012] As a preferred option, the different protocols used by the device include TCP, UDP, and HTTP;

[0013] High-performance algorithms include OpenCV face recognition algorithm and FFT vibration analysis algorithm.

[0014] As a preferred approach, during network adaptation and dynamic task allocation, the network bandwidth and latency are detected through the Navigator.connection API of the service worker, and the network status is determined as follows:

[0015] In a strong network environment, the raw data is uploaded to the cloud to perform AI analysis (such as TensorFlow model inference), and cloud models (such as TensorFlow Serving, ONNX Runtime, PyTorch Serve) are used for inference and the results are returned.

[0016] In weak network and offline environments, local AI models (such as simplified OpenCV face detection or a WASM version of TensorFlow.js) are loaded using WebAssembly, and the local WASM algorithm is run in the Web Worker to complete inference tasks, reducing main thread blocking. Specifically, local WASM algorithm degradation processing (such as simplified face detection) is triggered, data compression (such as Protocol Buffers instead of JSON) is enabled, and local computation degradation is implemented. That is, when network conditions are poor or offline and cloud computing cannot be relied upon, the locally deployed local WASM algorithm is used to replace the complete cloud AI model for basic-level intelligent analysis.

[0017] More preferably, for different network environments, the implementation path of dynamic task allocation is as follows: compile algorithms with different precision levels into multiple local WASM algorithms, and select one of the local WASM algorithms to be called according to the network status.

[0018] Preferably, a rule chain is a set of rules executed sequentially or in logical combination to describe the device control process, as follows:

[0019] First, edit the rule chain using a visual rule editing interface (such as Blockly / Node-RED);

[0020] Then the graphical rules are serialized into a JSON structure;

[0021] Finally, the JSON file is stored in the browser's IndexedDB.

[0022] As a preferred option, the WebSocket emulation layer supports the following features:

[0023] It replaces the native TCP / UDP protocol stack to achieve control over local devices;

[0024] Simulate underlying communication protocols (such as MQTT over WebSocket) in a browser;

[0025] Supports local message queues and retry mechanisms in offline mode;

[0026] The WebSocket simulation layer is implemented as follows: a Paho-MQTT client is used to connect to the local MQTTBroker. If the browser does not support direct access to the device, the local gateway in the local area network (such as a Raspberry Pi) is used as a proxy to forward WebSocket messages to the serial port device.

[0027] As a preferred approach, the web frontend uses Web Workers to create independent threads as local computing units and selects a specific algorithm to perform the computation. The specific algorithm depends on the required scenario, as follows:

[0028] For intelligent security scenarios, use OpenCV's Haar classifier or a lightweight CNN model for face detection;

[0029] For industrial monitoring scenarios, signal analysis and anomaly detection are achieved through Fast Fourier Transform (FFT), wavelet analysis, and sliding window statistics.

[0030] For environmental perception scenarios, data fusion and filtering are achieved through Kalman filtering, moving average, and threshold detection.

[0031] For smart home scenarios, a simple classifier and state machine logic based on sensor data are used to achieve behavior recognition and pattern matching.

[0032] An adaptive control system for IoT devices based on Web front-end edge computing, the system being used to implement the adaptive control method for IoT devices based on Web front-end edge computing as described above; the system includes:

[0033] The front-end layer uses IndexedDB to store device rule chains and historical data, replacing the traditional cloud database. It uses Service Worker to monitor network status and route requests to determine device rules under real-time network conditions. It also uses Web Worker and local WASM algorithm to process device data, run control algorithms, and generate corresponding commands for control.

[0034] The device layer is used to communicate with the browser via WebSocket / MQTT or other protocols, supports HTTP / CoAP protocols, and stores the device control logic in the browser's IndexedDB in the form of JSON rule chains; in offline mode, the front end directly drives the device through the WebSocket simulation layer.

[0035] As a preferred option, a network-state-aware rule engine is deployed at the front-end layer. The rule engine is used to set rules at different levels and dynamically allocate tasks according to the different levels.

[0036] The rules engine also has the following functions:

[0037] ① Condition judgment means triggering an action based on the equipment status (such as temperature > 30℃), time, and location.

[0038] ② Network status awareness, i.e., automatically switching between local and / or cloud computing paths;

[0039] ③Task scheduling is the allocation of computing tasks based on priority or resource availability.

[0040] Even better, the system also includes a cloud layer, which receives data reported by the front-end layer and performs resource-intensive tasks (such as AI training).

[0041] The adaptive control method and system for IoT devices based on Web front-end edge computing of the present invention has the following advantages:

[0042] (i) This invention addresses the problems of high latency, unavailability in weak networks, and high deployment costs of edge hardware in traditional cloud control solutions. It proposes a technical architecture that pushes edge computing capabilities down to the browser end, supporting adaptive network environment, device resource allocation, and user interaction.

[0043] (ii) This invention brings edge computing capabilities down to the browser end, uses Web front-end technology to realize local processing and real-time control of device data, and dynamically allocates computing tasks (local / cloud) according to network status and device resources. It also supports autonomous device response in offline scenarios, improving system responsiveness.

[0044] (III) The present invention has low latency and high real-time performance: the browser directly processes device data, and the control command response time is ≤50ms (the traditional solution is ≥200ms);

[0045] (iv) This invention achieves high availability in weak network / offline environments: it ensures that the basic functions of the device are not interrupted through a rule engine;

[0046] (v) This invention achieves privacy protection: sensitive data (such as facial data) does not need to be uploaded to the cloud, but can be processed locally;

[0047] (vi) This invention enables flexible deployment: no dedicated edge hardware is required, only modern browser support (Chrome / Edge, etc.);

[0048] (vii) This invention has the advantage of being developer-friendly: visual rule configuration reduces the threshold for IoT development;

[0049] (viii) This invention enables local processing of device data through Web Worker and WebAssembly on the browser side, dynamically allocates computing tasks to the local or cloud location through Service Worker, and supports offline control of the device through a pre-set rule chain through local WASM. Attached Figure Description

[0050] The invention will be further described below with reference to the accompanying drawings.

[0051] Appendix Figure 1This is a flowchart of an adaptive control method for IoT devices based on Web front-end edge computing. Detailed Implementation

[0052] The adaptive control method and system for IoT devices based on Web front-end edge computing of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0053] Example 1:

[0054] As attached Figure 1 As shown, this embodiment provides an adaptive control method for IoT devices based on Web front-end edge computing. The method is as follows:

[0055] S1. Browser-side edge computing nodeization: The web frontend creates independent threads as local computing units through Web Workers. It collects raw data through Flume and parses it into standard data. It sends control commands supported by the device to the terminal device and control device through different protocols of the device, such as adjusting the brightness of smart lighting and turning off abnormal motors. It also compiles high-performance algorithms into local WASM (WebAssembly) algorithms through Emscripten. JavaScript loads and calls the local WASM algorithm to complete complex calculations within the Web Worker, reducing reliance on the cloud. The different protocols of the device include TCP, UDP and HTTP; the high-performance algorithms include OpenCV face recognition algorithm and FFT vibration analysis algorithm.

[0056] S2, Network Adaptation and Dynamic Task Allocation: A lightweight rule engine framework is implemented using JavaScript. Adaptive rules are stored in the browser's IndexedDB in JSON format for easy offline access and updates. The network status is detected by listening to navigator.onLine or using fetch() timeout to determine whether to enable the local WASM algorithm. Service Worker is used to cache rule configuration files, and new rules are dynamically loaded via CDN.

[0057] S3. Local device control policy caching and offline execution: The device control logic (such as "start the fan when the temperature is >30℃") is stored in the browser's IndexedDB in the form of a JSON rule chain; in offline mode, the front end directly drives the device through the WebSocket simulation layer (such as sending control commands through MQTT over WebSocket);

[0058] S4. Visual rule configuration and hot update: Based on the visual rule configuration interface of Blockly or Node-RED, users can drag and drop to generate control logic and support hot rule updates. That is, device manufacturers distribute new rules through CDN (Content Delivery Network), and the front end dynamically loads them through the Cache API.

[0059] In step S2 of this embodiment, during the network adaptation and dynamic task allocation process, the network bandwidth and latency are detected through the Navigator.connection API of the service worker, and the network status is determined as follows:

[0060] In a strong network environment, the raw data is uploaded to the cloud to perform AI analysis (such as TensorFlow model inference), and cloud models (such as TensorFlow Serving, ONNX Runtime, PyTorch Serve) are used for inference and the results are returned.

[0061] In weak network and offline environments, local AI models (such as simplified OpenCV face detection or a WASM version of TensorFlow.js) are loaded using WebAssembly, and the local WASM algorithm is run in the Web Worker to complete inference tasks, reducing main thread blocking. Specifically, local WASM algorithm degradation processing (such as simplified face detection) is triggered, data compression (such as Protocol Buffers instead of JSON) is enabled, and local computation degradation is implemented. That is, when network conditions are poor or offline and cloud computing cannot be relied upon, the locally deployed local WASM algorithm is used to replace the complete cloud AI model for basic-level intelligent analysis.

[0062] In this embodiment, the implementation path for dynamic task allocation for different network environments is as follows: algorithms with different precision levels are compiled into multiple local WASM algorithms, and one of the local WASM algorithms is selected and called according to the network status.

[0063] In step S3 of this embodiment, the rule chain is a set of rules executed sequentially or in logical combination, used to describe the device control flow, as follows:

[0064] First, edit the rule chain using a visual rule editing interface (such as Blockly / Node-RED);

[0065] Then the graphical rules are serialized into a JSON structure;

[0066] Finally, the JSON file is stored in the browser's IndexedDB.

[0067] The WebSocket simulation layer in step S3 of this embodiment supports the following functions:

[0068] It replaces the native TCP / UDP protocol stack to achieve control over local devices;

[0069] Simulate underlying communication protocols (such as MQTT over WebSocket) in a browser;

[0070] Supports local message queues and retry mechanisms in offline mode.

[0071] The WebSocket simulation layer is implemented as follows: a Paho-MQTT client is used to connect to the local MQTTBroker. If the browser does not support direct access to the device, a local gateway (such as a Raspberry Pi) within the local area network can be used as a proxy to forward WebSocket messages to the serial port device.

[0072] In step S1 of this embodiment, the web frontend creates an independent thread as a local computing unit using Web Worker and selects a specific algorithm to perform the computation. The specific algorithm depends on the required scenario, as follows:

[0073] For intelligent security scenarios, use OpenCV's Haar classifier or a lightweight CNN model for face detection;

[0074] For industrial monitoring scenarios, signal analysis and anomaly detection are achieved through Fast Fourier Transform (FFT), wavelet analysis, and sliding window statistics.

[0075] For environmental perception scenarios, data fusion and filtering are achieved through Kalman filtering, moving average, and threshold detection.

[0076] For smart home scenarios, a simple classifier and state machine logic based on sensor data are used to achieve behavior recognition and pattern matching.

[0077] Example 2:

[0078] This embodiment provides an adaptive control system for IoT devices based on Web front-end edge computing. This system is used to implement the adaptive control method for IoT devices based on Web front-end edge computing as described in Embodiment 1. The system includes:

[0079] The front-end layer uses IndexedDB to store device rule chains and historical data, replacing the traditional cloud database. It uses Service Worker to monitor network status and route requests to determine device rules under real-time network conditions. It also uses Web Worker and local WASM algorithm to process device data, run control algorithms, and generate corresponding commands for control.

[0080] The device layer is used to communicate with the browser via WebSocket / MQTT or other protocols, supports HTTP / CoAP protocols, and stores the device control logic in the browser's IndexedDB in the form of JSON rule chains; in offline mode, the front end directly drives the device through the WebSocket simulation layer.

[0081] In this embodiment, the front-end layer deploys a network state-aware rule engine. The rule engine is used to set different levels of rules and dynamically allocate tasks according to different levels.

[0082] The rules engine also has the following functions:

[0083] ① Condition judgment means triggering an action based on the equipment status (such as temperature > 30℃), time, and location.

[0084] ② Network status awareness, i.e., automatically switching between local and / or cloud computing paths;

[0085] ③Task scheduling is the allocation of computing tasks based on priority or resource availability.

[0086] This embodiment also includes a cloud layer, which is used to receive data reported by the front-end layer and perform resource-intensive tasks (such as AI training).

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An adaptive control method for IoT devices based on Web front-end edge computing, characterized in that, The method is as follows: Browser-side edge computing nodeization: The web frontend creates independent threads as local computing units through Web Workers, collects raw data through Flume and parses it into standard data, sends control commands supported by the device to the terminal device and control device through different protocols of the device, and compiles high-performance algorithms into local WASM algorithms through Emscripten, loads and calls local WASM algorithms using JavaScript, and completes complex calculations within the Web Worker; Network Adaptation and Dynamic Task Allocation: A lightweight rule engine framework is implemented using JavaScript. Adaptive rules are stored in the browser's IndexedDB in JSON format for easy offline access and updates. The network status is detected by listening to navigator.onLine or using fetch() timeout to determine whether to enable the local WASM algorithm. Service Worker is used to cache rule configuration files, and new rules are dynamically loaded via CDN. Local device control policy caching and offline execution: The device control logic is stored in the browser's IndexedDB in the form of a JSON rule chain; in offline mode, the front end directly drives the device through the WebSocket simulation layer. Visual rule configuration and hot update: Based on the visual rule configuration interface of Blockly or Node-RED, users can drag and drop to generate control logic and support hot rule updates, that is, device manufacturers distribute new rules through CDN and the front end dynamically loads them through Cache API; During network adaptation and dynamic task allocation, the service worker's Navigator.connectionAPI is used to detect network bandwidth and latency and determine the network status, as follows: In a strong network environment, raw data is uploaded to the cloud for AI analysis, cloud models are used for inference, and results are returned. In weak network and offline environments, local AI models are loaded using WebAssembly, and local WASM algorithms are run in Web Workers to complete inference tasks, reducing main thread blocking. Specifically, local WASM algorithm degradation processing is triggered, and data compression and local computing degradation are enabled. That is, when network conditions are poor or offline and cloud computing cannot be relied upon, local WASM algorithms are used for basic-level intelligent analysis.

2. The adaptive control method for IoT devices based on Web front-end edge computing according to claim 1, characterized in that, The different protocols used by the device include TCP, UDP, and HTTP; High-performance algorithms include OpenCV face recognition algorithm and FFT vibration analysis algorithm.

3. The adaptive control method for IoT devices based on Web front-end edge computing according to claim 1, characterized in that, For different network environments, the implementation path of dynamic task allocation is as follows: algorithms with different precision levels are compiled into multiple local WASM algorithms, and one of the local WASM algorithms is selected and called according to the network status.

4. The adaptive control method for IoT devices based on Web front-end edge computing according to claim 1, characterized in that, A rule chain is a set of rules executed sequentially or in logical combinations to describe the device control process, as follows: First, edit the rule chain using the visual rule editing interface; Then the graphical rules are serialized into a JSON structure; Finally, the JSON file is stored in the browser's IndexedDB.

5. The adaptive control method for IoT devices based on Web front-end edge computing according to claim 1, characterized in that, The WebSocket simulation layer supports the following features: It replaces the native TCP / UDP protocol stack to enable control of local devices; Simulate low-level communication protocols in a browser; Supports local message queues and retry mechanisms in offline mode; The WebSocket simulation layer is implemented as follows: a Paho-MQTT client is used to connect to the local MQTT Broker. If the browser does not support direct access to the device, the local gateway in the local area network is used as a proxy to forward WebSocket messages to the serial port device.

6. The adaptive control method for IoT devices based on Web front-end edge computing according to claim 1, characterized in that, The web frontend uses Web Workers to create independent threads as local computing units and selects an algorithm to perform the computation. The specific algorithm depends on the required scenario, as follows: For intelligent security scenarios, use OpenCV's Haar classifier or a lightweight CNN model for face detection; For industrial monitoring scenarios, signal analysis and anomaly detection are achieved through fast Fourier transform, wavelet analysis, and sliding window statistics. For environmental perception scenarios, data fusion and filtering are achieved through Kalman filtering, moving average, and threshold detection. For smart home scenarios, a simple classifier and state machine logic based on sensor data are used to achieve behavior recognition and pattern matching.

7. An adaptive control system for IoT devices based on Web front-end edge computing, characterized in that, This system is used to implement the adaptive control method for IoT devices based on Web front-end edge computing as described in any one of claims 1 to 6; the system includes: The front-end layer uses IndexedDB to store device rule chains and historical data, uses Service Worker to monitor network status and route requests to determine device rules under real-time network conditions, and uses Web Worker and local WASM algorithm to process device data, run control algorithms, and generate corresponding commands for control. The device layer is used to communicate with the browser via WebSocket / MQTT or other protocols, supports HTTP / CoAP protocols, and stores the device control logic in the browser's IndexedDB in the form of JSON rule chains; in offline mode, the front end directly drives the device through the WebSocket simulation layer.

8. The adaptive control system for IoT devices based on Web front-end edge computing according to claim 7, characterized in that, The front-end layer deploys a network-state-aware rule engine, which is used to set rules at different levels and dynamically allocate tasks according to the different levels. The rules engine also has the following functions: ① Conditional judgment refers to triggering actions based on conditions such as equipment status, time, and location; ② Network status awareness, i.e., automatically switching between local and / or cloud computing paths; ③Task scheduling is the allocation of computing tasks based on priority or resource availability.

9. The adaptive control system for IoT devices based on Web front-end edge computing according to claim 8, characterized in that, The system also includes a cloud layer, which receives data reported by the front-end layer and performs resource-intensive tasks.

Citation Information

Patent Citations

  • Browser deep learning method and system based on WebAssembly

    CN111881401A