Lightweight edge runtime system based on WebAssembly

By introducing a lightweight edge runtime system based on WebAssembly in edge computing technology, the startup latency and insufficient performance problems on resource-constrained devices are solved, and an efficient, secure and flexible edge computing environment is achieved.

CN119883569AInactive Publication Date: 2025-04-25刘宇
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411995788.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing edge computing technologies have problems such as high startup delay, large resource usage, and insufficient performance on devices with limited resources, and are difficult to meet the needs of high concurrency and low latency.

Method used

Adopt a lightweight edge runtime system based on WebAssembly, which includes a lightweight container module and an edge optimization module. The lightweight container module achieves rapid startup and efficient isolation through instant compilation and preloading mechanisms, and the edge optimization module achieves efficient resource utilization and task processing through resource-aware scheduling and localized execution optimization.

Benefits of technology

It significantly reduces container startup delay, reduces resource usage, improves system response speed and resource utilization, enhances security and flexibility, and adapts to complex edge computing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005224499120000131
    Figure BDA0005224499120000131
  • Figure BDA0005224499120000132
    Figure BDA0005224499120000132
  • Figure BDA0005224499120000141
    Figure BDA0005224499120000141
Patent Text Reader

Abstract

The invention provides a lightweight edge runtime system based on WebAssessment. The lightweight edge runtime system based on WebAssessment is used for improving the computing efficiency and the resource utilization rate in an edge computing environment. The system comprises a lightweight container module and an edge optimization module. The lightweight container module is quickly started, resource overhead is minimized, efficient isolation is achieved, nearly instantaneous container starting is achieved through the instant compiling characteristic of WebAssembly, and efficient utilization of resources is achieved through a fine-grained resource allocation and recovery mechanism. And the edge optimization module realizes resource perception scheduling, localized execution optimization and elastic telescoping, optimizes task allocation and execution by monitoring the resource state of the equipment in real time, and supports multi-equipment cooperative work. The system has the advantages that the resource occupation of the edge equipment is remarkably reduced, the calculation efficiency is improved, the security and expandability of the system are enhanced, and an efficient and flexible edge calculation solution is provided for the fields of the Internet of Things, smart home and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing technology, and in particular to a lightweight edge runtime system based on WebAssembly. The system aims to improve the computing efficiency, resource utilization and security of edge devices, and is suitable for application scenarios such as the Internet of Things, smart homes, and industrial automation that require efficient edge computing. Background Art

[0002] As an emerging distributed computing paradigm, edge computing has important applications in the fields of Internet of Things, smart home, industrial automation, etc. It effectively reduces data transmission delays, improves real-time performance and security, and reduces bandwidth consumption by sinking computing and data processing capabilities to the edge of the network. With the popularization of 5G technology and the rapid growth of IoT devices, edge computing plays an increasingly important role in improving user experience, optimizing network performance, and realizing intelligent applications.

[0003] At present, the edge computing field mainly adopts solutions based on container technology. Container platforms such as Docker have become one of the mainstream technologies for edge computing due to their lightweight and highly portable characteristics. These solutions enable rapid deployment and flexible management of applications by packaging applications and their dependencies into standardized containers. Another common technology is the virtual machine (VM) based edge computing solution, which provides a higher level of isolation and security by creating a virtualized environment on physical hardware.

[0004] However, these solutions still have some problems in edge computing environments. Although container technology is relatively lightweight, it may still face problems such as high startup latency and large resource usage on resource-constrained edge devices. Virtual machine solutions, due to their heavier architecture, are often difficult to run efficiently on resource-constrained edge devices. In addition, these two solutions may not meet performance requirements when processing high-concurrency, low-latency edge computing tasks, especially in scenarios that require fast response.

[0005] To solve the above problems, some studies have proposed lightweight virtualization technology based on unikernel, trying to reduce system overhead while maintaining isolation. Although this method has improved resource utilization and startup speed to a certain extent, it still faces many challenges in practical applications due to its special development model and limited ecosystem support. At the same time, with the complexity of edge computing applications, the requirements for the flexibility, security and performance of the runtime environment are also increasing.

[0006] Therefore, there is an urgent need for a new solution that can provide an efficient, secure, and flexible runtime environment on resource-constrained edge devices. This solution should be able to meet the low latency and high concurrency requirements of edge computing, while having good portability and scalability. Developing a lightweight edge runtime system that can effectively address the limitations of existing technologies has become a research hotspot and development trend in this field. Summary of the invention

[0007] The purpose of the present invention is to solve the problems of high startup delay, large resource occupation, insufficient performance, etc. in the existing edge computing technology. In addition, the present invention also aims to improve the security, flexibility and scalability of the edge computing environment to meet the increasingly complex edge computing application requirements.

[0008] To achieve the above objectives, the present invention provides a lightweight edge runtime system based on WebAssembly, characterized in that it includes a lightweight container module and an edge optimization module, which work together to provide an efficient and secure operating environment on edge devices. In some embodiments, the system can be applied to scenarios that require efficient edge computing, such as the Internet of Things, smart homes, and industrial automation.

[0009] Specifically, the lightweight container module is used to achieve fast startup, minimize resource overhead, and efficient isolation. This module uses the just-in-time compilation feature of WebAssembly to achieve nearly instantaneous container startup, significantly reducing startup latency.

[0010] Furthermore, the edge optimization module is used to implement resource-aware scheduling, localized execution optimization, and elastic scaling. This module improves the overall efficiency of the system by monitoring the resource status of edge devices in real time, optimizing task allocation and execution.

[0011] Preferably, the lightweight container module includes a preloading and caching mechanism to reduce resource initialization time at startup, and a lazy loading strategy to load necessary components only when needed, further optimizing system performance.

[0012] Optionally, the lightweight container module also includes a fine-grained resource allocation mechanism and a resource recycling mechanism to minimize resource overhead. These mechanisms can allocate resources such as CPU and memory on demand and release unused resources in a timely manner.

[0013] In one embodiment, the lightweight container module also includes a WebAssembly-based memory safety isolation mechanism, a lightweight network isolation mechanism, and a file system isolation mechanism, which work together to achieve an efficient and secure isolation environment.

[0014] In some embodiments, the edge optimization module includes an edge device resource monitoring system, an intelligent scheduling algorithm based on resource status, and a dynamic resource allocation mechanism. These components can sense the device resource status in real time, optimize task allocation and execution, and dynamically adjust resource allocation according to demand.

[0015] In addition, the present invention can also achieve localized execution optimization through data localization processing mechanism, edge computing task decomposition algorithm and local cache mechanism, reduce data transmission overhead and improve processing efficiency.

[0016] In other embodiments, the edge optimization module may include a dynamic load balancing mechanism, a horizontal expansion mechanism, and a vertical expansion mechanism to support the collaborative operation of multiple edge devices and dynamically adjust the resource allocation of a single device according to task requirements.

