A software-hardware decoupling architecture for embedded systems based on models and middleware

Through the embedded system software and hardware decoupling architecture based on model and middleware, the problem of tight coupling between functional scheduling and thread communication in embedded systems and standard computing library and hardware coupling in embedded systems is solved, and the thoroughness of functions, hardware and operating systems is achieved. Decoupling improves the flexibility and adaptability of the system.

CN114398306BActive Publication Date: 2024-11-12DIGITAL YUANSHENG (WUHAN) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210023678.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-10
Publication Date
2024-11-12
Estimated Expiration
2042-01-10

AI Technical Summary

Technical Problem

The software and hardware decoupling design of existing embedded systems has the tight coupling of functional scheduling and communication between threads, the standard computing library is coupled with hardware, and the function processing code is closely related to the operating system, resulting in large-scale modification of applications when hardware replacement and operating system changes. Layer code, and function code cannot be reused directly.

Method used

Adopt the embedded system software and hardware decoupling architecture based on model and middleware, and through abstract design models, middleware such as communication, computing, operating system interfaces, storage reading and writing, to achieve the complete decoupling of functions from hardware and operating systems, and provide Unified interface to support multiplexing.

Benefits of technology

It realizes the complete decoupling of functions from hardware and operating systems, and can efficiently reuse functions, reduces modification work when hardware and operating systems change, and improves the flexibility and adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398306B_ABST
    Figure CN114398306B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of system hardware and software decoupling architecture, and in particular to an embedded system hardware and software decoupling architecture based on models and middleware. The architecture includes a communication, hardware and OS decoupling module, a general mathematical calculation and hardware decoupling module, a function code scheduling and OS decoupling module, and a storage read-write and hardware decoupling module. In the field of embedded software design, the present invention completely abandons the structured programming idea of ​​combining and expanding "files, functions, variables" to form codes, introduces the object-oriented "model" concept, abstracts and designs various models, and lays a solid foundation for hardware and software decoupling. "Function realization" is decoupled from "control", IO, and communication, and the codes of the above functions are no longer mixed in "function realization". It can be efficiently reused in the form of a model. The complex communication forms of the embedded system (intra-chip / inter-chip, multiple communication links, multiple communication protocols) are used as application layer services with a unified interface, and are decoupled from hardware and OS.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of system software and hardware decoupling architecture, and in particular to an embedded system software and hardware decoupling architecture based on models and middleware. Background Art

[0002] The main features of embedded processing systems are as follows: There are many types of processing chips and they are quite different from the architecture of computer CPUs, and they have their own unique instruction sets. Common processing chips include: DSP (TIC6x series), PowerPC, FPGA, FT6678 (domestic DSP), ARM, Feiteng series (domestic CPU, ARM core), Huawei HiSilicon, etc. There are many types of operating systems and they are related to chips to a certain extent. Common ones include SYSBIOS (DSP), OSE (DSP, PowerPC), VxWorks (PowerPC), Ruihua (DSP, domestic), Tianmai (PowerPC, Feiteng, etc., domestic). The operating system has high real-time performance, which is mainly reflected in interrupt response, inter-thread communication, etc., and the delay is usually in microseconds. There are various types of interconnection and communication protocols between processors. Common interconnection methods include Ethernet (UDP or TCP / IP protocol), SRIO (RapidIO, RocketIO protocol), PCI-E, etc. The storage form is different from that of computer CPUs. For example, the DSP chip has limited storage space, but the read and write bandwidth is large and the computing performance is high. The off-chip memory space is large, but the read and write bandwidth is low. At present, the main disadvantages of embedded system hardware and software decoupling are as follows:

[0003] 1. Adopt a structured design approach based on file and function extension. This design approach inevitably results in the result of a single function being provided to other functions, so communication is "mixed" in the function file. Function scheduling and function implementation are tightly coupled, and task (thread) creation, scheduling, and inter-thread communication are tightly coupled with the OS.

[0004] Second, the standard computing function library is used to complete the general mathematical calculations in the algorithm (such as linear algebra, statistics, etc.), and the computing speed and real-time performance can be guaranteed. This design method leads to the coupling of the standard computing library with the hardware. When the hardware is replaced, it is still necessary to replace the new computing library and modify the application layer code.

