Lightweight micro-service framework implementation method for embedded platform

By designing a lightweight microservice framework, the problems of large resource consumption, long startup time and low communication efficiency in embedded systems are solved, efficient resource utilization and rapid response are achieved, and system performance and ease of use are improved.

CN119829024APending Publication Date: 2025-04-15EAST CHINA INST OF COMPUTING TECH

Patent Information

Application Number
CN202411880923.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Microservice architectures have problems such as large resource consumption, long startup time and low communication efficiency in embedded systems.

Method used

A lightweight microservice framework is designed, including a lightweight runtime environment, a dynamic resource management system and a lightweight inter-service communication middleware. The lightweight runtime environment minimizes resource usage and fast initialization, the dynamic resource management system dynamically loads and unloads microservice instances on demand, and the lightweight inter-service communication middleware improves data transmission efficiency through low-overhead RPC protocol and compact message format.

Benefits of technology

It significantly reduces the resource usage of embedded devices by microservices, shortens the startup time of microservices, improves communication efficiency between microservices, and improves the performance, stability and ease of use of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829024A_ABST
    Figure CN119829024A_ABST
Patent Text Reader

Abstract

The invention relates to a lightweight micro-service framework implementation method for an embedded platform, which is divided into three parts, namely a lightweight runtime environment, a dynamic resource management system and lightweight service communication middleware, and is specifically implemented as follows: the lightweight runtime environment is responsible for life cycle management of micro-services, provides a uniform configuration management mechanism, and is used for managing the life cycle of the micro-services; a log is recorded and is responsible for monitoring; the lightweight inter-service communication middleware is a low-overhead remote procedure call (RPC) protocol; the middleware adopts a compact message format and a binary coding format; according to the dynamic resource management system, the micro-service instances are dynamically loaded and unloaded on an embedded platform according to needs, resource utilization is optimized, and the overall performance of the system is improved. The problems of high resource consumption, long starting time and low communication efficiency of the application of the micro-service architecture in the embedded system are solved, the efficient operation of the micro-service in the embedded system is realized, and the performance, the stability and the usability of the system are also remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an embedded system software architecture technology, and in particular to a lightweight microservice framework implementation method suitable for resource-constrained embedded platforms. Background Art

[0002] Embedded systems have long relied on a monolithic architecture, where all functional modules are tightly integrated and run as a single, indivisible application. The advantage of this architecture is its simplicity and ease of implementation, especially in the early days of embedded devices with limited processing power and storage space. However, as embedded device functions become increasingly complex, the monolithic architecture has gradually exposed the following problems:

[0003] 1. Poor scalability: When new features need to be added or existing features need to be modified, the entire application usually needs to be refactored, which not only increases the development workload but may also lead to the introduction of new problems.

[0004] 2. Difficult to maintain: Due to the high degree of coupling between various functions, once a problem occurs in a function, it becomes very difficult to locate and fix the error.

[0005] 3. Inconvenient updates: Application updates under a monolithic architecture require downtime deployment, which is unacceptable in some application scenarios.

[0006] In embedded systems, the traditional monolithic architecture is insufficient in scalability, flexibility, and maintainability when faced with complex and changing application scenarios. The core idea of ​​the microservice architecture is to decompose a large application into a set of small services, each of which runs in its own independent process and interacts through a communication mechanism (usually HTTP / HTTPS). This architecture allows each service to be deployed independently, reduces the coupling between modules, and enables services to be independently expanded as needed. In recent years, with the widespread application of microservice architecture in cloud computing environments, people have also begun to explore its feasibility on embedded platforms. However, the introduction of the microservice framework of the cloud computing environment into the embedded environment has the following challenges:

[0007] 1. High resource consumption: Most cloud-oriented microservice frameworks rely on heavier runtime environments (such as Docker containers), which are unbearable for embedded devices with limited memory and processing power.

[0008] 2. Long startup time: Microservices in cloud computing often rely on containerization technology (such as Docker). The startup process of the container involves a series of operations such as initializing the operating system kernel and mounting the file system, which leads to a long startup time and reduces the real-time performance of the service. This is a bottleneck for embedded systems that require fast response.

