An embedded application layer software execution method and system based on a decoupling architecture

CN122593750APending Publication Date: 2026-08-18XIAN AISHENG TECH GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610764321.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]本申请公开了一种基于解耦架构的嵌入式应用层软件执行方法、系统、电子设备及存储介质,旨在解决现有技术中嵌入式应用层软件外设控制与功能逻辑深度耦合、直接复用率低的技术问题

Benefits of technology

[0014] This application discloses an embedded application layer software execution method based on a decoupled architecture, comprising dividing the application into a task management module, a data management module, and a peripheral management module; declaring public variables and task variables in the data management module; the peripheral management module receiving raw data from peripherals, processing the data, and assigning the processed data to public variables; the data management module obtaining the values ​​of public variables and assigning them to task variables for use by task functions in the task management module; the task management module executing task functions, performing logic control or data calculation based on task variables, generating control parameters required for peripheral control, and assigning the control parameters to task variables; the data management module obtaining the values ​​of task variables containing control parameters and assigning them back to public variables; and the peripheral management module obtaining the values ​​of public variables to execute corresponding peripheral control. By introducing a data management module as a transit hub and utilizing a two-way assignment mechanism between public variables and task variables, deep decoupling of task logic and peripheral control is achieved. This architecture design effectively improves the management capabilities of embedded application layer software for peripherals, greatly enhances the compatibility of embedded applications with various peripherals, increases code reusability, reduces repetitive work in the development process, and improves the efficiency of embedded software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593750A_ABST
    Figure CN122593750A_ABST
Patent Text Reader

Abstract

The application discloses an embedded application layer software execution method, system and medium based on a decoupling architecture, wherein public variables and task variables are declared in a data management module; a peripheral management module receives peripheral original data, performs data processing, and assigns the processed data to the public variables; the data management module acquires the values of the public variables and assigns the values to the task variables for calling by a task function in a task management module; the task management module executes the task function, performs logical control or data calculation based on the task variables, generates control parameters required by peripheral control, and assigns the control parameters to the task variables; the data management module acquires the values of the task variables containing the control parameters and assigns the values back to the public variables; and the peripheral management module acquires the values of the public variables to execute corresponding peripheral control. The application modularly designs software functions, can realize direct reuse of codes for the same peripheral control, and improves the development efficiency of embedded application layer software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of embedded software architecture design technology, specifically to an embedded application layer software execution method, system, and storage medium based on a decoupled architecture. Background Technology

[0002] Embedded software constitutes a significant portion of embedded development and is an indispensable part of the process. Embedded software reads and modifies hardware data through instructions to achieve intelligent control, data processing, and function execution of the device. Due to differences in hardware design, even software implementing the same function in different embedded devices requires adaptive development for different hardware designs. In the past, various layered architectures for embedded software systems emerged to address the characteristics of embedded design. The main idea was to divide embedded software into hardware, driver, operating system, middleware, and application layers. This layered approach effectively separates hardware drivers from logical functions, greatly improving the development efficiency and reusability of embedded software. However, efficient architecture design is lacking for the application layer software that ultimately implements the logical functions. While layered design at the system level greatly facilitates the development of embedded devices using the same or similar main control chips, for the application layer software implementing the logic, due to differences in target functions, interactive peripherals, and developer coding styles, peripheral control and functional logic are deeply coupled at the application layer. Even for embedded devices implementing similar functions, a change in a single peripheral often leads to significant changes in the embedded application layer software. Therefore, studying the architecture design of embedded application layer software is of profound significance for improving embedded software development. Summary of the Invention

[0003] This application discloses an embedded application layer software execution method, system, electronic device and storage medium based on a decoupled architecture, which aims to solve the technical problems of deep coupling between peripheral control and functional logic of embedded application layer software and low direct reuse rate in the prior art.

[0004] To achieve the above objectives, the first aspect of this application provides an embedded application layer software execution method based on a decoupled architecture, characterized in that the application program is divided into a task management module, a data management module, and a peripheral device management module; the method includes: Declare public variables and task variables in the data management module; The peripheral management module receives raw data from peripherals, processes the data, and then assigns the processed data to the public variable. The data management module obtains the value of the public variable and assigns it to the task variable for use by the task function in the task management module; The task management module executes the task function, performs logical control or data calculation based on the task variable, generates the control parameters required for peripheral control, and assigns the control parameters to the task variable. The data management module obtains the value of the task variable containing the control parameters and assigns it back to the public variable; The peripheral management module obtains the value of the public variable to execute the corresponding peripheral control.

