Design method and calling method of driver interface

By designing a driver interface framework and a unified driver execution interface in the aviation industry, the problem of strong coupling between the driver interface, hardware and applications is solved, development efficiency and quality are improved, and the independence and compatibility of the driver interface are achieved. , simplifying the development process.

CN118689458APending Publication Date: 2024-09-24SHAANXI QIANSHAN AVIONICS
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410721746.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the aviation industry, as the complexity of electromechanical systems and interface types increases, the difficulty of developing driver interface programs increases, resulting in high development costs, low efficiency, and strong coupling between the driver interface and hardware design and application programs. Affect software quality and development cycle.

Method used

Design a driver interface method. By building a driver framework, create a BSP board-level support package, use a unified driver execution interface, support C language coding, have scalability and independence, and reduce the coupling between the driver interface and the application program. The human-computer interaction interface designed by Qt software is used to generate .h or .o files to achieve rapid development and compatibility of the driver interface.

Benefits of technology

It improves the development speed and quality of driver interface software, reduces the strong coupling between the driver interface and the application program, makes the driver interface independent, simplifies the development process, and reduces the cost and development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689458A
    Figure CN118689458A
Patent Text Reader

Abstract

The invention belongs to the technical field of avionics and communication, and particularly relates to a design method and a calling method of a driving interface. The driving interface design method comprises the following steps: building a driving framework in a driving interface, and creating a BSP board-level support package for each function in the driving framework; each functional module in the driving framework corresponds to a corresponding driving execution interface; the drive execution interface is used for realizing interface packaging of the drive interface and is called by an application layer program; according to the method, the development speed, the development quality, the development efficiency and the like of the drive interface software are improved, the strong coupling between the drive interface and the application program is reduced, and the drive interface has independence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of aviation electronic technology and communication technology, and in particular relates to a design method and a calling method of a drive interface. Background Art

[0002] In recent years, with the rapid development of the aviation industry, electromechanical systems have become increasingly complex. With the continuous development of technology, functions are constantly being improved. The corresponding electromechanical systems contain more and more interface types, and more driver interface programs are needed to support the products. In the specific application process, the driver is the link between the hardware and the application, and the calling relationship between the driver and the application layer is complex and changeable. By writing the driver, it can be called by the application to realize different product functions. However, for the current development of the aviation industry, there are more and more product models and more and more interface types. At the same time, with the development of the domestic platform, the reuse of the underlying driver and the calling method are becoming more and more important. This is a sign of the maturity of the software product.

[0003] How to reduce the difficulty of software development, reduce repetitive labor, reduce development costs, improve development efficiency and software quality, shorten the development cycle, and reduce the strong coupling between driver interface programs and hardware design and application programs is of great significance to the advancement of product development. Summary of the invention

[0004] To solve the above problems, the present invention provides a design method and a calling method of a driver interface, which not only improves the development speed, development quality and development efficiency of the driver interface software, but also reduces the strong coupling between the driver interface and the application program, thereby making the driver interface independent.

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

[0006] A drive interface design method, comprising:

[0007] A driver framework is built in the driver interface, and a BSP board support package is created for each function in the driver framework; each functional module in the driver framework corresponds to a corresponding driver execution interface; the driver execution interface is used to implement the interface encapsulation of the driver interface and is called by the application layer program;

[0008] The driving interface is connected to a plurality of functional interfaces; each of the functional interfaces uses the same function; when the application layer program calls the driving interface, the caller inputs parameters in a fixed format as formal parameters to the driving interface, and the driving interface returns the calling result.

[0009] Furthermore, the driver interface is compatible with settings; the driver interface is coded in C language, does not use library files, and supports compilation under any development platform.

[0010] Furthermore, the driver interface can be expanded and set. When the system needs to add new functions, a new driver execution interface type is redefined and added to the driver framework.

[0011] Furthermore, the driver execution interface has functions that can be filled in by the designer;

[0012] When the product equipped with the driving interface changes, the driving interface is changed by filling in the hardware parameters in the driving execution program through the human-computer interaction interface.

[0013] Furthermore, the human-computer interaction interface is designed based on Qt software.

[0014] Furthermore, the execution file provided by the driver interface to the application layer is a .h or .o file.

[0015] The present invention also proposes a method for calling a drive interface based on the above drive interface design method, wherein the drive interface is generated based on a host computer and is mounted on a product; the method for calling the drive interface comprises the following steps:

[0016] S101: Selecting the corresponding driver execution interface according to the functional design of the product;

[0017] S102: Fill in the hardware parameters of the driver execution interface based on the performance of the product design by the host computer;

[0018] S103: Selecting a corresponding driver interface according to the CPU type of the product and the operating system type used by the application layer;

[0019] S104: The QT software installed on the host computer traverses the entire BSP board support package according to the type of the driver execution interface selected in S101, returns the acquired information, and determines whether it is compatible with the application layer operating system;

