Industrial edge application dynamic updating method based on microkernel

Through the industrial edge application design based on microkernel, function blocks are run as independent threads, and dynamic updates are achieved by reconfiguring the thread entry point address, the problem of update time and insufficient system reliability in the existing technology is solved, and online rapid updates and high reliability are achieved.

CN120371345APending Publication Date: 2025-07-25SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510442860.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

When existing industrial edge applications are updated or reconfigured, they need to update container images or even restart containers, which takes a long time and lack strict isolation between different services, which affects system reliability.

Method used

The microkernel architecture is used to design industrial edge applications, and the functional blocks run at the user layer as independent threads. They use reconfiguration of thread entry point addresses to achieve dynamic updates, combining capability-based access control and address space isolation to ensure strict isolation and high reliability between services.

Benefits of technology

It realizes rapid online updates, reduces the risk of system downtime, improves system reliability and security, is suitable for resource-constrained edge devices, and supports the industrial scenario requirements of OT-IT convergence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371345A_ABST
    Figure CN120371345A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial edge application dynamic updating method based on a microkernel, and relates to the field of industrial automation. Designing an industrial edge application based on the microkernel; and constructing a function block as a thread, and dynamically updating the industrial edge application by reconfiguring a thread entry point address. The microkernel architecture is mainly used for designing an operating system, the most basic core functions (scheduling, inter-process communication and address space management) in the operating system are realized, and all other functions such as a file system and a device driver are operated in a user layer as independent services. All services run in different address spaces in the form of threads, different services can be strictly isolated by combining access control based on Capability, and other services and kernels cannot be affected by collapse of any service. The micro-kernel architecture also adopts a modular design, and any independent module can realize thread-level loading and updating, so that dynamic updating and expansion are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial automation, and in particular to a method for dynamically updating industrial edge applications based on a microkernel. Background Art

[0002] The current industrial automation system is gradually transforming into an edge-cloud collaborative architecture that integrates cloud computing and edge computing. Due to having a vast amount of computing resources, the cloud can process tasks with high resource consumption and low real-time requirements, and transmit the results to edge computing nodes through the industrial Internet. Moreover, unlike traditional PLCs that use single-core processors, current edge computing nodes are equipped with more computing resources and storage resources, and have the ability to execute multiple tasks simultaneously.

[0003] As a program organization unit of the IEC 61499 standard, an event-triggered function block (FB) can not only encapsulate operational technology (OT) programming languages such as ladder diagrams and structured texts in IEC 61131-3, but also support encapsulating any information technology (IT) programming languages, such as Go and Python. A function block network formed by connecting function blocks in a certain order serves as an industrial edge application to execute complex and diverse manufacturing tasks. Therefore, industrial edge applications based on IEC 61499 can be used to achieve OT-IT integration.

[0004] Existing industrial edge applications are mainly designed using a container-based microservices architecture. Function blocks run in containers as separate microservices, which are uniformly managed by the IEC 61499 resource manager, including the registration and cancellation of microservices, etc., and each function block microservice is called through an application programming interface. For any edge computing node, all containers deployed thereon run on the same operating system and are isolated through the namespace and control group (Cgroups) technologies provided by the operating system kernel. In addition, when an application update or reconfiguration occurs, it is necessary to update the container image and even restart the corresponding container, which takes a long time.

[0005] Therefore, those skilled in the art are committed to developing a dynamic update method for industrial edge applications based on a microkernel. The microkernel architecture is mainly used in operating system design and implements the most basic core functions in the operating system (scheduling, inter-process communication, and address space management). All other functions such as file systems and device drivers run as separate services in the user layer. All services run as threads in different address spaces. Combined with capability-based access control, strict isolation can be achieved between different services, and the crash of any one service will not affect other services and the kernel. Moreover, like industrial edge applications based on IEC 61499, the microkernel architecture also adopts a modular design, and any independent module can be loaded and updated at the thread level, facilitating dynamic update and expansion. Summary of the Invention

[0006] In view of the above-mentioned defects of the prior art, the technical problems to be solved by the present invention are strict isolation between different services, and the crash of any one service will not affect other services and the kernel; any independent module can be loaded and updated at the thread level, facilitating dynamic update and expansion.