[0005] Optionally, the peripheral management module declares public variables required for peripheral control and encapsulates peripheral data processing functions and peripheral function functions; the peripheral data processing functions are used to encode and decode the received raw peripheral data and assign the encoded and decoded data to the public variables.

[0006] Optionally, various task processing functions are encapsulated in the task management module; the task functions do not directly call the public variables, but only obtain the data required for peripheral interaction by reading the values ​​of the task variables.

[0007] Optionally, the data management module is also used to receive task variables required for inter-task calls from the task management module, and to transfer and assign data between different task functions.

[0008] Optionally, when hardware peripherals in the peripheral management module are added, removed, or replaced, the variable mapping relationship assigned to the task variable is modified in the data management module without changing the task function in the task management module.

[0009] Optionally, the public variables are external variables contained in peripheral modules encapsulated as lib libraries or external variables used in files outside the main program and declared in the application; the task variables are local variables used inside the task function.

[0010] Optionally, the peripheral raw data is received and sent via serial communication; the data management module is responsible for parsing the received serial communication data and assigning it to the common variable, as well as packaging the value of the common variable containing control parameters and sending it to the corresponding peripheral hardware device via serial communication.

[0011] Optionally, it is applied to an embedded flight control application with an inertial measurement unit (IMU); wherein, the peripheral management module is an IMU module, the task management module is used to perform flight logic control and attitude data calculation, and the data management module is responsible for receiving, assigning, and transmitting raw IMU data and distributing flight control parameters.

[0012] To achieve the above objectives, a second aspect of this application also provides an embedded application layer software system based on a decoupled architecture, characterized in that it includes: The task management unit is configured with various task processing functions, which are used to read task variables for logical control or data calculation, generate control parameters required for peripheral control, and assign them to the task variables. The data management unit is configured with a declaration space for public variables and task variables. It is used to receive the value of the data processed by the peripheral device and assign it to the public variable, assign the value of the public variable to the task variable for the task management unit to call, and obtain the value of the task variable containing control parameters and assign it back to the public variable. The peripheral management unit is used to receive raw peripheral data, encode and decode it, assign the data to the public variable, and obtain the value of the public variable to execute the corresponding peripheral control.

[0013] To achieve the above objectives, a third aspect of this application also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the embedded application layer software execution method based on a decoupled architecture as provided in the preceding embodiments.

[0014] This application discloses an embedded application layer software execution method based on a decoupled architecture, comprising dividing the application into a task management module, a data management module, and a peripheral management module; declaring public variables and task variables in the data management module; the peripheral management module receiving raw data from peripherals, processing the data, and assigning the processed data to public variables; the data management module obtaining the values ​​of public variables and assigning them to task variables for use by task functions in the task management module; the task management module executing task functions, performing logic control or data calculation based on task variables, generating control parameters required for peripheral control, and assigning the control parameters to task variables; the data management module obtaining the values ​​of task variables containing control parameters and assigning them back to public variables; and the peripheral management module obtaining the values ​​of public variables to execute corresponding peripheral control. By introducing a data management module as a transit hub and utilizing a two-way assignment mechanism between public variables and task variables, deep decoupling of task logic and peripheral control is achieved. This architecture design effectively improves the management capabilities of embedded application layer software for peripherals, greatly enhances the compatibility of embedded applications with various peripherals, increases code reusability, reduces repetitive work in the development process, and improves the efficiency of embedded software development. Attached Figure Description

[0015] Figure 1 A schematic diagram of the architecture design of an embedded application layer software execution method based on a decoupled architecture, provided for an embodiment of this application; Figure 2This document provides a flowchart illustrating the implementation of an embedded application layer software execution method based on a decoupled architecture, as illustrated in an embodiment of this application. Figure 3 This is a flowchart illustrating an embedded application layer software execution method based on a decoupled architecture, as provided in an embodiment of this application.