[0020] S105: If fully compatible, the QT software generates a corresponding driver and compiles and synthesizes the xxx.o or xxx.h file to adapt to the product call.

[0021] Furthermore, the hardware parameters include: the number of channels of the switch quantity, the number of analog switches for acquiring the switch quantity and the cascade mode, the number of channels of the analog quantity, the number of channels of the RS422 bus and the number of channels of ARINC429.

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

[0023] The present invention provides a method for designing and calling a driver interface, which not only improves the development speed, quality and efficiency of the driver interface software, but also reduces the strong coupling between the driver interface and the application program, thereby making the driver interface independent. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 The system of the present invention is constituted;

[0026] Figure 2 Design of driver interface;

[0027] Figure 3 This is the flowchart for calling the driver interface. DETAILED DESCRIPTION

[0028] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0029] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0030] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0031] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0032] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0033] In one embodiment of the present invention, a drive interface design method is provided, comprising:

[0034] A driver framework is built in the driver interface, and a BSP board support package is created for each function in the driver framework; each functional module in the driver framework corresponds to a corresponding driver execution interface; the driver execution interface is used to implement the interface encapsulation of the driver interface and is called by the application layer program;

[0035] The driving interface is connected to a plurality of functional interfaces; each of the functional interfaces uses the same function; when the application layer program calls the driving interface, the caller inputs parameters in a fixed format as formal parameters to the driving interface, and the driving interface returns the calling result.

[0036] In this embodiment, the driver interface is compatible with the settings; the driver interface is coded in C language, does not use library files, and supports compilation under any development platform.

[0037] In this embodiment, the driver interface can be expanded and set. When the system needs to add new functions: a new driver execution interface type is redefined and the new driver execution interface type is added to the driver framework.

[0038] In this embodiment, the driver execution interface has functions that can be filled in by the designer;

[0039] When the product equipped with the driving interface changes, the driving interface is changed by filling in the hardware parameters in the driving execution program through the human-computer interaction interface.

[0040] In this embodiment, the human-computer interaction interface is designed based on Qt software.

[0041] In this embodiment, the execution file provided by the driver interface application layer is a .h or .o file.

[0042] In one embodiment, the present invention further proposes a method for calling a drive interface based on the above drive interface design method, wherein the drive interface is generated based on a host computer and is mounted on a product; the method for calling the drive interface comprises the following steps:

[0043] S101: Selecting the corresponding driver execution interface according to the functional design of the product;

[0044] S102: Fill in the hardware parameters of the driver execution interface based on the performance of the product design by the host computer;

[0045] S103: Selecting a corresponding driver interface according to the CPU type of the product and the operating system type used by the application layer;

[0046] S104: The QT software installed on the host computer traverses the entire BSP board support package according to the type of the driver execution interface selected in S101, returns the acquired information, and determines whether it is compatible with the application layer operating system;

[0047] S105: If fully compatible, the QT software generates a corresponding driver and compiles and synthesizes the xxx.o or xxx.h file to adapt to the product call.

[0048] 8. The calling method according to claim 7 is characterized in that the hardware parameters include: the number of channels of the switching quantity, the number of analog switches for collecting the switching quantity and the cascade mode, the number of channels of the analog quantity, the number of channels of the RS422 bus and the number of channels of ARINC429.

[0049] In the driver layer interface software of this embodiment, a driver framework is built, and a BSP board support package is created for each function in the driver framework. Each functional module in the driver framework has a corresponding driver execution interface to implement interface encapsulation for application layer program calls;

[0050] The driver interface is simple and easy to use. All interfaces use only one function. The definition, implementation and calling are relatively simple and clear. The caller only needs to enter fixed parameters as formal parameters for data transmission according to the agreement, and then wait for the return result. Since all interface calls use the same method, the consistency of the driver interface can be easily abstracted, which makes the entire framework relatively simpler and easier to understand.

[0051] The design of the driver interface (driver layer interface software) is compatible. The driver does not involve features related to the system platform and development tools during the design process. The driver interface has good compatibility with existing development platform SOC chips, imported or domestic, STM32 processors, VX operating systems, Tianmai operating systems, or platforms under Feiteng.

[0052] The design of the driver interface is scalable. When the system needs to add new functions, it only needs to redefine the new driver interface type and add it to the driver framework. There is no need to make any changes to the existing interface. At the same time, the function names and definitions provided by the driver interface program will not change. In some cases, some predictive development can even be made. Even if the existing product cannot achieve this, when the function really needs to be implemented, the upper-level module settings do not need to be modified, which greatly reduces the upgrade cost of the system;

[0053] The design of the driver interface realizes decoupling. In many cases, the design of the driver interface depends on the hardware design. However, the driver interface will open some ports for designers to fill in. Without changing the driver, you can directly fill in the values ​​to use the hardware design, which realizes the strong coupling between the driver interface program and the hardware. At the same time, the call to the application layer is no longer limited to the call and reuse of various functions. You only need to compile the required driver interface into a file that can be called by the application layer. Data transmission can be achieved by passing formal parameters, which greatly reduces the coupling between the driver and the application.