[0009] 3. High communication overhead: Microservices in cloud computing environments usually communicate using protocols such as HTTP / HTTPS. Although these protocols are mature and stable, their message headers are large and are not suitable for embedded network environments. Summary of the invention

[0010] Aiming at the problems of large resource consumption, long startup time and low communication efficiency in the application of microservice architecture in embedded systems, a lightweight microservice framework implementation method for embedded platforms was proposed.

[0011] The technical solution of the present invention is:

[0012] A lightweight microservice framework implementation method for embedded platforms. The lightweight microservice framework is divided into three parts: a lightweight runtime environment, a dynamic resource management system, and a lightweight service-to-service communication middleware. The specific implementation is as follows:

[0013] The lightweight runtime environment includes service manager, configuration management, logging and monitoring, and monitoring. The specific implementation of each module is as follows: Service manager: responsible for the life cycle management of microservices, including starting, stopping, restarting and monitoring; the service manager responds to various service events in the system in an event-driven manner to ensure the normal operation of the service; Configuration management: provides a unified configuration management mechanism, supports dynamic configuration updates and version control; the configuration management module uses a lightweight key-value storage system to achieve efficient reading and writing of configuration information; Logging and monitoring: built-in logging function helps developers and operation and maintenance personnel to discover and solve problems in a timely manner; the logging system supports multi-level logging and provides log aggregation and analysis tools; Monitoring: built-in performance monitoring function, the monitoring system provides real-time performance monitoring data by collecting and analyzing system indicators;

[0014] Lightweight inter-service communication middleware is a low-overhead remote procedure call (RPC) protocol. The middleware adopts a compact message format and binary encoding format to reduce the size of the message header and improve data transmission efficiency.

[0015] The dynamic resource management system optimizes resource utilization and improves the overall performance of the system by dynamically loading and unloading microservice instances on the embedded platform on demand. The specific implementation is as follows: Dynamic loading and unloading: Dynamic recording and unloading can be completed only by defining the function entry and entry parameters after dynamic loading through the protocol; Service registration and discovery: Support automatic service registration and discovery mechanism, and realize dynamic management of service instances through distributed service registry; Memory management: Optimize memory management strategy, reduce memory fragmentation, and improve memory utilization efficiency; Through object pool and caching mechanism, reduce frequent memory allocation and release operations, and reduce system overhead.

[0016] Furthermore, the design of the lightweight runtime environment follows the following principles: Minimize resource usage, by streamlining the components and functions of the runtime environment to ensure that it can run efficiently on resource-constrained embedded devices. Fast initialization, optimize the startup process, reduce initialization time, and ensure that microservices can quickly enter a usable state.

[0017] Furthermore, the specific implementation of the lightweight inter-service communication middleware also includes: the message format supports multiple data types, including basic types, arrays, and complex objects; supports multiplexing, supports concurrent processing of multiple requests on the same TCP connection, reduces the overhead of establishing and closing connections, and ensures the stability and efficiency of connections through flow control mechanisms; supports message compression to reduce network bandwidth usage, and at the same time, provides multiple encryption algorithms to ensure the security of data transmission.

[0018] Furthermore, the specific implementation of the dynamic resource management system also includes a service registry that supports high availability and scalability to ensure consistency and reliability in a multi-node environment.

[0019] The beneficial effects of the present invention are:

[0020] 1. Reduce resource consumption

[0021] Low resource usage: Through the design of a lightweight runtime environment, the present invention significantly reduces the memory and CPU resource usage of microservices on embedded devices. The components of the runtime environment are carefully optimized to remove unnecessary functions to ensure efficient operation in resource-constrained environments.

[0022] 2. Shorten startup time

[0023] Fast initialization: By optimizing the startup process, the runtime environment of the present invention can complete initialization in a very short time, significantly shortening the startup time of the microservice.

[0024] 3. Improve communication efficiency

[0025] Low-overhead RPC protocol: The low-overhead RPC protocol designed by the present invention significantly reduces communication overhead through compact message format and multiplexing technology. The size of the message header is minimized, and the data transmission efficiency is greatly improved.