[0007] To achieve the above object, the present invention provides a dynamic update method for industrial edge applications based on a microkernel, including the following steps:

[0008] Step 1: Design an industrial edge application based on a microkernel;

[0009] Step 2: Construct function blocks as threads and dynamically update the industrial edge application by reconfiguring the thread entry point address.

[0010] Further, the architecture of the industrial edge application is divided into hardware, kernel layer, and user layer, and the kernel layer is a microkernel. The industrial edge application consists of a series of services running on the microkernel, and the microkernel runs on the hardware.

[0011] Further, the microkernel manages hardware resources and provides functions of scheduling, communication, and address space management.

[0012] Further, system functions run as services in the user layer.

[0013] Further, the resource manager, scheduler, and function blocks run as services in the user layer.

[0014] Further, the function blocks run as independent threads in the user layer. The creation and deletion operations of the function blocks are managed by the resource manager, and the execution order of the function block threads during operation is determined by the scheduler according to the scheduling algorithm.

[0015] Furthermore, the microkernel is responsible for the allocation of the initial page table, and subsequent memory management is handled by the resource manager, which configures user services to run in independent virtual address spaces.

[0016] Furthermore, the update of the industrial edge application is at the granularity of function blocks.

[0017] Furthermore, step 2 includes the following steps:

[0018] Step 2.1: After completing the writing or updating of the internal algorithm of the function block, compile and assemble the function block and statically link it into an ELF executable file;

[0019] Step 2.2: Send management instructions and the corresponding ELF executable file to the edge computing node;

[0020] Step 2.3: The resource manager running in the edge computing node loads the corresponding ELF executable file from the file system into memory according to the received instructions and creates a new thread object;

[0021] Step 2.4: The resource manager configures the new function block thread, allocates stack space, sets the stack pointer to the top of the stack, and sets the program counter to the entry point of the ELF executable file to run the updated function block;

[0022] Step 2.5: The resource manager queries the status of the old function block thread;

[0023] Step 2.6: After checking that the old function block thread is in the idle state, the resource manager starts the new function block thread, and the scheduler continues to select a function block thread to execute;

[0024] Step 2.7: The resource manager pauses the old function block thread and clears the corresponding resources to complete the dynamic update of the function block.

[0025] Furthermore, step 2.1 includes the following steps:

[0026] Step 2.1.1: The algorithm inside the function block is stored in the.text segment of the ELF executable file with read and executable permissions;

[0027] Step 2.1.2: The constant variables or const variables of the function block are stored in the.rodata segment with read-only permissions;

[0028] Step 2.1.3: Other data variables of the function block are stored in the.data and.bss segments with read and write permissions.

[0029] The current container-based microservices architecture cannot provide strict isolation for multiple tasks running on a single edge computing node, affecting the reliability of industrial systems. The present invention designs industrial edge applications based on a microkernel. The present invention: 1. Capability-based access control: The access rights to all resources (such as memory, threads, etc.) are managed by "capabilities", which are non-forgeable tokens. User-level services must hold the corresponding capabilities to operate specific resources. Each user service has an independent capability space that describes its available capabilities. The kernel verifies the legitimacy of resource requests through the capability space, and services cannot request resources without explicit authorization; 2. The microkernel is only responsible for the allocation of the initial page table, and subsequent memory management is handled by user-level services (resource managers). The resource manager configures each user service to run in an independent virtual address space, thus ensuring that no service can access the address space of other services out of bounds. The industrial edge application designed based on the microkernel of the present invention can provide strict isolation for multiple tasks on a single device, ensuring system reliability.

[0030] When industrial edge applications need to be updated or reconstructed, under the container-based microservices architecture, the update granularity is large, the efficiency is low, the time consumption is long, and even offline updates are required, making it difficult to have high flexibility. Based on the design of industrial edge applications based on a microkernel, the present invention constructs functional blocks as threads and realizes the dynamic update of industrial edge applications by reconfiguring the thread entry point address. Based on the design of industrial edge applications based on a microkernel, each functional block that constitutes the industrial edge application is compiled into an ELF (Executable and Linkable Format) executable file. The resource manager loads the executable file into memory and creates a new thread object, and then configures the new thread entry point as the entry point of the ELF executable file. When the functional block to be updated is idle, the new functional block thread is started, and finally the thread of the functional block to be updated is paused and the corresponding resources are cleared to complete the dynamic update of the functional block. The dynamic update method of the industrial edge application proposed by the present invention can achieve online and rapid update of the application.