[0016] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0017] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0018] In the embodiments of this application, the following key terms are explained for ease of understanding: Public variables: These are external variables that are directly called by the application from peripheral modules encapsulated as lib libraries or used in files outside the main program and need to be declared in the application. These variables mainly include those required for peripheral communication (receiving and sending data), those assigned values ​​after peripheral data processing, and those required for peripheral control.

[0019] Task variables: Local variables used within the task function to receive values ​​of public variables for the task function to call, and to pass control parameters back to the data management module.

[0020] Peripheral raw data: Unprocessed initial data obtained from hardware peripherals through serial communication or other means.

[0021] Embedded main control chip / terminal: The device containing the electronic device or processor that executes the method of this application, responsible for running the application program and coordinating the data interaction of each module.

[0022] In existing layered architecture designs for embedded software systems, embedded software is typically divided into a hardware layer, a driver layer, an operating system layer, a middleware layer, and an application layer. While this design effectively separates hardware drivers from logical functions, in the application layer where the final logical functions are implemented, peripheral control and functional logic are often deeply coupled due to differences in target functions, interactive peripherals, and developers' coding styles. When a single peripheral changes, it often leads to significant changes in the application layer software, resulting in low direct reusability.

[0023] refer to Figures 1-3 The first embodiment of this application provides an embedded application layer software execution method based on a decoupled architecture to solve the technical problems of deep coupling between peripheral control and functional logic in embedded application layer software and low direct reuse rate mentioned in the background art. This method can be executed by a processor, which can be located in a terminal or a server. The execution process of this method is as follows: Step S101: Declare public variables and task variables in the data management module; Step S102: After receiving the raw data from the peripheral device and processing it, the peripheral management module assigns the processed data to a public variable. Step S103: The data management module obtains the value of the public variable and assigns it to the task variable for the task function in the task management module to call; Step S104: The task management module executes the task function, performs logic control or data calculation based on the task variable, generates the control parameters required for peripheral control, and assigns the control parameters to the task variable. Step S105: The data management module retrieves the values ​​of the task variables containing control parameters and assigns them back to the public variables; Step S106: The peripheral management module obtains the value of the public variable to execute the corresponding peripheral control.

[0024] The public variables mentioned above refer to variables contained in peripheral modules encapsulated as lib libraries that are directly called in the application, or variables used in files outside the main program that need to be declared in the application. We call the external variables of peripheral modules that need to be declared in the application public variables. These mainly include variables required for peripheral communication to receive and send data, variables assigned values ​​after peripheral data processing, and variables required for peripheral control.

[0025] The task variables mentioned refer to variables used in task functions. Public variables are not directly called within task functions. If data from public variables needs to be used, the public variables must first be assigned values ​​to task variables. The purpose is to ensure that when peripheral modules change, only the variables assigned to task variables need to be changed in the data management module, without requiring modifications within the task functions. Similarly, assigning values ​​to public variables required for peripheral management only needs to be done in the data management module using the required task variables, without needing to assign values ​​to public variables within the task functions, thus achieving decoupling between tasks and peripherals.

[0026] In one embodiment of this application, a public variable required for peripheral control is declared in the peripheral management module, and peripheral data processing functions and peripheral function calls are encapsulated. The peripheral data processing function is used to encode and decode the received raw peripheral data and assign the encoded / decoded data to the public variable. By encoding and decoding the raw peripheral data, the accuracy and integrity of the transmitted data can be ensured, providing a reliable data foundation for subsequent logical calculations.

[0027] In this embodiment, the task management module encapsulates various task processing functions, mainly including procedural logic control and data calculation tasks. These encapsulated task functions directly call various variables processed in the data module to achieve interaction with peripherals and realize the target functions of the embedded device.

[0028] Furthermore, various task processing functions are encapsulated within the task management module. These task functions do not directly call public variables; instead, they retrieve the data required for peripheral interaction by reading the values ​​of task variables. This design ensures that the logic implementation of the task functions is completely independent of the specific hardware peripheral interface, achieving isolation between business logic and underlying data.

[0029] In this embodiment, various variables are declared in the data management module to receive and send data required for peripheral control, and to perform data processing and variable assignment. The declared variables include task variables required for inter-task function calls, and common variables and task variables required for interaction between task functions and peripherals. Simultaneously, the data management module receives peripheral data, calls peripheral data processing functions, and completes the reception of peripheral data and assigns it to common variables for direct invocation by task functions. The common variables directly invoked by task functions are then assigned values ​​to the variables required for peripheral control.