[0026] The present invention provides a lightweight microservice framework implementation method suitable for embedded platforms through a series of technical innovations. These technical solutions not only solve the problems of large resource consumption, long startup time and low communication efficiency in current technologies, but also cooperate with each other to jointly realize the efficient operation of microservices in embedded systems, and also significantly improve the performance, stability and ease of use of the system. The present invention provides a new solution for the microservice of embedded systems, which has broad application prospects and important technical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a design diagram of the lightweight microservice framework architecture of the present invention. DETAILED DESCRIPTION

[0028] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0029] This paper proposes a lightweight microservice framework implementation method for an embedded platform. The design ideas are as follows:

[0030] 1. Lightweight runtime environment:

[0031] Minimize resource usage: By streamlining the components and functions of the runtime environment, it can run efficiently on resource-constrained embedded devices.

[0032] Fast initialization: Optimize the startup process, reduce initialization time, and ensure that microservices can quickly enter a usable state.

[0033] 2. Efficient inter-service communication mechanism:

[0034] Low-overhead RPC protocol: uses a compact message format and multiplexing technology to reduce communication overhead and improve data transmission efficiency.

[0035] 3. Dynamic resource management:

[0036] Dynamic loading and unloading: Provides support for dynamic loading and unloading of microservices in embedded kernel-mode operating systems.

[0037] Service registration and discovery: Supports automatic service registration and discovery mechanisms to ensure dynamic management of service instances.

[0038] Memory management: Optimize memory management strategies, reduce memory fragmentation, and improve memory usage efficiency.

[0039] The architectural design of the lightweight microservice framework is as follows Figure 1 As shown in the figure, the lightweight microservice framework is mainly divided into three parts: lightweight runtime environment, dynamic resource management and lightweight inter-service communication middleware.

[0040] In order to adapt to the resource limitations of embedded platforms, the present invention designs and implements a lightweight runtime environment. The environment aims to minimize resource usage while providing efficient service management and fast initialization capabilities. The design of the lightweight runtime environment follows the following principles: minimize resource usage, and ensure that it can run efficiently on resource-constrained embedded devices by streamlining the components and functions of the runtime environment. Fast initialization, optimize the startup process, reduce initialization time, and ensure that microservices can quickly enter a usable state. The lightweight runtime environment consists of the following core components:

[0041] Service Manager: Responsible for the lifecycle management of microservices, including starting, stopping, restarting, and monitoring. The service manager responds to various service events in the system in an event-driven manner to ensure the normal operation of the service.

[0042] Configuration management: Provides a unified configuration management mechanism that supports dynamic configuration updates and version control. The configuration management module uses a lightweight key-value storage system to achieve efficient reading and writing of configuration information.

[0043] Logging and monitoring: Built-in logging function helps developers and operation and maintenance personnel to find and solve problems in a timely manner. The logging system supports multi-level logging and provides log aggregation and analysis tools.

[0044] Monitoring: Built-in performance monitoring function, the monitoring system provides real-time performance monitoring data by collecting and analyzing system indicators.

[0045] In order to improve the communication efficiency between microservices in embedded platforms, the present invention designs a lightweight inter-service communication middleware, which is a low-overhead remote procedure call (RPC) protocol. The protocol aims to reduce communication overhead, improve data transmission efficiency, and ensure the security and reliability of communication. The middleware adopts a compact message format and a binary encoding format to reduce the size of the message header and improve data transmission efficiency. The message format supports multiple data types, including basic types, arrays, and complex objects; supports multiplexing, supports concurrent processing of multiple requests on the same TCP connection, reduces the overhead of establishing and closing connections, and ensures the stability and efficiency of connections through a flow control mechanism; supports message compression to reduce the occupancy of network bandwidth, and at the same time, provides a variety of encryption algorithms to ensure the security of data transmission.

[0046] In order to adapt to the system resource sensitivity of the embedded platform, the present invention also implements a dynamic resource management system. The system optimizes resource utilization and improves the overall performance of the system by dynamically loading and unloading microservice instances on the embedded platform on demand. The following is a detailed technical description of the resource management system:

[0047] Dynamic loading and unloading: Dynamic loading and unloading on embedded platforms are different from those on Linux. Embedded systems are mostly kernel-mode operating systems, and dynamic recording and unloading can only be completed through protocol definition of the function entry and entry parameters after dynamic loading.

[0048] Service registration and discovery: Supports automatic service registration and discovery mechanisms, and implements dynamic management of service instances through a distributed service registry. The service registry supports high availability and scalability, ensuring consistency and reliability in a multi-node environment.

[0049] Memory management: Optimize memory management strategies, reduce memory fragmentation, and improve memory usage efficiency. Through object pools and cache mechanisms, reduce frequent memory allocation and release operations and reduce system overhead.

[0050] The above-mentioned embodiment only expresses one implementation mode of the present invention, and its description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.

Claims

1. A method for implementing a lightweight microservice framework for an embedded platform, characterized in that: The lightweight microservice framework is divided into three parts: lightweight runtime environment, dynamic resource management system and lightweight service communication middleware. The specific implementation is as follows: The lightweight runtime environment includes service manager, configuration management, logging and monitoring, and monitoring. The specific implementation of each module is as follows: Service manager: responsible for the life cycle management of microservices, including starting, stopping, restarting and monitoring; the service manager responds to various service events in the system in an event-driven manner to ensure the normal operation of the service; Configuration management: provides a unified configuration management mechanism, supports dynamic configuration updates and version control; the configuration management module uses a lightweight key-value storage system to achieve efficient reading and writing of configuration information; Logging and monitoring: built-in logging function helps developers and operation and maintenance personnel to discover and solve problems in a timely manner; the logging system supports multi-level logging and provides log aggregation and analysis tools; Monitoring: Built-in performance monitoring function, the monitoring system provides real-time performance monitoring data by collecting and analyzing system indicators; Lightweight inter-service communication middleware is a low-overhead remote procedure call (RPC) protocol; The middleware adopts a compact message format and binary encoding format to reduce the size of the message header and improve data transmission efficiency; The dynamic resource management system optimizes resource utilization and improves the overall performance of the system by dynamically loading and unloading microservice instances on the embedded platform on demand. The specific implementation is as follows: Dynamic loading and unloading: Dynamic recording and unloading can be completed only by defining the function entry and entry parameters after dynamic loading through the protocol; Service registration and discovery: Support automatic service registration and discovery mechanism, and realize dynamic management of service instances through distributed service registry; Memory management: Optimize memory management strategy, reduce memory fragmentation, and improve memory utilization efficiency; Through object pool and caching mechanism, reduce frequent memory allocation and release operations, and reduce system overhead.

2. The method for implementing a lightweight microservice framework for an embedded platform according to claim 1, characterized in that: The design of the lightweight runtime environment follows the following principles: minimize resource usage and ensure that it can run efficiently on resource-constrained embedded devices by streamlining the components and functions of the runtime environment; Fast initialization, optimizes the startup process, reduces initialization time, and ensures that microservices can quickly enter a usable state.

3. The method for implementing a lightweight microservice framework for an embedded platform according to claim 1, characterized in that: The specific implementation of lightweight inter-service communication middleware also includes: the message format supports multiple data types, including basic types, arrays, and complex objects; supports multiplexing, supports concurrent processing of multiple requests on the same TCP connection, reduces the overhead of establishing and closing connections, and ensures the stability and efficiency of connections through flow control mechanisms; supports message compression to reduce network bandwidth usage, and at the same time, provides multiple encryption algorithms to ensure the security of data transmission.

4. The method for implementing a lightweight microservice framework for an embedded platform according to claim 1, characterized in that: The specific implementation of the dynamic resource management system also includes a service registry to support high availability and scalability, ensuring consistency and reliability in a multi-node environment.

Citation Information

Patent Citations

  • Safe embedded operating system capable of supporting multi-stage loading

    CN102479097A

  • Application management method based on micro-service architecture

    CN112000448A

  • Distributed embedded system servitization software framework

    CN116225386A

Cited By

  • RPC connection management method based on multiplexing and state decoupling

    CN122268925A