[0031] Compared with the prior art, the present invention has the following obvious substantial features and remarkable advantages:

[0032] 1. Technical advantages

[0033] Strict Isolation and High Reliability: Under the microkernel-based architecture, components such as device drivers, network protocol stacks, and file systems run independently as user-level services. Each function block in the industrial edge application based on IEC 61499 runs as an independent thread in the user layer. The resource manager that manages all operations such as the creation and deletion of function blocks and the scheduler that determines the execution order of function blocks at runtime also run as user services. Using a capability-based access mechanism and address space isolation can ensure that the crash of any service does not affect other services and the kernel, ensuring that all services run in strict isolation, thereby guaranteeing the high reliability of the industrial system. In particular, compared with traditional real-time operating systems (RTOS) or macrokernel solutions (such as Linux), the microkernel solution has significant advantages in terms of security and real-time performance.

[0034] Online Fast Dynamic Update: In industrial edge applications based on the microkernel, function blocks run as independent threads. When it is necessary to update or reconfigure a function block, only need to load the updated ELF executable file and configure the entry point address of the new thread object as the entry point of the ELF executable file. When the function block to be updated is idle, start the new function block thread and clean up the resources of the original function block thread to complete the online update without restarting the system, reducing the downtime risk.

[0035] 2. Performance Metrics

[0036] Low Resource Requirements: The container-based microservices architecture requires a complete operating system (MB - GB) to be installed on the device and a container engine to be deployed on top of the operating system to manage containers. However, for industrial edge applications based on the microkernel, only need to install the microkernel (KB - MB) on the device and select the necessary system components for installation. The required space is small, supporting resource-constrained edge devices;

[0037] Low Latency Update: In industrial edge applications based on the microkernel, function block updates can be achieved by changing the thread entry point. Moreover, the time to create a new thread object, configure the new entry point, and start the new function block thread is in the microsecond range, which is much less than the cycle period (millisecond range) of a programmable logic controller (PLC). And the above process ensures that the update process is started when the function block thread to be updated is idle, enabling online updates.

[0038] 3. Production Implementation

[0039] The requirements in industrial scenarios are clear: when the requirements of industrial manufacturing change, industrial edge applications need to be reconfigured to complete different manufacturing tasks. In addition, the trend of OT-IT integration in industry is obvious, and IT-related applications are updated relatively frequently. Industrial edge applications based on IEC 61499 can be used to achieve OT-IT integration and have been used in some industrial scenarios. The dynamic update method proposed in this invention can achieve online update, ensure that industrial equipment does not stop during the update, and guarantee continuous service in the industrial field.

[0040] Controllable hardware cost: Industrial edge applications based on microkernels have low requirements for hardware resources, can be deployed on low-cost edge devices, and are suitable for large-scale installation and deployment of edge nodes.

[0041] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, features and effects of the present invention. Description of the Drawings

[0042] Figure 1 is the industrial edge application architecture based on microkernel of a preferred embodiment of the present invention;

[0043] Figure 2 is the flowchart of the dynamic update method of industrial edge applications of a preferred embodiment of the present invention;

[0044] Figure 3 is the correspondence between function blocks and corresponding ELF executable files of a preferred embodiment of the present invention;

[0045] Figure 4 is the ELF executable file loading process of a preferred embodiment of the present invention. Detailed Embodiments

[0046] The following introduces multiple preferred embodiments of the present invention with reference to the accompanying drawings of the specification to make its technical content clearer and easier to understand. The present invention can be embodied in many different forms of embodiments, and the protection scope of the present invention is not limited to the embodiments mentioned in the text.

[0047] In the drawings, components with the same structure are denoted by the same reference numerals, and components with similar structures or functions are denoted by similar reference numerals. The size and thickness of each component shown in the drawings are arbitrarily shown, and the present invention does not limit the size and thickness of each component. In order to make the drawings clearer, the thickness of some components is appropriately exaggerated in the drawings.