[0005] 3. Use the API provided by the operating system to complete the communication between threads / tasks of the same processor or Ethernet, and use the API based on BSP encapsulation to complete SRIO and PCI-E communication. This design method causes the function processing code to call OS-related APIs extensively, and the application layer program needs to be modified extensively when the OS is replaced. When the system scale or topology changes, the function processing code cannot be directly reused and deployed to the new node. Summary of the invention

[0006] In view of the problems existing in the background technology, a model-and-middleware-based embedded system hardware and software decoupling architecture is proposed. In the field of embedded software design, the present invention completely abandons the structured programming idea of ​​combining and expanding "files, functions, and variables" to form codes, introduces the object-oriented "model" concept, abstracts and designs various models, and lays a solid foundation for hardware and software decoupling. "Function implementation" is decoupled from "control", IO, and communication, and the codes of the above functions are no longer mixed in "function implementation". It can be efficiently reused in the form of a model. The complex communication forms of the embedded system (intra-chip / inter-chip, multiple communication links, and multiple communication protocols) are used as application layer services with a unified interface, and are decoupled from the hardware and OS.

[0007] The present invention proposes a model and middleware-based embedded system hardware and software decoupling architecture, including a communication and hardware and OS decoupling module, a general mathematical calculation and hardware decoupling module, a function code scheduling and OS decoupling module, and a storage read-write and hardware decoupling module. The architecture steps are as follows:

[0008] S1. Abstract and design various models, and use the models and their interconnections to form software codes, laying a solid foundation for the complete decoupling of software and hardware;

[0009] S2. Based on model abstraction, four types of middleware are constructed, including communication, computing, operating system interface, storage reading and writing, to form an embedded system middleware system based on resource configuration and mapping;

[0010] S3, through the support of model abstraction and communication middleware, OS same interface service middleware, realize the decoupling of communication from hardware and OS;

[0011] S4. Through the control center of the model and the supporting middleware support, the scheduling of functional codes is decoupled from the OS;

[0012] S5. Decoupling general mathematical computing from hardware is achieved through model abstraction and computing middleware support;

[0013] S6. Decoupling storage reading and writing from hardware is achieved through model abstraction and storage reading and writing middleware support.

[0014] Preferably, the steps of S1 are as follows:

[0015] S11, abstract and define the model, I / O is responsible for sending and receiving data, which is implemented by ports. Each model has several input and output ports;

[0016] S12, running the model: the input port senses external data transmission; when the data transmission is completed, a signal is sent to the model control center; after receiving the signal released by the port, the control center parses and searches the signal-function table to obtain the function that should be started; the control center finds the corresponding function entry in the start function list and starts it; after the function processing is completed, the output port is notified and the output port sends the processing result;

[0017] S13. Model interconnection: The channel or link for information transmission between models is abstracted as a "channel"; the channel can be configured according to the actual physical communication link; the channel is interconnected with the output and input ports of the two models that need to be interconnected; the channel provides an interface for the port to send data, which essentially calls the service provided by the communication middleware.

[0018] Preferably, the steps of S2 are as follows:

[0019] S21. Describe the processing hardware resources, including the interconnection relationship and the deployment relationship between the model and the hardware: describe the interconnection and deployment relationship of the functional models through the model integration development tool to form an interconnection and deployment relationship table; describe the hardware required by the system and its interconnection relationship through the IDE to form a hardware configuration (including OS) and routing relationship table;

[0020] S22. Construct communication middleware based on resource configuration and mapping: establish the hierarchical architecture of communication middleware; provide a unified communication "transmitting and receiving" interface for the application layer; at the hardware analysis layer, complete the mapping of model ID to processor / core ID by extracting call parameters and analyzing the "model interconnection and deployment relationship table"; complete the mapping of processor / core hardware type, interconnection form, and routing method through the "hardware configuration and routing relationship table"; at the protocol analysis layer, determine the communication form of the "transmitting and receiving" parties; according to the interconnection form, determine the communication protocol; according to the established routing method, determine the transmission path of the "transmitting and receiving" data or messages; at the device driver layer, combine parameters and call BSP;