[0030] In an optional embodiment of this application, the data management module is further configured to receive task variables required for inter-task calls from the task management module, and to transfer and assign data between different task functions. By using the data management module as a relay station, not only is the decoupling of tasks and peripherals achieved, but also data sharing and interaction between different tasks are realized, avoiding resource contention and data conflicts when multiple tasks are running in parallel.

[0031] In this embodiment, the peripheral management module declares public variables required for peripheral control, encapsulates peripheral data processing functions, and encapsulates peripheral function calls. It obtains the parameters for controlling the peripherals from the task functions required by the function calls through the public variables, and acquires the peripheral data received from the data processing module. The received peripheral data is decoded through the data processing functions, and the peripheral control functions are implemented through the function calls.

[0032] Furthermore, when hardware peripherals in the peripheral management module are added, removed, or replaced, the variable mapping relationship assigned to task variables is modified in the data management module, without requiring changes to the task functions in the task management module. This design significantly reduces the maintenance costs of system upgrades and peripheral replacements, and improves the system's scalability.

[0033] For example, the peripheral device's raw data is received and sent via serial communication. The data management module is responsible for parsing the received serial communication data and assigning it to public variables, as well as packaging the values ​​of public variables containing control parameters and sending them to the corresponding peripheral hardware device via serial communication. This step clarifies the physical transmission path and protocol processing method of the data, ensuring the real-time performance and reliability of the software and hardware interaction.

[0034] In an optional embodiment of this application, the method is applied to an embedded flight control application with an inertial measurement unit (IMU). The peripheral management module is the IMU module, the task management module performs flight logic control and attitude data calculation, and the data management module is responsible for receiving, assigning, and transmitting raw IMU data, as well as distributing flight control parameters. In this application scenario, the decoupled architecture design ensures high-precision attitude calculation and stable control of the aircraft in complex dynamic environments.

[0035] The following detailed description of a typical implementation example of the embedded application layer software architecture design method of the present invention further illustrates the method. It is important to note that the following implementation example is only used to further illustrate the method and should not be construed as limiting the scope of protection of the method. Any non-essential improvements and adjustments made to the method by those skilled in the art based on the above description still fall within the scope of protection of this invention.

[0036] This invention proposes an embedded application layer software architecture method. This method divides the application program into a task management module (containing task functions), a data management module (containing public variable declarations, peripheral data reception, and peripheral data transmission), and a peripheral management module (containing public variable declarations required for peripheral control, peripheral data encoding / decoding, and peripheral function calls). Taking an embedded flight control application with an inertial measurement unit (IMU) as an example, the application implementation flow is as follows: Figure 2 As shown.

[0037] The task management module encapsulates various task processing functions, mainly including flight logic control and data computation. The task functions retrieve the assigned task variables from the IMU in the data management module, and after execution, return the required task variables from the IMU's public variables in the data management module.

[0038] In the data management module, declare public and task variables, receive and send data required for peripheral control, and perform data processing and variable assignment. For example... Figure 2As shown, the data management module receives initial data from the IMU hardware device via serial communication and assigns the acquired data to a public variable. Simultaneously, the data management module retrieves values ​​from the task variables assigned in the task function and assigns them to the public variable. After being retrieved, the public variable is either directly called by the IMU module or sent to the IMU hardware device by the data management module via the serial port.

[0039] In the peripheral management module, declare the public variables required for IMU control, encapsulate peripheral data processing functions, and encapsulate IMU function functions. For example... Figure 2 As shown, the IMU module obtains the values ​​of public variables from the data management module for data processing and function execution, and assigns the decoded IMU data to the public variables for direct use by the data processing module.

[0040] In the application examples of this invention, the embedded application software architecture method proposed in this invention effectively decouples the task management program from the peripheral management program, which can greatly facilitate the development of products in the same series, improve the development efficiency of adding, removing or replacing peripherals, reduce the difficulty of redeveloping products in the series, and increase the direct reuse rate of mature code.