[0048] Industrial edge applications based on microkernels are constructed according to the architecture as Figure 1 shown.

[0049] 1. Use a microkernel to manage hardware resources downward and provide functions such as scheduling, communication, and address space management upward;

[0050] 2. The functions required by the system run as independent services in the user layer. The file system manages the hardware disk and provides services such as file reading, writing, and storage to the system; the network protocol stack manages the network card and provides network communication functions to applications; other device driver services are responsible for interacting with input and output devices.

[0051] 3. The resource manager, scheduler, and function blocks all serve as user layer services. Each function block that makes up an industrial edge application runs as an independent thread in the user layer. All operations such as the creation and deletion of function blocks are managed by the resource manager, and the execution order of each function block thread during operation is determined by the scheduler according to the scheduling algorithm.

[0052] Based on the above architecture, the update of industrial edge applications is at the granularity of function blocks, and the specific process of its dynamic update method is as Figure 2 shown.

[0053] 1. After the user completes writing or updating the internal algorithm of the function block, compile and assemble the function block and statically link it into an ELF executable file for a specific architecture;

[0054] 2. Send management instructions and the corresponding ELF executable file to the edge computing node through the network;

[0055] 3. The resource manager running in the edge computing node loads the corresponding ELF executable file from the file system into memory according to the received instructions and creates a new thread object;

[0056] 4. The resource manager configures the new function block thread, including allocating stack space, setting the stack pointer to the top of the stack, and setting the program counter to the entry point of the ELF executable file to run the updated function block;

[0057] 5. The resource manager queries the status of the old function block thread. Only when the old function block thread is in the idle state can the subsequent steps be carried out;

[0058] 6. After checking that the old function block thread is in the idle state, the resource manager starts the new function block thread, and the scheduler continues to select function block threads for execution;

[0059] 7. The resource manager suspends the old function block thread and clears the corresponding resources to complete the dynamic update of the function block.

[0060] Specifically, for step 1 in the dynamic update method, the specific implementation of compiling the function block into an ELF executable file is as Figure 3 shown, using the method of static linking, where

[0061] 1. The algorithms inside the functional block are stored in the.text segment of the ELF executable file with read and execute (RX) permissions;

[0062] 2. The constant variables or const variables of the functional block are stored in the.rodata segment with read-only (RO) permissions;

[0063] 3. Other data variables of the functional block are stored in the.data and.bss segments with read and write (RW) permissions.

[0064] Specifically, in step 3 of the dynamic update method, the corresponding ELF executable file is loaded into memory, and its specific process is as Figure 4 shown.

[0065] 1. Open the ELF file; the functional block after the update is compiled to generate an ELF executable file, which can be transmitted to the edge computing node through the network, and the resource manager reads the ELF executable file through the file system service.

[0066] 2. Parse the ELF file header (ELF header) and check the header information. If it is illegal, return an error; first, check the ELF magic number, that is, whether the first 4 bytes are 0x7F, 0x45, 0x4C, 0x46. This identification code indicates that the file is in the ELF format. Then check whether the e_type field in the ELF file header is ET_EXEC. Since the functional blocks are all compiled into ELF executable files, only when e_type is ET_EXEC is it legal. Finally, check other information such as the version, hardware platform, section header table, and program header table. If the check fails, return an error; if the check passes, proceed to the subsequent steps.

[0067] 3. Obtain the values of the e_entry, e_phoff, and e_phnum fields from the ELF file header. e_entry corresponds to the virtual address of the program entry point, that is, the starting virtual address corresponding to the.text segment where the algorithms inside the functional block are stored after compilation and linking, which is convenient for subsequent configuration of the context of the new functional block thread. e_phoff represents the offset of the program header table in the ELF executable file relative to the file header, and e_phnum represents the number of entries in the program header table.

[0068] 4. Calculate the starting position of the program header table according to e_phoff, and process e_phnum program header tables in sequence. First, check whether the value of the p_type field in the program header table is LOAD. If it is LOAD, proceed to the subsequent steps; otherwise, skip the current segment. p_type being LOAD means that the current segment is a loadable segment, including the code segment and data segment required for program operation. Only by correctly loading the LOAD segment can it be ensured that the ELF executable file can run.