[0017] In a preferred embodiment, the system uses a lightweight container module to achieve fast startup and efficient isolation, while using an edge optimization module for resource-aware scheduling and localized execution optimization. This combination not only significantly reduces startup latency and resource usage, but also improves the overall performance and efficiency of edge computing.

[0018] In another preferred embodiment, the system utilizes the sandbox characteristics and memory safety mechanism of WebAssembly, combined with customized network and file system isolation technology, to achieve an isolated environment that is lighter and more secure than traditional containers, which is particularly suitable for running on resource-constrained edge devices. By adopting the above scheme, the present invention has the following beneficial effects: 1. Significantly reduced container startup delay, achieved near-instant startup, and improved system response speed; 2. Greatly reduced resource usage and improved resource utilization through fine-grained resource management and recycling mechanisms; 3. Enhanced system security, using WebAssembly's security features and custom isolation mechanisms to provide a more reliable operating environment; 4. Improved edge computing efficiency, achieved more efficient task processing through resource-aware scheduling and localized execution optimization; 5. Enhanced the scalability and flexibility of the system, supporting multi-device collaboration and dynamic resource allocation, and adapting to complex edge computing scenarios.

[0019] In summary, the present invention provides an efficient, secure, flexible and lightweight edge runtime system, which effectively solves the main challenges faced by existing edge computing technologies, provides strong technical support for edge computing applications in the fields of Internet of Things, smart home, etc., and has important practical application value and broad development prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is the overall architecture diagram of the lightweight edge runtime system. It shows how the lightweight container module and edge optimization module work together through a unified interface layer, and their relationship with edge devices and cloud services.

[0022] Figure 2 It is a detailed structural diagram of the lightweight container module. It describes the internal components of the fast start engine, resource manager, and isolation controller, and how they interact with the WebAssembly runtime, hardware resources, and security policies.

[0023] Figure 3 This is a diagram of the edge optimization module. It shows the internal structure of the resource-aware scheduler, localized execution optimizer, and elastic scaling controller, and how they interact with edge device resources, data storage, and cluster management systems.

[0024] Figure 4 It is an implementation diagram of WebAssembly integration. It describes the memory management optimization, JIT compilation optimization, and asynchronous I / O support of the WebAssembly runtime environment, and how they are integrated with the lightweight container module and edge optimization module.

[0025] Figure 5 It is a structural diagram of the resource management system. It shows the internal components of the fine-grained resource allocation mechanism, resource recycling mechanism, and dynamic resource allocation mechanism, and how they interact with hardware resources, system monitoring, and load analysis.

[0026] Figure 6 It is an implementation diagram of the isolation system. It describes the specific implementation of the memory safety isolation mechanism, network isolation mechanism, and file system isolation mechanism, as well as how they interact with hardware memory, network resources, and storage resources.

[0027] Figure 7 It is a composition diagram of the task optimization system. It shows the internal structure of the edge computing task decomposition algorithm, data localization processing mechanism, and local cache mechanism, and how they interact with task input, data storage, and memory resources.

[0028] Figure 8It is an architectural diagram of a multi-device collaborative system. It describes the specific implementation of dynamic load balancing mechanism, horizontal expansion mechanism and vertical expansion mechanism, and how they interact with network resources, device resource pool and single device resources to jointly manage edge device clusters. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.

[0031] Example 1: Basic system architecture.

[0032] This embodiment provides a basic architecture of a lightweight edge runtime system based on WebAssembly, such as Figure 1 The system mainly includes two core modules: a lightweight container module 10 and an edge optimization module 20. The two modules work together to form an efficient, secure and flexible edge computing environment.

[0033] The lightweight container module 10 is the foundation of this system. It is responsible for providing a lightweight and efficient container operating environment. This module uses the sandbox characteristics and just-in-time compilation capabilities of WebAssembly to achieve fast container startup and efficient isolation mechanism. Specifically, the lightweight container module 10 includes the following key components:

[0034] Fast Start Engine 11: This engine is based on WebAssembly's just-in-time compilation technology and can quickly complete container initialization and startup. It reduces container startup latency through precompilation and caching mechanisms.

[0035] Resource manager 12: responsible for refined resource allocation and recycling. It adopts a dynamic resource allocation algorithm and can adjust the allocation of resources such as CPU and memory in real time according to application requirements to improve resource utilization.

[0036] Isolation controller 13: Implements memory safety isolation, lightweight network isolation, and file system isolation based on WebAssembly. This multi-level isolation mechanism not only ensures the security between containers, but also reduces isolation overhead.

[0037] The edge optimization module 20 is the core innovation of this system. It fully utilizes the computing power of edge devices through a series of intelligent optimization strategies to improve the overall system efficiency. This module mainly includes the following components:

[0038] Resource-aware scheduler 21: monitors the resource status of edge devices in real time, including CPU utilization, memory usage, network bandwidth, etc. Based on this information, the scheduler uses algorithms to dynamically optimize task allocation to balance the overall system load and improve resource utilization efficiency.

[0039] Localized Execution Optimizer 22: Through intelligent data analysis and task decomposition, computing tasks are executed locally as much as possible to reduce data transmission and network latency. This optimization can reduce network transmission volume and improve the response speed of edge computing.

[0040] Elastic scaling controller 23: Dynamically adjusts system resource allocation and task distribution according to real-time load conditions. It supports horizontal expansion (multi-device collaboration) and vertical expansion (dynamic adjustment of single device resources), enabling the system to flexibly respond to load changes and maintain stable performance.

[0041] The two core modules interact and collaborate through a unified interface layer 30. The interface layer 30 not only ensures efficient communication between modules, but also provides a standardized API to facilitate the integration and expansion of third-party applications.

[0042] In actual applications, when an edge computing task arrives, the system workflow is as follows: 1. The task is first received and parsed by the interface layer 30. 2. The resource-aware scheduler 21 of the edge optimization module 20 evaluates the current system resource status and task requirements. 3. The scheduler 21 determines the best execution strategy for the task, which may involve local execution, task decomposition, or multi-device collaboration. 4. If the decision is made to execute locally, the localized execution optimizer 22 performs further optimization, such as data localization processing. 5. The quick start engine 11 of the lightweight container module 10 quickly initializes a new container environment. 6. The resource manager 12 allocates required resources to the container, and the isolation controller 13 ensures the secure isolation of the container. 7. The task is executed in the optimized container environment. 8. During the execution process, the elastic scaling controller 23 continuously monitors and adjusts resource allocation. 9. After the task is completed, the resources are recovered in time and the system returns to standby status.