[0041] To address the aforementioned technical problems, the second embodiment of this application provides an embedded application layer software system based on a decoupled architecture to solve the same technical problems as the method embodiment. The system 1000 may include the following modules: a task management unit 1001, a data management unit 1002, and a peripheral management unit 1003.

[0042] The task management unit 1001 is equipped with various task processing functions, which are used to read task variables for logic control or data calculation, generate control parameters required for peripheral control, and assign them to the task variables. The data management unit 1002 is configured with a declaration space for public variables and task variables, which is used to receive the value of the peripheral data after processing and assign it to the public variable, assign the value of the public variable to the task variable for the task management unit to call, and obtain the value of the task variable containing control parameters and assign it back to the public variable. The peripheral management unit 1003 is used to receive raw peripheral data, encode and decode it, assign the data to the public variable, and obtain the value of the public variable to execute the corresponding peripheral control.

[0043] It is understood that this embodiment is the system authority corresponding to the method authority, and therefore this embodiment has all the technical effects of the method embodiment, which will not be repeated here.

[0044] To address the aforementioned technical problems, a third embodiment of this application provides an electronic device, including a processor and a memory; wherein the memory is used to store a computer program, and the processor is used to execute the computer program to implement the embedded application layer software execution method based on a decoupled architecture as provided in the preceding embodiments.

[0045] The fourth embodiment of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the embedded application layer software execution method based on a decoupled architecture as provided in the previous embodiments.

[0046] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for executing embedded application layer software based on a decoupled architecture, characterized in that, The application is divided into a task management module, a data management module, and a peripheral device management module; the method includes: Declare public variables and task variables in the data management module; The peripheral management module receives raw data from peripherals, processes the data, and then assigns the processed data to the public variable. The data management module obtains the value of the public variable and assigns it to the task variable for use by the task function in the task management module; The task management module executes the task function, performs logical control or data calculation based on the task variable, generates the control parameters required for peripheral control, and assigns the control parameters to the task variable. The data management module obtains the value of the task variable containing the control parameters and assigns it back to the public variable; The peripheral management module obtains the value of the public variable to execute the corresponding peripheral control.

2. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, In the peripheral management module, public variables required for peripheral control are declared, and peripheral data processing functions and peripheral function functions are encapsulated. The peripheral data processing functions are used to encode and decode the received raw peripheral data and assign the encoded and decoded data to the public variables.

3. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, The task management module encapsulates various task processing functions; these task functions do not directly call the public variables, but only obtain the data required for peripheral interaction by reading the values ​​of the task variables.

4. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, The data management module is also used to receive task variables required for inter-task calls from the task management module, and to transfer and assign data between different task functions.

5. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, When hardware peripherals in the peripheral management module are added, removed, or replaced, the variable mapping relationship assigned to the task variable in the data management module is modified without changing the task function in the task management module.

6. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, The public variables are external variables contained in peripheral modules encapsulated as lib libraries or external variables used in files outside the main program and declared in the application; the task variables are local variables used inside the task function.

7. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, The peripheral raw data is received and sent via serial communication; the data management module is responsible for parsing the received serial communication data and assigning it to the common variable, as well as packaging the values ​​of the common variable containing control parameters and sending them to the corresponding peripheral hardware device via serial communication.

8. The embedded application layer software execution method based on a decoupled architecture as described in claim 1, characterized in that, An embedded flight control application for use with an inertial measurement unit (IMU); wherein the peripheral management module is an IMU module, the task management module is used to execute flight logic control and attitude data calculation, and the data management module is responsible for receiving, assigning, and transmitting raw IMU data and distributing flight control parameters.

9. An embedded application layer software system based on a decoupled architecture, characterized in that, include: The task management unit is configured with various task processing functions, which are used to read task variables for logical control or data calculation, generate control parameters required for peripheral control, and assign them to the task variables. The data management unit is configured with a declaration space for public variables and task variables. It is used to receive the value of the data processed by the peripheral device and assign it to the public variable, assign the value of the public variable to the task variable for the task management unit to call, and obtain the value of the task variable containing control parameters and assign it back to the public variable. The peripheral management unit is used to receive raw peripheral data, encode and decode it, assign the data to the public variable, and obtain the value of the public variable to execute the corresponding peripheral control.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the embedded application layer software execution method based on a decoupled architecture as described in any one of claims 1 to 8.