[0054] The calling of the driver interface is based on the human-machine interface design and development of Qt software. The calling method has good input and output. Through the interface designed by Qt software, the system platform adapted to the driver interface can be selected, and the driver interface and library are compiled through the adaptability of the system platform to form a driver interface file suitable for the system platform, which can be different library files such as .h or .o.

[0055] This embodiment involves the interconnection between hardware (product), driver (driver interface), host computer, and application program. The whole principle framework is as follows: Figure 1 As shown;.

[0056] First, the upper level fills in the hardware parameters of the driver interface according to the hardware design, such as the number of switch channels, the number of analog switches for collecting switch quantities and the cascade mode, the number of analog channels, the number of RS422 bus and ARINC429 channels, etc. to define the macro definition of the driver interface program;

[0057] Select the driver interface type according to the product's functional design to avoid redundant and unnecessary code programs in the program and ensure the standardization of the subsequent code review;

[0058] Select the calling type of the driver interface file according to the type of product CPU and operating system, generate the corresponding driver and compile and synthesize xxx.o or xxx.h files to adapt to the calling of the application.

[0059] like Figure 2 As shown, this embodiment involves the design of a driver interface, in which all hardware-related codes are encapsulated, and a defined driver interface is provided to the upper application layer to interact with the BSP, and access the real logic and hardware through the BSP. Figure 2 It can be clearly seen that each interface type corresponds to a BSP support package, and in this invention, the BSP support package can be increased and replaced according to actual needs, reducing the coupling with the hardware and application layers.

[0060] The usage process of this embodiment is as follows Figure 3 As shown, the product interface function is obtained according to the product design, and the product performance such as the design of hardware parameters is obtained. After the information is input, the software traverses the BSP board support package and returns the obtained information. It determines whether it is adapted to the application layer operating system, determines whether the interface type is fully adapted, synthesizes the file, and provides it to the application layer.

[0061] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A drive interface design method, characterized in that: include: Building a driver framework in the driver interface, and creating a BSP board support package for each function in the driver framework; Each functional module in the driver framework has a corresponding driver execution interface; The driver execution interface is used to implement the interface encapsulation of the driver interface and is called by the application layer program; The driving interface is connected to a plurality of functional interfaces; each of the functional interfaces uses the same function; when the application layer program calls the driving interface, the caller inputs parameters in a fixed format as formal parameters to the driving interface, and the driving interface returns the calling result.

2. The drive interface design method according to claim 1, characterized in that: The driver interface is compatible with settings; the driver interface is coded in C language, does not use library files, and supports compilation under any development platform.

3. The drive interface design method according to claim 2, characterized in that: The driver interface can be expanded and set. When the system needs to add new functions: a new driver execution interface type is redefined and the new driver execution interface type is added to the driver framework.

4. The drive interface design method according to claim 3, characterized in that: The driver execution interface has functions that can be filled in by the designer; When the product equipped with the driving interface changes, the driving interface is changed by filling in the hardware parameters in the driving execution program through the human-computer interaction interface.

5. The drive interface design method according to claim 4, characterized in that: The human-computer interaction interface is designed based on Qt software.

6. The drive interface design method according to claim 5, characterized in that: The execution file of the driver interface used by the application layer is a .h or .o file.

7. A method for calling a driver interface implemented by the driver interface design method according to any one of claims 1 to 6, characterized in that: The drive interface is generated based on a host computer and is mounted on a product; the calling method of the drive interface includes the following steps: S101: Selecting the corresponding driver execution interface according to the functional design of the product; S102: Fill in the hardware parameters of the driver execution interface based on the performance of the product design by the host computer; S103: Selecting a corresponding driver interface according to the CPU type of the product and the operating system type used by the application layer; S104: The QT software installed on the host computer traverses the entire BSP board support package according to the type of the driver execution interface selected in S101, returns the acquired information, and determines whether it is compatible with the application layer operating system; S105: If fully compatible, the QT software generates a corresponding driver and compiles and synthesizes the xxx.o or xxx.h file to adapt to the product call.

8. The method for calling a driver interface according to claim 7, characterized in that: The hardware parameters include: the number of channels of the switch quantity, the number of analog switches for acquiring the switch quantity and the cascade mode, the number of channels of the analog quantity, the number of channels of the RS422 bus and the number of channels of the ARINC429.

Citation Information

Patent Citations

  • Software framework

    CN103399753A

  • Design method for driver of CPCI (Compact Peripheral Component Interconnect) bus DAC (digital-to-analog conversion) function unit under VxWorks operating system

    CN103677855A

  • Method and device for calling driver interface by application program

    CN114416222A

  • Embedded software generation method based on truck body controller

    CN115934054A

  • Method for developing device driver architecture in intelligent terminal

    WO2016127495A1