[0043] This architecture design not only achieves efficient edge computing, but also has strong flexibility and scalability. For example, in the IoT scenario, this system can process real-time data streams from multiple sensors and quickly complete data analysis and response. In smart home applications, the system can run on a home gateway device, coordinate and manage multiple smart devices, and provide near-real-time intelligent control and data processing capabilities.

[0044] It should be emphasized that the innovation of this invention is not only to combine WebAssembly technology with edge computing, but also to create a new edge computing paradigm through a unique lightweight container design and intelligent edge optimization strategy. This paradigm aims to break through the limitations of traditional edge computing in performance, efficiency and flexibility, and open up new possibilities for future edge computing applications.

[0045] The system architecture described in this embodiment can be flexibly adjusted and expanded according to specific application requirements. For example, resource management strategies can be customized according to the characteristics of different edge devices; special optimization modules can be developed for the needs of specific industries. This scalability enables the system to adapt to various complex edge computing scenarios, providing broad space for future technology development and application innovation.

[0046] Embodiment 2: Lightweight container module.

[0047] This embodiment describes in detail the implementation of a lightweight container module in a lightweight edge runtime system based on WebAssembly. Figure 2 As shown, the lightweight container module 10 includes three main components: a quick start engine 11, a resource manager 12 and an isolation controller 13.

[0048] The fast startup engine 11 is the core component of the lightweight container module. Its main goal is to achieve near-instantaneous startup of the container. The engine is based on WebAssembly's just-in-time compilation technology and achieves fast startup through the following steps:

[0049] First, the quick start engine 11 precompiles the container image into a WebAssembly module. This process is performed when the container is first deployed, and the generated WebAssembly module is stored in the local cache. The precompilation process uses the WebAssembly binary format (.wasm file), which has the characteristics of small size and fast loading.

[0050] When the container needs to be started, the quick start engine 11 loads the precompiled WebAssembly module from the cache. The loading process of the WebAssembly module is very fast because it is already in binary format and no additional parsing steps are required.

[0051] Next, the quick start engine 11 uses the WebAssembly just-in-time compiler to compile the loaded module into local machine code. This process utilizes the linear memory model and static type system of WebAssembly, making the compilation process efficient.

[0052] To further optimize the startup speed, the Quick Start Engine 11 implements a lazy loading strategy. When the container starts, only the necessary core components are loaded and compiled, while other components are loaded and compiled when they are used for the first time. This strategy significantly reduces the initial startup time.

[0053] The resource manager 12 is responsible for the resource allocation and recycling of containers. It uses a dynamic resource allocation algorithm and can adjust the allocation of resources such as CPU and memory in real time according to application requirements. The specific implementation is as follows:

[0054] The resource manager 12 maintains a resource pool, including available CPU time slices, memory blocks, etc. When a container requests a resource, the resource manager 12 dynamically calculates an allocation strategy based on the priority of the request and the current system load status.

[0055] In order to achieve refined resource control, the resource manager 12 uses a time slice round-robin algorithm to allocate CPU resources. Each container is assigned a time slice, and the size of the time slice can be dynamically adjusted according to the priority of the container. This method ensures that all containers can obtain CPU time, and containers with high priority can obtain more resources.

[0056] The memory allocation adopts a segment allocation strategy. The resource manager 12 divides the available memory into blocks of different sizes and selects blocks of appropriate sizes for allocation according to the memory requirements of the container. This strategy reduces memory fragmentation and improves memory utilization.

[0057] The resource manager 12 also implements a resource recycling mechanism. When a container releases resources or terminates, the corresponding resources are immediately returned to the resource pool. In order to prevent resource leakage, the resource manager 12 also regularly scans all running containers and recycles resources that are no longer used but have not been correctly released.

[0058] The isolation controller 13 is responsible for implementing secure isolation between containers. It uses the sandbox feature of WebAssembly and combines it with a custom isolation mechanism to implement a multi-level isolation strategy:

[0059] Memory isolation: WebAssembly's linear memory model naturally provides memory isolation. Each WebAssembly module can only access its own memory space and cannot directly access the memory of other modules or the host system. The isolation controller 13 further enhances this feature and implements fine-grained memory access control.

[0060] Network isolation: The isolation controller 13 creates an independent network namespace for each container. Network communication between containers is achieved through a virtual bridge, and each container is assigned a virtual network card and a private IP address. This design ensures the isolation and controllability of network traffic between containers.

[0061] File system isolation: Union File System technology is used to provide an independent file system view for each container. Modifications made by a container to the file system will not affect other containers or the host system. The isolation controller 13 also implements the file system access control list (ACL) to precisely control the container's access rights to specific files or directories.

[0062] To implement these isolation mechanisms, the isolation controller 13 integrates a lightweight security monitor. The monitor works continuously while the container is running, monitoring the system calls and resource accesses of the container to ensure that the container does not cross the boundary to access unauthorized resources.

[0063] The lightweight container module in this embodiment realizes an efficient, secure, and resource-friendly container environment through a fast startup engine, refined resource management, and multi-level isolation mechanism. This design is particularly suitable for resource-constrained edge devices, which can maximize the use of limited hardware resources while ensuring security.

[0064] It should be noted that the technology described in this embodiment can be adjusted and optimized according to specific application scenarios. For example, on more powerful edge devices, more complex resource scheduling algorithms can be added; in scenarios with particularly high security requirements, additional isolation layers or encryption mechanisms can be added. This flexibility enables the system to adapt to the needs of various edge computing environments.

[0065] Finally, the lightweight container module in this embodiment can not only be applied to edge computing, but also be extended to other fields such as cloud computing and the Internet of Things. By adjusting relevant parameters and policies, the module can play its efficient, lightweight, and secure characteristics in different computing environments, providing reliable containerization solutions for various application scenarios.

[0066] Embodiment 3: Edge optimization module.

[0067] This embodiment describes in detail the implementation of the edge optimization module in the lightweight edge runtime system based on WebAssembly. Figure 3 As shown, the edge optimization module 20 includes three main components: a resource-aware scheduler 21, a localized execution optimizer 22, and an elastic scaling controller 23. These components work together to realize an efficient and intelligent edge computing optimization system.

[0068] The resource-aware scheduler 21 is the core component of the edge optimization module. Its main function is to monitor the resource status of edge devices in real time and perform intelligent task scheduling based on this information. The specific implementation is as follows:

[0069] Resource monitoring: The resource-aware scheduler 21 continuously collects key resource indicators such as CPU usage, memory usage, network bandwidth, storage I / O, etc. of edge devices through a lightweight system call interface. In order to minimize the overhead, an adaptive sampling rate strategy is adopted, that is, the sampling frequency is reduced when the system load is low, and the sampling frequency is increased when the load is high.