[0021] S23. Construct computing middleware based on resource configuration and mapping: establish the hierarchical architecture of computing middleware; provide a unified conventional mathematical computing interface for the application layer; similar to communication middleware, after completing two mappings, obtain the hardware type; according to the hardware type and configuration information, generate parameters adapted to it and call its library function;

[0022] S24. Construct OS unified interface service middleware based on resource configuration and mapping: establish the hierarchical architecture of OS unified interface service middleware; the operation framework provides function scheduling support for the model, and at the same time, the operation framework needs to call the standard interface provided by OS unified interface service middleware; this interface is an abstract class, which specifies the services that the middleware must provide for the operation framework or communication middleware; construct service classes for different operating systems, which inherit from the abstract unified interface class and overload the functions in the interface.

[0023] S25. Build storage read-write middleware based on resource configuration and mapping: establish the hierarchical architecture of storage read-write middleware; provide a unified storage read-write interface for the application layer; similar to the communication middleware, after completing two mappings, obtain the hardware type; based on the hardware type and configuration information, generate parameters that match it and call its library function.

[0024] Preferably, the steps of S3 are as follows:

[0025] S31, the communication between models in the same processor will be converted into the inter-thread communication provided by the operating system, and the decoupling from the OS is achieved by calling the same service interface of the OS in the communication middleware;

[0026] S32. When communicating across processors, regardless of the form of communication, the layered communication middleware based on resource configuration and mapping ensures that the communication is independent of the hardware and the form and protocol of the communication link; when adding new communication links and protocols, the application layer does not need to be modified;

[0027] S33. The communication middleware is called by the channel, so that the internal model is also decoupled from the communication.

[0028] Preferably, the steps of S4 are as follows:

[0029] S41, the control center perceives external information, so that the function implementation is decoupled from I / O;

[0030] S42. The control center implements and switches the control functions through the unified interface provided by the scheduling middleware, while the scheduling middleware is decoupled from the operating system.

[0031] Compared with the prior art, the present invention has the following beneficial technical effects:

[0032] 1. In the field of embedded software design, we completely abandon the structured programming idea of ​​combining and expanding "files, functions, and variables" to form codes, introduce the object-oriented "model" concept, abstract and design various models, and lay a solid foundation for the decoupling of software and hardware.

[0033] Second, "Function Implementation" is decoupled from "Control", IO, and Communication. The codes of the above functions are no longer mixed in "Function Implementation". At the same time, with the assistance of computing and storage read-write middleware, "Function Implementation" is completely decoupled from hardware and OS, so that it can be efficiently reused in the form of a model.

[0034] 3. The complex communication forms of embedded systems (intra-chip / inter-chip, multiple communication links, multiple communication protocols) are served by the application layer with a unified interface, and are decoupled from the hardware and OS.

[0035] Fourth, the unified interface service middleware of the operating system is realized, which expands the connotation of traditional middleware and provides a unified service interface for the application layer and communication middleware. When the operating system changes, the above codes do not need to be modified. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is the abstraction and operation flow chart of the model;

[0037] Figure 2 is the interconnection graph of the model;

[0038] Figure 3 It is a hierarchical block diagram of the communication middleware;

[0039] Figure 4 It is a block diagram of the computing middleware hierarchy;

[0040] Figure 5 Unify the interface service middleware workflow for OS;

[0041] Figure 6 Read and write middleware workflows for storage;

[0042] Figure 7 This is a diagram of the hierarchical hardware and software decoupling architecture. DETAILED DESCRIPTION

[0043] Embodiment 1

[0044] The present invention proposes an embedded system hardware and software decoupling architecture based on models and middleware, including a communication and hardware and OS decoupling module, a general mathematical calculation and hardware decoupling module, a function code scheduling and OS decoupling module, and a storage read-write and hardware decoupling module.

[0045] The architecture steps are as follows:

[0046] S1. Completely abandon the structured programming idea of ​​combining and extending "files, functions, and variables" to form codes, introduce the object-oriented "model" concept, abstract and design various models, and form software codes from models (an object corresponding to something in the real world) and their interconnection, laying a solid foundation for the complete decoupling of software and hardware;

[0047] S2. Based on model abstraction, four types of middleware are constructed, including communication, computing, operating system interface, storage reading and writing, to form an embedded system middleware system based on resource configuration and mapping;

[0048] S3, through the support of model abstraction and communication middleware, OS same interface service middleware, realize the decoupling of communication from hardware and OS;

[0049] S4. Through the control center of the model and the supporting middleware support, the scheduling of functional codes is decoupled from the OS;

[0050] S5. Decoupling general mathematical computing from hardware is achieved through model abstraction and computing middleware support;

[0051] S6. Decoupling storage reading and writing from hardware is achieved through model abstraction and storage reading and writing middleware support.

[0052] Through the above steps, the present invention completes a hierarchical embedded hardware and software decoupling architecture, has a "four-decoupling" capability, and thoroughly and completely solves the problem of hardware and software decoupling of embedded systems.

[0053] Embodiment 2

[0054] The present invention proposes an embedded system hardware and software decoupling architecture based on models and middleware, including a communication and hardware and OS decoupling module, a general mathematical calculation and hardware decoupling module, a function code scheduling and OS decoupling module, and a storage read-write and hardware decoupling module.

[0055] The architecture steps are as follows:

[0056] S1. Completely abandon the structured programming idea of ​​combining and extending "files, functions, and variables" to form codes, introduce the object-oriented "model" concept, abstract and design various models, and form software codes from models (an object corresponding to something in the real world) and their interconnection, laying a solid foundation for the complete decoupling of software and hardware;

[0057] S2. Based on model abstraction, four types of middleware are constructed, including communication, computing, operating system interface, storage reading and writing, to form an embedded system middleware system based on resource configuration and mapping;

[0058] S3, through the support of model abstraction and communication middleware, OS same interface service middleware, realize the decoupling of communication from hardware and OS;

[0059] S4. Through the control center of the model and the supporting middleware support, the scheduling of functional codes is decoupled from the OS;

[0060] S5. Decoupling general mathematical computing from hardware is achieved through model abstraction and computing middleware support;

[0061] S6. Decoupling storage reading and writing from hardware is achieved through model abstraction and storage reading and writing middleware support.

[0062] Furthermore, the steps of S1 are as follows:

[0063] S11. Abstract and define the model. A model is an object that can receive external information, control its own behavior, complete certain functions, and output work results. From the above definition, it can be seen that I / O, behavior control, and implementation function are the three elements that constitute the model. See Figure 1 Description. I / O is responsible for sending and receiving data, similar to human senses, such as eyes and mouth, which perceive external information and transmit information to the outside world. It is implemented by ports. Each model has several input and output ports. Behavior control is similar to the human brain. Functional implementation is similar to human abilities, such as cooking and running.

[0064] S12, running the model: the input port senses external data transmission; when the data transmission is completed, a signal is sent to the model control center; after receiving the signal released by the port, the control center parses and searches the signal-function table to obtain the function that should be started; the control center finds the corresponding function entry in the start function list and starts it; after the function processing is completed, the output port is notified and the output port sends the processing result;

[0065] S13. Model interconnection: The channel or link for information transmission between models is abstracted as a "channel"; the channel can be configured according to the actual physical communication link, such as the SRIO channel; the channel is interconnected with the output and input ports of the two models that need to be interconnected; the channel provides an interface for the port to send data, which essentially calls the service provided by the communication middleware.

[0066] Furthermore, the steps of S2 are as follows:

[0067] S21, such as Figure 2 As shown, the processing hardware resources include interconnection relationships, model and hardware deployment relationships: the functional model interconnection and deployment relationships are described through the model integrated development tool (hereinafter referred to as IDE) to form a hardware configuration and routing relationship table, as shown in Table 1; the hardware required by the system and its interconnection relationships are described through the IDE to form a hardware configuration (including OS) and routing relationship table, as shown in Table 2; Table 1 is a model interconnection and deployment relationship table, and Table 2 is a hardware configuration and routing relationship table;