[0069] 5. For each LOAD segment, first obtain the corresponding values of the p_vaddr, p_offset, p_filesz, p_memsz, and p_flags fields; then allocate physical memory pages, allocate physical memory pages according to the size of p_memsz, map the allocated physical memory pages to the virtual address space corresponding to p_vaddr, and copy the content of the current LOAD segment located from p_offset to (p_offset + p_filesz) to the memory pages. Finally, set the read / write / execute permissions according to p_flags: set the.text segment to be readable and executable,.data segment to be readable and writable, and.rodata to be read-only.

[0070] The preferred specific embodiments of the present invention have been described in detail above. It should be understood that those of ordinary skill in the art can make many modifications and variations based on the concept of the present invention without creative labor. Therefore, all technical solutions that can be obtained by those skilled in the art in the technical field based on the concept of the present invention through logical analysis, reasoning, or limited experiments on the basis of the prior art should be within the protection scope determined by the claims.

Claims

1. A dynamic update method for industrial edge applications based on a microkernel, characterized in that, It includes the following steps: Step 1: Design an industrial edge application based on a microkernel; Step 2: Construct function blocks as threads and dynamically update the industrial edge application by reconfiguring the thread entry point address.

2. The dynamic update method for industrial edge applications based on a microkernel according to claim 1, wherein The architecture of the industrial edge application is divided into hardware, kernel layer, and user layer, and the kernel layer is a microkernel.

3. The dynamic update method for industrial edge applications based on a microkernel according to claim 2, characterized in that, The microkernel manages hardware resources and provides scheduling, communication, and address space management functions.

4. The dynamic update method for industrial edge applications based on a microkernel according to claim 2, characterized in that, System functions run as services in the user layer.

5. The dynamic update method for industrial edge applications based on a microkernel according to claim 2, characterized in that, The resource manager, scheduler, and function blocks run as services in the user layer.

6. The dynamic update method for industrial edge applications based on a microkernel as claimed in claim 5, wherein, The function blocks run as independent threads in the user layer. The creation and deletion operations of the function blocks are managed by the resource manager, and the execution order of the function block threads during operation is determined by the scheduler according to the scheduling algorithm.

7. The dynamic update method for industrial edge applications based on a microkernel according to claim 2, characterized in that The microkernel is responsible for the allocation of the initial page table, and subsequent memory management is handled by the resource manager. The resource manager configures user services to run in independent virtual address spaces.

8. The dynamic update method for industrial edge applications based on a microkernel according to claim 1, characterized in that, The update of the industrial edge application is at the granularity of function blocks.

9. The dynamic update method for industrial edge applications based on a microkernel according to claim 1, characterized in that Step 2 includes the following steps: Step 2.1: After completing the writing or updating of the internal algorithm of the function block, compile and assemble the function block and statically link it into an ELF executable file; Step 2.2: Send management instructions and the corresponding ELF executable file to the edge computing node; Step 2.3: The resource manager running in the edge computing node loads the corresponding ELF executable file from the file system into memory according to the received instructions and creates a new thread object; Step 2.4: The resource manager configures the new function block thread, allocates stack space, sets the stack pointer to the top of the stack, and sets the program counter to the entry point of the ELF executable file to run the updated function block; Step 2.5: The resource manager queries the status of the old function block thread; Step 2.6: After checking that the old function block thread is in the idle state, the resource manager starts the new function block thread, and the scheduler continues to select function block threads for execution; Step 2.7: The resource manager pauses the old function block thread and clears the corresponding resources to complete the dynamic update of the function block.

10. The dynamic update method for industrial edge applications based on a microkernel according to claim 9, wherein Step 2.1 includes the following steps: Step 2.1.1: The algorithm inside the function block is stored in the.text segment of the ELF executable file with read and executable permissions; Step 2.1.2: The constant variables or const variables of the function block are stored in the.rodata segment with read-only permissions; Step 2.1.3: Other data variables of the function block are stored in the.data and.bss segments with read and write permissions.

Citation Information

Cited By

  • Hot update control method and system for industrial PLC (Programmable Logic Controller) of microkernel operating system

    CN121092201A