[0070] Resource prediction: Based on the collected historical data, the resource-aware scheduler 21 uses time series analysis algorithms (such as ARIMA models) to predict short-term resource usage trends. The parameters of the prediction model are dynamically adjusted according to the prediction accuracy to adapt to different workload patterns.

[0071] Task feature analysis: For each task, the resource-aware scheduler 21 analyzes its resource requirement characteristics, including CPU density, memory requirements, network I / O intensity, etc. This analysis is based on the task's historical execution data and static code analysis results.

[0072] Scheduling Decision: Taking into account the current resource status, resource prediction results and task characteristics, the resource-aware scheduler 21 uses a multi-objective optimization algorithm to make scheduling decisions. The optimization objectives include minimizing task completion time, balancing resource utilization and ensuring quality of service (QoS). The core of the scheduling algorithm is an improved genetic algorithm, in which the chromosome encoding represents the mapping from task to resource, and the fitness function comprehensively considers multiple optimization objectives.

[0073] The local execution optimizer 22 is responsible for executing computing tasks locally as much as possible to reduce data transmission and network delays. Its implementation details are as follows:

[0074] Data localization: The localized execution optimizer 22 implements an intelligent caching mechanism to predict and cache frequently accessed data. The caching strategy uses the LRU-K algorithm, which takes into account the access frequency and the most recent access time of the data. In addition, a data prefetching mechanism is implemented to predict the data that may be needed based on the task dependency graph and load it in advance.

[0075] Task decomposition: For complex computing tasks, the localized execution optimizer 22 uses a task graph analysis algorithm to decompose them into subtasks that can be executed in parallel. The decomposition process takes into account data dependencies and communication costs between subtasks, and the optimization goal is to minimize the overall execution time.

[0076] Computation offloading decision: For each subtask, the local execution optimizer 22 needs to decide whether to execute locally or offload to the cloud. This decision is based on a consumption model that considers factors such as local execution time, network transmission time, cloud execution time, and energy consumption. The decision process uses a dynamic programming algorithm to find the optimal offloading strategy.

[0077] The elastic scaling controller 23 is responsible for dynamically adjusting system resource allocation and task distribution according to load conditions. Its core functions include:

[0078] Load monitoring: Continuously monitor the overall load status of the system, including CPU utilization, memory usage, network traffic, etc. Use a sliding window algorithm to calculate the moving average of these indicators to reduce the impact of instantaneous fluctuations.

[0079] Horizontal expansion: When the system load is detected to be close to a predetermined threshold, the elastic scaling controller 23 will start the horizontal expansion mechanism. This includes adding new edge nodes to the cluster or activating nodes in standby state. The node selection is based on a rank algorithm that considers the node's computing power, network latency, and current load.

[0080] Vertical expansion: For a single edge device, the elastic scaling controller 23 can dynamically adjust the resources allocated to different tasks or containers. This is achieved by modifying the resource limits of the container (such as CPU quota, memory limit). Resource adjustment uses a proportional control algorithm to allocate resources based on the priority and performance requirements of the task.

[0081] Load balancing: The elastic scaling controller 23 implements dynamic load balancing among multiple edge nodes. An improved consistent hashing algorithm is used to distribute tasks, which ensures that only a small number of tasks need to be redistributed when nodes join or leave.

[0082] Fault recovery: The elastic scaling controller 23 also implements a fault detection and recovery mechanism. It detects node failures through the heartbeat mechanism and uses task checkpoint and replay technology to recover failed tasks.

[0083] These three components are coordinated through a unified control interface. For example, when the resource-aware scheduler 21 detects resource shortage, it will notify the elastic scaling controller 23 to consider expanding resources. Similarly, the localized execution optimizer 22's unloading decision will also consider the resource availability information provided by the elastic scaling controller 23.

[0084] The edge optimization module in this embodiment achieves efficient operation of the edge computing environment through intelligent resource scheduling, localized execution optimization, and elastic scaling control. This design is particularly suitable for dynamically changing edge computing scenarios, which can make full use of limited edge resources while ensuring efficient execution of computing tasks.

[0085] It should be noted that the optimization strategies and algorithms described in this embodiment can be adjusted according to specific application scenarios. For example, in scenarios with extremely high real-time requirements, the scheduling algorithm can be adjusted to prioritize latency; in energy-sensitive environments, the weight of energy consumption factors can be increased. This flexibility enables the system to adapt to the needs of various edge computing applications.

[0086] Finally, the edge optimization technology in this embodiment is not limited to WebAssembly-based systems, but can also be extended to other edge computing platforms. Through appropriate interface adaptation, these optimization strategies can play a role in different edge computing frameworks, providing a wide range of application prospects for improving edge computing efficiency and resource utilization.

[0087] Example 4: WebAssembly integration.

[0088] This embodiment describes in detail how to integrate lightweight containers and edge optimization mechanisms into the WebAssembly runtime environment to form a complete lightweight edge runtime system based on WebAssembly. Figure 4 As shown, the integration process involves the deep integration of the WebAssembly runtime environment 40, the lightweight container module 10 and the edge optimization module 20.

[0089] The WebAssembly runtime environment 40 is the basis of this system, which provides the ability to execute WebAssembly code. In this embodiment, an open source WebAssembly runtime (such as WAVM or Wasmer) is selected as the basis and customized to support edge computing scenarios. The key points of the transformation include:

[0090] Memory management optimization: In order to adapt to resource-constrained edge devices, a customized memory allocator is implemented. This allocator uses a hierarchical memory pool design, and adopts different allocation strategies for small memory blocks (less than 4KB), medium memory blocks (4KB to 1MB), and large memory blocks (greater than 1MB). Small memory blocks use the slab allocator, medium memory blocks use the buddy system, and large memory blocks use the mmap system call directly. This design greatly reduces memory fragmentation and improves memory utilization.

[0091] Just-in-time compilation (JIT) optimization: The JIT compiler of WebAssembly has been optimized to generate more efficient native code. Specific measures include implementing more aggressive constant propagation and dead code elimination, as well as pattern matching optimization for specific instruction sequences. In addition, a profile-guided optimization (PGO) system has been implemented to guide code generation by collecting runtime performance data.

[0092] Asynchronous I / O support: To improve the performance of I / O-intensive tasks, the WebAssembly runtime is extended to support asynchronous I / O operations. This includes the implementation of an event loop-based scheduler and corresponding WebAssembly API extensions. This enables edge applications to handle network and storage operations more efficiently without blocking the execution thread.

[0093] The integration of the lightweight container module 10 and the WebAssembly runtime environment 40 is mainly reflected in the following aspects:

[0094] Container initialization: When a new container needs to be started, the lightweight container module 10 creates a new WebAssembly instance. This process includes allocating independent linear memory space, setting up an isolated global variable environment, and initializing the container-specific system call interface.