[0068]

[0069]

[0070] Table 1

[0071]

[0072] Table 2

[0073] S22. Build communication middleware based on resource configuration and mapping: Establish the hierarchical architecture of communication middleware, such as Figure 3 As shown; provide a unified communication "transmitting and receiving" interface for the application layer; at the hardware analysis layer, complete the mapping of model ID to processor / core ID by extracting call parameters and analyzing the "model interconnection and deployment relationship table"; complete the mapping of processor / core hardware type, interconnection form, and routing method through the "hardware configuration and routing relationship table"; at the protocol analysis layer, determine the communication form of the "transmitting and receiving" parties (inter-chip core communication, cross-chip communication); determine the communication protocol according to the interconnection form; determine the transmission path of "transmitting and receiving" data or messages according to the established routing method; finally determine the following points: first, if it is inter-core communication, bypass the driver layer and directly call the OS unified interface middleware; second, if it is cross-chip communication, choose to call BSP (such as SRIO) or call the communication protocol stack provided by OS (such as TCP / IP) according to the communication protocol; at the device driver layer, combine parameters and call BSP;

[0074] S23. Construct computing middleware based on resource configuration and mapping: Establish the hierarchical architecture of computing middleware, such as Figure 4 As shown; Provide a unified conventional mathematical calculation interface for the application layer; Similar to the communication middleware, after completing the two mappings, the hardware type is obtained; According to the hardware type and configuration information, the parameters adapted to it are generated and its library function is called;

[0075] S24. Construct OS unified interface service middleware based on resource configuration and mapping: Establish the hierarchical architecture of OS unified interface service middleware, such as Figure 7 As shown in the figure; the running framework provides function scheduling support for the model. At the same time, the running framework needs to call the standard interface provided by the OS unified interface service middleware; this interface is an abstract class that specifies the services that the middleware must provide for the running framework or communication middleware; service classes for different operating systems are constructed. These classes inherit from the abstract unified interface class and overload the functions in the interface.

[0076] S25. Build storage read-write middleware based on resource configuration and mapping: Establish the hierarchical architecture of storage read-write middleware, such as Figure 6 As shown, a unified storage read and write interface is provided for the application layer; similar to the communication middleware, after completing the two mappings, the hardware type is obtained; according to the hardware type and configuration information, the corresponding parameters are generated and its library function is called.

[0077] Furthermore, the steps of S3 are as follows:

[0078] S31, such as Figure 5As shown, the communication between models in the same processor will be converted into the inter-thread communication provided by the operating system, and the decoupling from the OS is achieved by calling the same service interface of the OS in the communication middleware;

[0079] S32. When communicating across processors, regardless of the form of communication, the layered communication middleware based on resource configuration and mapping can ensure that the communication is independent of the hardware and the form and protocol of the communication link; when adding new communication links and protocols, the application layer does not need to be modified;

[0080] S33. The communication middleware is called by the channel, so that the internal model is also decoupled from the communication.

[0081] Furthermore, the steps of S4 are as follows:

[0082] S41, the control center perceives external information, so that the function implementation is decoupled from I / O;

[0083] S42. The control center controls function implementation and switching through the unified interface provided by the scheduling middleware, and the scheduling middleware is decoupled from the operating system. Therefore, even if the OS changes, only the middleware needs to be modified to adapt to the new operating system, and no changes are required in the application layer model, whether it is the control center or the function implementation.

[0084] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.

Claims