[0095] Resource isolation: The lightweight container module 10 uses the sandbox feature of WebAssembly to achieve resource isolation. Each container runs in an independent WebAssembly instance and cannot directly access the memory of other containers or the host system. The container's access to system resources is controlled by implementing a custom system call interface. This interface wraps the functionality of the underlying operating system and performs permission checks on each call.

[0096] Fast startup: In order to achieve fast startup of containers, a code cache mechanism is implemented in the WebAssembly runtime. The compiled WebAssembly modules are serialized and stored on disk. When you need to start the same type of container, you can directly load the cached code and skip the compilation step, significantly reducing the startup time.

[0097] The integration of the edge optimization module 20 and the WebAssembly runtime environment 40 is mainly reflected in the following aspects:

[0098] Resource monitoring: The edge optimization module 20 collects performance data by hooking key functions of the WebAssembly runtime. For example, monitoring code is inserted at the execution points of memory allocation, I / O operations, and computationally intensive instruction sequences. This data is fed back to the resource-aware scheduler in real time to make optimization decisions.

[0099] Dynamic optimization: Based on the collected performance data, the edge optimization module 20 can trigger re-optimization of the WebAssembly code. For example, if a function is detected as a hotspot, more aggressive optimization strategies such as inlining or loop unrolling can be applied. These optimizations can be applied dynamically at runtime without stopping the executing container.

[0100] Task migration: When task migration is required, the edge optimization module 20 takes advantage of the portability of WebAssembly. A lightweight checkpoint mechanism is implemented that serializes the state of the WebAssembly instance (including memory contents and execution context). This serialized state can be easily transferred and restored between different edge nodes, enabling seamless task migration.

[0101] To illustrate the effect of this integration, consider a specific example: suppose there is an edge image processing application that needs to process real-time video streams from multiple cameras. In traditional solutions, this may require deploying a complete operating system and runtime environment on each edge node, with high startup latency and large resource usage. In this system, the image processing algorithm can be compiled into a WebAssembly module and encapsulated using a lightweight container. When a new video stream needs to be processed, the system can start a new WebAssembly container to process this stream within milliseconds. The edge optimization module monitors the resource usage of each container in real time, and dynamically adjusts resource allocation or migrates tasks to other nodes as needed.

[0102] The innovation of this integrated solution is that it is not just a simple combination of WebAssembly and container technology, but through deep customization and optimization, it creates a lightweight runtime environment designed specifically for edge computing scenarios. It fully utilizes the security, portability and performance characteristics of WebAssembly, and at the same time solves the resource efficiency and flexibility issues in traditional edge computing solutions through lightweight containers and intelligent edge optimization.

[0103] It should be noted that although this embodiment focuses on WebAssembly technology, this integration idea and optimization strategy can also be applied to other types of edge computing runtime environments. For example, similar resource isolation and dynamic optimization mechanisms can be applied to edge computing platforms based on lightweight virtual machines or interpreted languages. This flexibility and scalability make the application scope of the present invention wider and can adapt to different edge computing requirements and technological evolution.

[0104] Embodiment 5: Resource management embodiment.

[0105] This embodiment describes in detail the resource management mechanism in a lightweight edge runtime system based on WebAssembly. Figure 5 As shown, the resource management system 50 includes a fine-grained resource allocation mechanism 51, a resource recovery mechanism 52, and a dynamic resource allocation mechanism 53. These components work together to achieve efficient and flexible resource management, which is particularly suitable for resource-constrained edge computing environments.

[0106] The fine-grained resource allocation mechanism 51 is the core of the resource management of this system. It is responsible for accurately controlling the resource usage of each WebAssembly container. The specific implementation is as follows:

[0107] CPU resource allocation: A credit-based CPU scheduling algorithm is used. Each container is allocated a certain number of CPU credits, and the credit consumption rate is proportional to the CPU usage time. The scheduler will prioritize containers with high credit balances for scheduling. The credit allocation formula is as follows: Among them, C is the allocated credit, B is the base credit (configurable), T is the current time slice length, and P is the scheduling period. This method ensures fairness while allowing short-term CPU burst usage.

[0108] Memory resource allocation: Use a hierarchical memory allocation strategy. The first layer is coarse-grained allocation, allocating fixed-size memory pages (usually multiples of 4KB) to each container. The second layer is fine-grained allocation, using the slab allocator to manage small blocks of memory inside the container. The memory allocation limit is calculated using the following formula: Among them, M is the available memory of the container, M base is the basic memory allocation, P mem is the container priority, P total is the sum of all container priorities, M available The total amount of allocatable memory.

[0109] I / O resource allocation: A token bucket algorithm is implemented to control the I / O operation rate. Each container has an independent token bucket, and the token generation rate is dynamically adjusted according to the priority of the container. I / O operations need to consume a corresponding number of tokens. When the tokens are insufficient, the I / O operation will be delayed. The token generation rate R is calculated as follows: R=R base ×(1+log(P+1)) (3) Among them, R base is the base token generation rate, and P is the container priority. The logarithmic function ensures that high-priority containers get more I / O resources while preventing low-priority containers from starving completely.

[0110] The resource recovery mechanism 52 is responsible for timely recovery of unused or released resources to ensure resource utilization efficiency. The specific implementation includes:

[0111] Active recycling: When the container actively releases resources (such as calling the free() function), the resource recycling mechanism immediately returns the resources to the resource pool. In order to reduce fragmentation, a merging algorithm is implemented to try to merge adjacent free memory blocks into larger blocks.

[0112] Periodic scanning: Periodically scan resource usage of all containers. Mark memory pages that have not been used for a long time as recyclable. Use the clock algorithm to balance the scanning frequency and system overhead.

[0113] Memory compression: When the system memory pressure is high, the memory compression operation is triggered. This includes writing infrequently used memory pages to disk (if available) and reorganizing the container memory to reduce fragmentation. The compression trigger conditions are: Among them, M used is the used memory, M total is the total memory, T compress is the compression threshold (configurable, usually between 0.8 and 0.9).

[0114] The dynamic resource allocation mechanism 53 adjusts resource allocation in real time according to the actual needs of the container and the overall status of the system. The main features include:

[0115] Load awareness: Continuously monitor the resource usage of each container, including CPU usage, memory usage, I / O operation frequency, etc. Use the exponential moving average (EMA) algorithm to smooth short-term fluctuations: EMA=α×Current_Value+(1-α)×EMA previous (5) Here, α is the smoothing factor, which usually ranges from 0.1 to 0.3.

[0116] Resource forecasting: Based on historical data, time series analysis (such as ARIMA model) is used to predict short-term resource demand. The forecast results are used to adjust resource allocation in advance to avoid resource competition.

[0117] Dynamic adjustment: Dynamically adjust resource allocation based on load conditions and forecast results. The adjustment strategy takes into account the priority of the container, current performance, and overall system utilization. The adjustment formula is as follows: R new =R current ×(1+β×(U target -U current )) (6) Among them, R new is the new resource allocation, R current is the current allocation, β is the adjustment factor, U target is the target utilization, U current is the current utilization.

[0118] Elastic Scaling: Supports elastic scaling of container resources. When a container needs more resources, the system will try to allocate additional resources from the resource pool. If the resource pool is insufficient, consider borrowing resources from low-priority containers. The borrowing strategy is based on the inverse of priority: Among them, B is the amount of resources that can be borrowed, R available P is the available resources for the provider. requester and P provider The priority of the requester and provider respectively.

[0119] The resource management mechanism in this embodiment achieves efficient resource utilization in edge environments through fine-grained control, intelligent recycling, and dynamic adjustment. This design is particularly suitable for edge computing scenarios with limited resources and variable loads, and can maximize resource utilization while ensuring performance.

[0120] It is worth noting that although this embodiment focuses on WebAssembly containers, these resource management strategies are also applicable to other types of lightweight virtualization environments. For example, similar credit-based CPU scheduling, hierarchical memory allocation, and I / O control mechanisms can be applied to edge computing platforms based on lightweight virtual machines.

[0121] In addition, the resource management mechanism in this embodiment can be further expanded and optimized. For example, a machine learning algorithm can be introduced to optimize the resource allocation strategy, or a cross-node resource coordination mechanism can be implemented to support a larger edge computing cluster. This scalability and adaptability enables the present invention to continue to evolve and meet new challenges in the field of edge computing in the future.

[0122] Example 6: Isolation mechanism example.

[0123] This embodiment describes in detail the isolation mechanism in a lightweight edge runtime system based on WebAssembly. Figure 6 As shown, the isolation system 60 includes a WebAssembly-based memory safety isolation mechanism 61, a lightweight network isolation mechanism 62, and a file system isolation mechanism 63. These components work together to provide comprehensive and efficient isolation protection for the edge computing environment.

[0124] The memory safety isolation mechanism 61 based on WebAssembly is the basis of the isolation architecture of this system. WebAssembly itself provides powerful memory isolation capabilities, and this embodiment further enhances and optimizes it. The specific implementation is as follows:

[0125] Linear memory model: WebAssembly uses a linear memory model, where each module can only access its own memory space. This embodiment enhances this feature in the following ways: Among them, base is the memory starting address of the module, and size is the memory size allocated to the module. This strict boundary check ensures that the module cannot access the memory of other modules or the host system.

[0126] Memory encryption: To further improve security, this system implements a memory encryption mechanism. The AES-NI instruction set is used for hardware-accelerated encryption. The encryption key is generated by a secure random number generator and rotated regularly. The encryption process can be expressed as: Among them, C is the ciphertext, E K is an encryption function using key K, P is the plaintext, and T is the tweak value (used to increase the randomness of the encryption).

[0127] Memory Isolation Verification: Implements a lightweight runtime verifier that continuously monitors memory access patterns. The verifier uses hardware-based memory protection mechanisms (such as Intel MPX) to enhance security. The verification process can be expressed as: Among them, V is the verification function, access is the memory access operation, and IsValid is the function that checks the legality of the access.

[0128] The lightweight network isolation mechanism 62 is responsible for ensuring network traffic isolation between different containers. This embodiment uses the following technologies:

[0129] Virtual network interface: A virtual network interface (vethpair) is created for each container. These interfaces are connected through a virtual switch (such as Open vSwitch) to form an isolated network environment. The network topology can be expressed as: G=(V,E) (11) Among them, G is the network graph, V is the container set, and E is the virtual link set.

[0130] Network namespace: Use Linux's network namespace feature to create an independent network stack for each container. This ensures network isolation between containers, including routing tables, iptables rules, etc. Namespace isolation can be expressed as: Among them, NS i and NS j Represent the network namespaces of containers i and j respectively.

[0131] Software Defined Networking (SDN): Implements a lightweight SDN controller to dynamically manage network policies between containers. The controller uses an intent-based network configuration language to simplify policy definition and execution. Policy execution can be expressed as: Among them, P is the policy execution function, s is the source container, d is the target container, and Policy is the defined network policy.

[0132] The file system isolation mechanism 63 ensures the isolation and secure access of the file system between containers. This embodiment adopts the following method:

[0133] Union file system: Use OverlayFS to implement lightweight file system isolation. Each container gets an independent file system view, which consists of a read-only base layer and a writable upper layer. The file system structure can be expressed as: FS=Overlay(RO base ,RW upper ) (14) Among them, FS is the file system seen by the container, RO base Is a read-only base layer, RW upper Is the writable upper layer.

[0134] File system namespace: Use Linux's mount namespace to provide each container with an independent mount point view. This prevents containers from affecting each other's file system structure. Namespace isolation can be expressed as: Among them, MNS i and MNSj Represents the mount namespace of container i and j respectively.

[0135] Access Control List (ACL): Implements fine-grained file system access control. ACL defines the permissions that a container has for a specific file or directory, ensuring that the container can only access authorized resources. ACL checks can be expressed as: Among them, CheckACL is a function that checks ACL rules, container is the container requested for access, resource is the resource being accessed, and operation is the operation type (such as read, write, execute).

[0136] The isolation mechanism in this embodiment achieves comprehensive isolation between WebAssembly containers through multi-level security measures. This design not only provides strong security protection, but also maintains the lightweight characteristics of the system, which is particularly suitable for resource-constrained edge computing environments.

[0137] It is worth noting that although this embodiment focuses on the WebAssembly environment, the core ideas of these isolation technologies can be extended to other types of lightweight virtualization platforms. For example, memory encryption and verification mechanisms can be applied to other types of sandbox environments; network isolation and file system isolation technologies can be used to improve the security of traditional containers.

[0138] In addition, the isolation mechanism in this embodiment can be further optimized and expanded. For example, a hardware-based trusted execution environment (such as Intel SGX) can be introduced to enhance memory isolation; a more complex network policy engine can be implemented to support anomaly detection based on machine learning; and a distributed file system isolation mechanism can be developed to support secure file access across nodes. These potential expansion directions enable the present invention to continuously adapt to new security requirements and technological developments.

[0139] Example 7: Task optimization example.

[0140] This embodiment describes in detail the task optimization mechanism in a lightweight edge runtime system based on WebAssembly. Figure 7 As shown, the task optimization system 70 includes an edge computing task decomposition algorithm 71, a data localization processing mechanism 72, and a local cache mechanism 73. These components work together to achieve efficient task processing and resource utilization in an edge environment.

[0141] The edge computing task decomposition algorithm 71 is the core of the task optimization of this system. Its main goal is to decompose complex edge computing tasks into subtasks suitable for local execution. The specific implementation is as follows:

[0142] Task dependency graph construction: First, the system constructs the task dependency graph through static code analysis and dynamic execution tracking. In the dependency graph G = (V, E), V represents the subtask set and E represents the dependency relationship between subtasks. The graph construction process can be expressed as: G=BuildDependencyGraph(T) (17) Among them, T is the input edge computing task, and BuildDependencyGraph is the dependency graph building function.

[0143] Critical Path Analysis: Based on the constructed dependency graph, the system uses the critical path analysis algorithm to identify the bottleneck of task execution. The critical path CP is calculated as follows: Among them, Paths(G) is the set of all paths in graph G, and w(v) is the weight (execution time) of node v.

[0144] Task division: Based on the results of critical path analysis and the resource constraints of edge devices, the system divides the task into a set of subtasks suitable for local execution. The division process can be expressed as an optimization problem: Among them, S is the divided subtask set, Resources (S) is the resources required for calculating the subtask set, and Capacity is the resource capacity of the edge device.

[0145] Parallel execution optimization: For the divided subtasks, the system uses task parallelization technology to optimize execution efficiency. The calculation of parallelism P takes into account the dependencies between tasks and available resources: Among them, AvailableCores is the number of available processing cores, T is the total execution time, and Ready(v,t) determines whether task v is executable at time t.

[0146] The data localization processing mechanism 72 is responsible for optimizing data access and processing to reduce network transmission and improve execution efficiency. The specific implementation includes:

[0147] Data dependency analysis: The system analyzes the data access pattern of the task and constructs a data dependency graph D = (N, A), where N is the set of data items and A is the dependency relationship between data items. The dependency analysis process can be expressed as: D=AnalyzeDataDependency(T,G) (21) Among them, T is the original task and G is the task dependency graph.

[0148] Data partitioning: Based on the results of data dependency analysis, the system divides the data into a local processing set and a remote access set. The partitioning strategy takes into account data size, access frequency, and network conditions, and can be expressed as: (L,R)= L∪R=N (α·Size(L)+β·RemoteAccess(R)) (22) Where L is the local dataset, R is the remote dataset, α and β are weight factors, Size(L) calculates the local data size, and RemoteAccess(R) estimates the remote access cost.

[0149] Data prefetching: The system implements an intelligent data prefetching mechanism to load required data in advance based on the task execution sequence and data dependencies. The prefetching strategy Prefetch can be expressed as: Prefetch(t)={d∈N:Prob(Access(d,t+Δt))>θ} (23) Where t is the current time, Δt is the prefetch time window, and θ is the prefetch threshold.

[0150] The local cache mechanism 73 is used to optimize the storage and retrieval of frequently accessed data. The specific implementation is as follows:

[0151] Cache strategy design: The improved LRU-K algorithm is used as the basic cache replacement strategy. The priority P of the cache item is calculated as follows: Among them, i is the cache item, k is the number of historical accesses considered, and w j is the weight of the jth access, AccessTime j (i) is the timestamp of the jth access.

[0152] Cache consistency maintenance: A cache consistency protocol based on version control is implemented. Each cache item is associated with a version number, and update operations increase the version number. The consistency check process can be expressed as:

[0153] Cache preheating: The system implements a cache preheating mechanism to preload the data that may be needed based on the historical access pattern before the task starts executing. The preheating strategy Warmup can be expressed as: Warmup={d∈N:AccessFreq(d)>φand Size(d)<σ} (26) Among them, φ is the access frequency threshold and σ is the size threshold.

[0154] The task optimization mechanism in this embodiment significantly improves the efficiency of task execution in edge computing environments through intelligent task decomposition, data localization processing, and efficient cache management. This design is particularly suitable for resource-constrained and data-intensive edge computing scenarios, and can minimize network transmission and energy consumption while ensuring performance.

[0155] It is worth noting that although this embodiment focuses on the WebAssembly environment, the core ideas of these optimization techniques can be extended to other edge computing platforms. For example, the task decomposition algorithm can be applied to general distributed computing frameworks; data localization and caching mechanisms can be used to optimize traditional cloud-edge collaborative systems.

[0156] In addition, the optimization mechanism in this embodiment has room for further development. For example, machine learning technology can be introduced to dynamically adjust task decomposition and data prefetching strategies; more complex cache consistency protocols can be developed to support multi-edge node collaboration; edge intelligence technology can be combined to achieve adaptive optimization of the task execution process. These potential expansion directions enable the present invention to continuously adapt to new demands and technological advances in the field of edge computing.

[0157] Embodiment 8: Multi-device collaboration embodiment.

[0158] This embodiment describes in detail the multi-device collaboration mechanism in a lightweight edge runtime system based on WebAssembly. Figure 8 As shown, the multi-device collaborative system 80 includes a dynamic load balancing mechanism 81, a horizontal expansion mechanism 82, and a vertical expansion mechanism 83. These components work together to achieve efficient resource utilization and task processing in an edge computing environment.

[0159] The dynamic load balancing mechanism 81 is the core of the multi-device collaboration of this system. Its main goal is to automatically adjust task allocation according to the device load. The specific implementation is as follows:

[0160] Load monitoring: The system continuously monitors the load status of each edge device, including CPU usage, memory usage, network bandwidth utilization, etc. Load vector L i It can be expressed as: L i =(CPU i ,Mem i ,Net i ,Disk i ) (27) Here, i represents the device number, and each component represents the load index of CPU, memory, network and disk respectively.

[0161] Load forecasting: The system uses time series analysis methods to predict short-term load changes. The forecasting model uses ARIMA (p, d, q), where p, d, and q represent the order of autoregression, difference, and moving average, respectively. The forecasting function can be expressed as: in, is the k-step ahead prediction, is the historical load data, and θ is the model parameter.

[0162] Task allocation strategy: Based on the current load and forecast results, the system dynamically adjusts the task allocation strategy. The improved minimum connection algorithm is used in combination with the device performance weight to calculate the task allocation probability: Where P(i) is the probability of assigning a task to device i, and w i is the device performance weight, c i is the current number of connections.

[0163] Load Balancer: Implemented a distributed load balancer that uses consistent hashing to ensure even distribution of tasks across devices. The hash function H is chosen to satisfy: Where ∈ is the collision probability, which is usually chosen to be small enough (such as 10 -6 ) to ensure uniformity.

[0164] The horizontal expansion mechanism 82 is responsible for supporting the collaborative work of multiple edge devices to cope with the situation of increased load or increased performance requirements. The specific implementation includes:

[0165] Device discovery: Use mDNS (multicast DNS) protocol to achieve automatic device discovery. Each edge device periodically broadcasts its capability descriptor D i : D i =(ID i ,Capabilities i ,Address i ,Timestamp) (31)