1. A decoupled architecture of embedded system hardware and software based on models and middleware, It is characterized in that It includes the communication and hardware and OS decoupling module, the general mathematical calculation and hardware decoupling module, the function code scheduling and OS decoupling module, and the storage read and write and hardware decoupling module; the architecture steps are as follows: S1. Abstract and design various models, and use the models and their interconnections to form software codes, laying a solid foundation for the complete decoupling of software and hardware; S2. Based on model abstraction, four types of middleware are constructed: communication, computing, operating system interface, and storage reading and writing, forming an embedded system middleware system based on resource configuration and mapping; S3, through the support of model abstraction and communication middleware, OS same interface service middleware, realize the decoupling of communication from hardware and OS; S4. Through the control center of the model and the supporting middleware support, the scheduling of functional codes is decoupled from the OS; S5. Decoupling general mathematical computing from hardware is achieved through model abstraction and computing middleware support; S6. Decoupling storage reading and writing from hardware is achieved through model abstraction and storage reading and writing middleware support; The steps of S1 are as follows: S11, abstract and define the model, I / O is responsible for sending and receiving data, which is implemented by ports. Each model has several input and output ports; S12, running the model: the input port senses external data transmission; when the data transmission is completed, a signal is sent to the model control center; after receiving the signal released by the port, the control center parses and searches the signal-function table to obtain the function that should be started; the control center finds the corresponding function entry in the start function list and starts it; after the function processing is completed, the output port is notified and the output port sends the processing result; S13, Model interconnection: The channel or link for information transmission between models is abstracted as a "channel"; the channel is configured according to the actual physical communication link; the channel is interconnected with the output and input ports of the two models that need to be interconnected; the channel provides an interface for the port to send data, which essentially calls the service provided by the communication middleware; The steps of S2 are as follows: S21. Describe the processing hardware resources, including the interconnection relationship and the deployment relationship between the model and the hardware: describe the interconnection and deployment relationship of the functional models through the model integration development tool to form a model interconnection and deployment relationship table; describe the hardware required by the system and its interconnection relationship through the IDE to form a hardware configuration and routing relationship table; S22. Build communication middleware based on resource configuration and mapping: Establish the hierarchical architecture of communication middleware; provide a unified communication "sending and receiving" interface for the application layer; in the hardware analysis layer, complete the mapping of model ID to processor / core ID by extracting call parameters and analyzing the "model interconnection and deployment relationship table"; complete the mapping of processor / core hardware type, interconnection form, and routing method through the "hardware configuration and routing relationship table"; in the protocol analysis layer, determine the communication form of the "sending and receiving" parties; Determine the communication protocol based on the interconnection form; determine the transmission path for "sending and receiving" data or messages based on the established routing method; At the device driver layer, combine parameters and call BSP; S23. Construct computing middleware based on resource configuration and mapping: Establish the hierarchical architecture of computing middleware; provide a unified conventional mathematical computing interface for the application layer; similar to communication middleware, after completing two mappings, obtain the hardware type; According to the hardware type and configuration information, generate the appropriate parameters and call its library function; S24. Construct OS unified interface service middleware based on resource configuration and mapping: Establish the hierarchical architecture of OS unified interface service middleware; the operation framework provides function scheduling support for the model, and at the same time, the operation framework needs to call the standard interface provided by OS unified interface service middleware; the interface is an abstract class, which specifies the services that the middleware must provide for the operation framework or communication middleware; construct service classes for different operating systems, which inherit from the abstract unified interface class and overload the functions in the interface; S25. Construct storage read-write middleware based on resource configuration and mapping: establish the hierarchical architecture of storage read-write middleware; provide a unified storage read-write interface for the application layer; similar to the communication middleware, after completing the two mappings, obtain the hardware type; According to the hardware type and configuration information, generate appropriate parameters and call its library function.

2. According to claim 1, a model and middleware-based embedded system hardware and software decoupling architecture, It is characterized in that The steps for S3 are as follows: S31, the communication between models in the same processor will be converted into the inter-thread communication provided by the operating system, and the decoupling from the OS is achieved by calling the same service interface of the OS in the communication middleware; S32. When communicating across processors, regardless of the form of communication, the layered communication middleware based on resource configuration and mapping ensures that the communication is independent of the hardware and the form and protocol of the communication link; when adding new communication links and protocols, the application layer does not need to be modified; S33. The communication middleware is called by the channel, so that the internal model is also decoupled from the communication.

3. The embedded system hardware and software decoupling architecture based on model and middleware according to claim 1, It is characterized in that The steps of S4 are as follows: S41, the control center perceives external information, so that the function implementation is decoupled from I / O; S42. The control center implements and switches the control functions through the unified interface provided by the scheduling middleware, while the scheduling middleware is decoupled from the operating system.