[0166] Cluster formation: Based on the discovered device information, the system dynamically forms and maintains edge device clusters. The Raft consensus algorithm is used to elect cluster leaders to ensure cluster state consistency. The leader election process can be expressed as: Leader= i∈Nodes (Term i ,Log i ) (32) Among them, Termi is the current term number of node i, Log i is the log length.

[0167] Task migration: When horizontal expansion is required, the system performs task migration. The migration decision is based on device load and network conditions, and the migration cost C is calculated as follows: C=α·T transfer +β·T init +γ·ΔL (33) Among them, T transfer is the data transmission time, T init is the task initialization time, ΔL is the load change, and α, β, γ are weight coefficients.

[0168] State synchronization: Use incremental synchronization to maintain state consistency between multiple devices. Use version vector VV to track updates: VV i =(v i1 ,v i2 ,...,v in ) (34) Among them, v ij Indicates the latest version number of device j seen by device i.

[0169] The vertical expansion mechanism 83 is responsible for dynamically adjusting resource allocation within a single edge device to meet the needs of different tasks. The specific implementation is as follows:

[0170] Elastic resource allocation: Use control theory methods to dynamically adjust the resource limits of containers. The resource allocation function R can be expressed as: Among them, e(t) is the error between the target performance and the actual performance, K p , K i , K d They are proportional, integral and differential control parameters respectively.

[0171] Dynamic frequency scaling: Implements CPU performance adjustment based on DVFS (dynamic voltage frequency scaling). The frequency selection function f can be expressed as: f= fi∈F {f i :P(f i )≤P max and f i ≥f req} (36) Where F is the available frequency set, P(f i ) is at frequency f i The power consumption under max is the maximum allowable power dissipation, f reqIt is the minimum frequency that meets performance requirements.

[0172] Memory elasticity: A dynamic memory adjustment mechanism based on balloon driver is implemented. The adjustment strategy of balloon size B is: B(t+1)=B(t)+min(max(ΔM,-B max ),B free ) (37) Among them, ΔM is the required memory change, B max is the maximum balloon size, B free is the amount of available memory.

[0173] The multi-device collaboration mechanism in this embodiment achieves efficient resource utilization and task processing in the edge computing environment through dynamic load balancing, horizontal expansion and vertical expansion. This design is particularly suitable for complex computing environments composed of heterogeneous edge devices, and can maximize the overall efficiency of the system while ensuring performance.

[0174] It is worth noting that although this embodiment focuses on the WebAssembly environment, the core ideas of these collaborative technologies can be extended to other edge computing platforms. For example, dynamic load balancing strategies can be applied to traditional distributed systems; horizontal and vertical expansion mechanisms can be used to optimize cloud-edge-end collaborative systems.

[0175] In addition, the collaborative mechanism in this embodiment has room for further development. For example, reinforcement learning technology can be introduced to optimize load balancing and resource allocation strategies; more complex device discovery and cluster management protocols can be developed to support large-scale edge networks; edge intelligence technology can be combined to achieve adaptive optimization of the task execution process. These potential expansion directions enable the present invention to continuously adapt to new demands and technological advances in the field of edge computing, laying the foundation for future intelligent edge computing systems.

Claims

1. A lightweight edge runtime system based on WebAssembly, characterized in that: include: (a) Lightweight container module for fast startup, minimal resource overhead, and efficient isolation; (b) Edge optimization module, used to achieve resource-aware scheduling, localized execution optimization, and elastic scaling; (c) The lightweight container module and the edge optimization module work together to provide an efficient and secure operating environment on the edge device.

2. The system according to claim 1, characterized in that The lightweight container module includes: (a) Fast startup mechanism, which uses the just-in-time compilation feature of WebAssembly to achieve nearly instant container startup; (b) Preloading and caching mechanisms to reduce resource initialization time at startup; (c) Lazy loading strategy, loading necessary components only when needed.

3. The system according to claim 1, characterized in that The lightweight container module also includes: (a) Fine-grained resource allocation mechanism, allocating CPU, memory and other resources on demand; (b) Resource recovery mechanism to release unused resources in a timely manner; (c) The fine-grained resource allocation mechanism and resource recycling mechanism work together to minimize resource overhead.

4. The system according to claim 1, characterized in that The lightweight container module also includes: (a) Memory safety isolation mechanism based on WebAssembly; (b) Lightweight network isolation mechanism; (c) File system isolation mechanism; (d) The memory security isolation mechanism, network isolation mechanism and file system isolation mechanism work together to achieve efficient isolation.

5. The system according to claim 1, characterized in that The edge optimization module includes: (a) Edge device resource monitoring system, which senses the status of CPU, memory, network and other resources in real time; (b) Intelligent scheduling algorithm based on resource status to optimize task allocation and execution; (c) Dynamic resource allocation mechanism, which adjusts resource allocation according to task requirements and equipment status.

6. The system according to claim 1, characterized in that The edge optimization module also includes: (a) Data localization processing mechanism to reduce data transmission overhead; (b) Edge computing task decomposition algorithm, which splits complex tasks into subtasks suitable for local execution; (c) Local caching mechanism to improve the processing efficiency of frequently accessed data.

7. The system according to claim 1, characterized in that The edge optimization module also includes: (a) Dynamic load balancing mechanism, automatically adjusting task allocation according to device load conditions; (b) Horizontal expansion mechanism, supporting multiple edge devices to work together; (c) Vertical expansion mechanism, dynamically adjusts the resource allocation of a single device according to task requirements.

8. A method for implementing a lightweight edge runtime system based on WebAssembly, characterized in that: The following steps are involved: (a) Implement lightweight containers, including fast startup mechanisms, minimized resource overhead, and efficient isolation technology; (b) Implement edge optimization mechanisms, including resource-aware scheduling, localized execution optimization, and elastic scaling capabilities; (c) Integrate the lightweight container and edge optimization mechanism into the WebAssembly runtime environment to form a complete edge runtime system.

9. The method according to claim 8, characterized in that The steps to implement a lightweight container also include: (a) Leverage WebAssembly’s just-in-time compilation feature to achieve nearly instant container startup; (b) Design preloading and caching mechanisms to reduce resource initialization time at startup; (c) Implement a lazy loading strategy to load necessary components only when needed.

10. The method according to claim 8, characterized in that The steps to implement the edge optimization mechanism also include: (a) Design an edge device resource monitoring system to perceive the status of CPU, memory, network and other resources in real time; (b) Implement intelligent scheduling algorithms based on resource status to optimize task allocation and execution; (c) Design a dynamic resource allocation mechanism to adjust resource allocation according to task requirements and equipment status.

Citation Information

Cited By

  • Data acquisition and remote logic control method for multi-protocol equipment

    CN121887872A

  • A method for data acquisition and remote logic control of multi-protocol devices

    CN121887872B