[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114840189A - A framework system and design method for abstract management of sensor data - Google Patents

A framework system and design method for abstract management of sensor data Download PDF

Info

Publication number
CN114840189A
CN114840189A CN202210582686.4A CN202210582686A CN114840189A CN 114840189 A CN114840189 A CN 114840189A CN 202210582686 A CN202210582686 A CN 202210582686A CN 114840189 A CN114840189 A CN 114840189A
Authority
CN
China
Prior art keywords
sensor
library
abstract
abstraction
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210582686.4A
Other languages
Chinese (zh)
Inventor
甘立初
朱乾勇
沈甲甲
杨森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202210582686.4A priority Critical patent/CN114840189A/en
Publication of CN114840189A publication Critical patent/CN114840189A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a frame system for abstract management of sensor data and a design method thereof, wherein the system comprises an application program, a middle layer interface mapping library and a sensor abstract library module; the sensor abstraction library module comprises a plurality of sensor abstraction libraries, the plurality of sensor abstraction libraries are provided with uniform abstraction library interfaces, all sensors of the same type are packaged in the same sensor abstraction library, and sensors of different types are packaged in different sensor abstraction libraries; the middle layer interface mapping library is in communication connection with the sensor abstraction library module through a uniform abstraction library interface so as to shield sensor differences in different sensor abstraction libraries; the intermediate layer interface mapping library is provided with a mapping library interface and is in communication connection with the application program through the mapping library interface. The invention can realize the decoupling between the upper application program and the bottom sensor, so that the upper application program uses a uniform data interface and is not influenced by the replacement of the lower sensor.

Description

一种对传感器数据进行抽象管理的框架系统及设计方法A framework system and design method for abstract management of sensor data

技术领域technical field

本发明涉及智能汽车技术领域,具体涉及一种对传感器数据进行抽象管理的框架系统及设计方法。The invention relates to the technical field of intelligent vehicles, in particular to a framework system and a design method for abstractly managing sensor data.

背景技术Background technique

随着汽车进入智能化高速发展的时期,汽车已经成为一个部署有图像识别算法,导航定位算法,决策规划算法等多种算法的智能平台;随着平台上部署的传感器种类以及数量都越来越多,汽车控制器的架构也从以前的单MCU(微控制单元)主芯片走向MCU+MPU(微处理器)的域控制器架构。As automobiles enter a period of rapid development of intelligence, automobiles have become an intelligent platform that deploys image recognition algorithms, navigation and positioning algorithms, decision-making and planning algorithms and other algorithms; with the increasing number and types of sensors deployed on the platform In many cases, the architecture of the automotive controller has also changed from the previous single MCU (micro control unit) main chip to the MCU+MPU (microprocessor) domain controller architecture.

在传统的开发框架下,各种应用程序将直接从各传感器处读取数据,在数据读取过程中,依赖于操作系统以及具体设备,因此应用程序与传感器之间的耦合度较高,这样就使得如果在开发过程中,更换了传感器,则需相应地修改应用程序的应用代码,十分不便。Under the traditional development framework, various applications will directly read data from each sensor. During the data reading process, it depends on the operating system and specific devices, so the coupling between the application and the sensor is high, so that This makes it very inconvenient to modify the application code of the application program accordingly if the sensor is replaced during the development process.

发明内容SUMMARY OF THE INVENTION

针对现有技术存在的上述不足,本发明要解决的技术问题是:如何提供一种能够实现上层应用程序与底层传感器之间的解耦,使得上层应用程序使用统一的数据接口,无需受到下层传感器更换影响的对传感器数据进行抽象管理的框架系统及设计方法。In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a method that can realize the decoupling between the upper-layer application program and the bottom-layer sensor, so that the upper-layer application program uses a unified data interface without being affected by the lower-layer sensor A framework system and design method for abstract management of sensor data affecting replacement.

为了解决上述技术问题,本发明采用如下技术方案:In order to solve the above-mentioned technical problems, the present invention adopts the following technical solutions:

一种对传感器数据进行抽象管理的框架系统,包括应用程序、中间层接口映射库、以及传感器抽象库模块;A framework system for abstract management of sensor data, including an application program, a middle-tier interface mapping library, and a sensor abstract library module;

所述传感器抽象库模块包括多个传感器抽象库,多个所述传感器抽象库具有统一的抽象库接口,且同一个类型的所有传感器封装在同一个所述传感器抽象库中,并不同类型的传感器封装在不同的所述传感器抽象库中;The sensor abstract library module includes a plurality of sensor abstract libraries, the plurality of sensor abstract libraries have a unified abstract library interface, and all sensors of the same type are encapsulated in the same sensor abstract library, and different types of sensors are encapsulated in the same sensor abstract library. Encapsulated in different said sensor abstraction libraries;

所述中间层接口映射库通过统一的抽象库接口与所述传感器抽象库模块通信连接,以屏蔽不同所述传感器抽象库中的传感器差异;The intermediate layer interface mapping library is connected to the sensor abstract library module through a unified abstract library interface, so as to shield the sensor differences in different sensor abstract libraries;

所述中间层接口映射库设有映射库接口,所述中间层接口映射库通过映射库接口与所述应用程序通信连接。The middle-level interface mapping library is provided with a mapping library interface, and the middle-level interface mapping library communicates with the application program through the mapping library interface.

一种对传感器数据进行抽象管理的框架设计方法,采用上述的对传感器数据进行抽象管理的框架系统,该方法由所述中间层接口映射库读取从所述应用程序传递的配置文件,并根据配置文件初始化需要使用的所述传感器抽象库,然后根据初始化好的传感器抽象库与所述传感器抽象库模块中各个传感器抽象库的文件句柄映射关系动态绑定所使用的所述传感器抽象库,以通过所述中间层接口映射库向应用程序提供的接口调用所述传感器抽象库中的函数。A framework design method for abstract management of sensor data, using the above-mentioned framework system for abstract management of sensor data, the method reads the configuration file passed from the application program by the middle layer interface mapping library, and according to The configuration file initializes the sensor abstract library that needs to be used, and then dynamically binds the sensor abstract library used according to the initialized sensor abstract library and the file handle mapping relationship of each sensor abstract library in the sensor abstract library module, to The functions in the sensor abstract library are called through the interface provided by the middle layer interface mapping library to the application program.

优选的,配置文件中的信息包括:需要使用的传感器的类型及安装位置信息。Preferably, the information in the configuration file includes: type and installation location information of the sensor to be used.

优选的,所述中间层接口映射库对配置文件进行初始化的流程包括以下步骤:Preferably, the process of initializing the configuration file by the middle-layer interface mapping library includes the following steps:

步骤1)所述中间层接口映射库解析所述应用程序传递的配置文件,获取需要使用的每个传感器的类型;Step 1) The middle layer interface mapping library parses the configuration file passed by the application, and obtains the type of each sensor to be used;

步骤2)所有类型的传感器是否处理完,若是则执行步骤8),若否则执行步骤3)Step 2) Whether all types of sensors have been processed, if so, go to step 8), if not, go to step 3)

步骤3)所述中间层接口映射库根据步骤1)中获取的传感器的类型检查该传感器是否在所述中间层接口映射库的支持列表中,若是则执行步骤4),若否则进行错误处理并返回执行步骤2);Step 3) The middle layer interface mapping library checks whether the sensor is in the support list of the middle layer interface mapping library according to the type of the sensor obtained in step 1), if so, execute step 4), if not, perform error handling and Return to step 2);

步骤4)所述中间层接口映射库检查步骤3)中传感器对应的所述传感器抽象库是否已经加载,若是则执行步骤6),若否则执行步骤5);Step 4) The middle layer interface mapping library checks whether the sensor abstract library corresponding to the sensor in step 3) has been loaded, if so, execute step 6), otherwise execute step 5);

步骤5)根据传感器的类型找到对应的所述传感器抽象库的路径并加载所述传感器抽象库;Step 5) Find the corresponding path of the sensor abstract library according to the type of the sensor and load the sensor abstract library;

步骤6)使用所述传感器抽象库的文件句柄初始化所述传感器抽象库中的传感器;Step 6) Initialize the sensor in the sensor abstract library using the file handle of the sensor abstract library;

步骤7)返回执行步骤2);Step 7) Return to step 2);

步骤8)结束。Step 8) End.

优选的,所述中间层接口映射库向应用程序提供的接口调用所述传感器抽象库中函数的方法包括以下步骤:Preferably, the method for invoking the function in the sensor abstract library to the interface provided by the middle layer interface mapping library to the application program includes the following steps:

步骤S1)所述中间层接口映射库解析所述应用程序传递的配置文件,获取需要使用的传感器的位置信息,并根据传感器的位置信息取出对应的传感器抽象库中的文件句柄;Step S1) The middle layer interface mapping library parses the configuration file transmitted by the application program, obtains the position information of the sensor to be used, and retrieves the file handle in the corresponding sensor abstract library according to the position information of the sensor;

步骤S2)从传感器抽象库中的文件句柄中取出对应的接口函数;Step S2) take out the corresponding interface function from the file handle in the sensor abstract library;

步骤S3)执行步骤S2)中的函数;Step S3) execute the function in step S2);

步骤S4)返回执行结果。Step S4) returns the execution result.

优选的,通过传感器实例标记的方法来定义传感器的安装位置信息。Preferably, the installation position information of the sensor is defined by the method of sensor instance marking.

一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序被处理器运行时,执行上述的对传感器数据进行抽象管理的框架设计方法的步骤。A storage medium stores one or more programs, and when the one or more programs are run by a processor, executes the steps of the above-mentioned framework design method for abstract management of sensor data.

与现有技术相比,本发明具有以下优点:Compared with the prior art, the present invention has the following advantages:

1、本发明适用于汽车智能平台上传感器数据的抽象管理,将所有的传感器抽象出统一的抽象库接口,并使用统一的抽象库接口将不同厂商、不同类型的传感器抽象为独立的动态传感器抽象库,同时引入一个管理各个传感器抽象库的中间层接口映射库,用于解耦上层的应用程序与底层的传感器,上层应用程序直接调用中间层接口映射库的映射库接口,使上层应用程序使用统一的数据接口,不需关注底层传感器的具体操作。1. The present invention is suitable for the abstract management of sensor data on the automotive intelligent platform, abstracts all sensors into a unified abstract library interface, and uses the unified abstract library interface to abstract sensors of different manufacturers and different types into independent dynamic sensor abstractions At the same time, a middle-layer interface mapping library that manages each sensor abstract library is introduced to decouple the upper-layer application and the underlying sensor. The upper-layer application directly calls the mapping library interface of the middle-layer interface mapping library, so that the upper-layer application can use The unified data interface does not need to pay attention to the specific operation of the underlying sensor.

2、本发明如果需要接入新的传感器或者更换其他厂商的传感器,直接修改应用程序中的配置文件即可,不需要对应用代码进行修改,操作简单方便。2. In the present invention, if a new sensor needs to be connected or a sensor of another manufacturer needs to be replaced, the configuration file in the application program can be directly modified without modifying the application code, and the operation is simple and convenient.

3、本发明的配置文件包括的信息有:接入的传感器类型以及接入位置,传感器接入位置以及接入类型取决于整车平台设计,应用程序调用函数时只需使用中间层接口映射库中统一的接口,指定传感器接入位置进行初始化即可获取对应的传感器的数据。3. The information included in the configuration file of the present invention includes: the type of the sensor to be accessed and the access location, the access location and access type of the sensor depend on the design of the vehicle platform, and the application program only needs to use the middle layer interface mapping library when calling the function. In the unified interface, the data of the corresponding sensor can be obtained by specifying the sensor access location for initialization.

4、本发明将对每个厂商的每个类型的传感器的具体操作使用接口封装到对应的传感器抽象库中,同类型的传感器则使用相同的数据抽象接口,如所有的摄像头抽象库都实现相同的抽象函数接口。4. The present invention encapsulates the specific operations of each type of sensor of each manufacturer into the corresponding sensor abstract library, and the same type of sensor uses the same data abstract interface. For example, all camera abstract libraries implement the same abstract function interface.

5、本发明由中间层接口映射库读入配置文件,并根据配置文件进行初始化,实现中间映射库提供的函数接口与传感器抽象库的绑定,根据配置文件的不同,实现不同传感器的绑定,屏蔽对底层传感器的具体操作,让上层应用开发人员更多的关注于程序的功能逻辑,从而实现各个功能模块的解耦。5. The present invention reads the configuration file from the intermediate layer interface mapping library, and initializes it according to the configuration file, realizes the binding of the function interface provided by the intermediate mapping library and the sensor abstract library, and realizes the binding of different sensors according to the different configuration files. , to shield the specific operations of the underlying sensors, and let the upper-level application developers pay more attention to the functional logic of the program, so as to realize the decoupling of each functional module.

6、本发明最下部的传感器抽象库通过预先定义的数据操作接口对传感器的具体操作进行封装,同类型的不同厂商、不同类型的传感器均向中间层接口映射库提供统一定义的抽象库接口,通过此种方式,屏蔽了传感器的差异,实现了中间层接口映射库的独立开发。在初始化时,中间层接口映射库解析上层应用程序传递过来的配置文件,中间层接口映射库维护一个其支持的传感器抽象库的列表,上层应用程序调用中间层接口映射库的函数时需要传递传感器的位置信息作为参数,中间层接口映射库根据初始化好的传感器位置信息与传感器抽象库中的文件句柄映射关系实现对底层传感器抽象库中函数的调用。6. The sensor abstraction library at the bottom of the present invention encapsulates the specific operation of the sensor through a predefined data operation interface. Different manufacturers and different types of sensors of the same type provide a uniformly defined abstract library interface to the intermediate layer interface mapping library. In this way, the differences of the sensors are shielded, and the independent development of the interface mapping library of the middle layer is realized. During initialization, the middle-level interface mapping library parses the configuration file passed by the upper-layer application. The middle-level interface mapping library maintains a list of sensor abstract libraries it supports. When the upper-layer application calls the function of the middle-level interface mapping library, it needs to pass the sensor. The location information of the sensor is taken as a parameter, and the middle-level interface mapping library implements the call to the function in the underlying sensor abstract library according to the initialized sensor location information and the file handle mapping relationship in the sensor abstract library.

附图说明Description of drawings

图1为本发明对传感器数据进行抽象管理的框架系统的系统框图;1 is a system block diagram of a framework system for abstractly managing sensor data according to the present invention;

图2为本发明对传感器数据进行抽象管理的框架设计方法中中间层接口映射库对配置文件进行初始化的流程图;Fig. 2 is the flow chart that the middle layer interface mapping library initializes the configuration file in the frame design method for abstract management of sensor data according to the present invention;

图3为本发明对传感器数据进行抽象管理的框架设计方法中中间层接口映射库向应用程序提供的接口调用传感器抽象库中函数的流程图。FIG. 3 is a flow chart of calling the functions in the sensor abstract library from the interface provided by the interface mapping library of the middle layer to the application program in the framework design method for abstract management of sensor data according to the present invention.

具体实施方式Detailed ways

下面将结合附图及实施例对本发明作进一步说明。The present invention will be further described below with reference to the accompanying drawings and embodiments.

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本发明实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, embodiments of the present invention. The components of the embodiments of the invention generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Thus, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but is merely representative of selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。在本发明的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,或者是该发明产品使用时惯常摆放的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。此外,术语“水平”、“竖直”等术语并不表示要求部件绝对水平或悬垂,而是可以稍微倾斜。如“水平”仅仅是指其方向相对“竖直”而言更加水平,并不是表示该结构一定要完全水平,而是可以稍微倾斜。在本发明的描述中,还需要说明的是,除非另有明确的规定和限定,术语“设置”、“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures. In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. The indicated orientation or positional relationship is based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of the invention is usually placed in use, only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying The device or element referred to must have a particular orientation, be constructed and operate in a particular orientation, and therefore should not be construed as limiting the invention. Furthermore, the terms "first", "second", "third", etc. are only used to differentiate the description and should not be construed to indicate or imply relative importance. Furthermore, terms such as "horizontal", "vertical" and the like do not imply that components are required to be absolutely horizontal or overhang, but rather may be slightly inclined. For example, "horizontal" simply means that its direction is more horizontal than "vertical", it does not mean that the structure must be completely horizontal, but can be slightly inclined. In the description of the present invention, it should also be noted that, unless otherwise expressly specified and limited, the terms "arrangement", "installation", "connection" and "connection" should be understood in a broad sense, for example, it may be a fixed connection, It can also be a detachable connection or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or the internal communication between the two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood in specific situations.

如附图1所示,一种对传感器数据进行抽象管理的框架系统,包括应用程序、中间层接口映射库、以及传感器抽象库模块;As shown in FIG. 1, a framework system for abstract management of sensor data includes an application program, a middle-tier interface mapping library, and a sensor abstract library module;

传感器抽象库模块包括多个传感器抽象库,多个传感器抽象库具有统一的抽象库接口,且同一个类型的所有传感器封装在同一个传感器抽象库中,并不同类型的传感器封装在不同的传感器抽象库中;The sensor abstract library module includes multiple sensor abstract libraries, multiple sensor abstract libraries have a unified abstract library interface, and all sensors of the same type are encapsulated in the same sensor abstract library, and different types of sensors are encapsulated in different sensor abstractions library;

中间层接口映射库通过统一的抽象库接口与传感器抽象库模块通信连接,以屏蔽不同传感器抽象库中的传感器差异;The middle layer interface mapping library communicates with the sensor abstract library module through a unified abstract library interface to shield the sensor differences in different sensor abstract libraries;

中间层接口映射库设有映射库接口,中间层接口映射库通过映射库接口与应用程序通信连接。The middle layer interface mapping library is provided with a mapping library interface, and the middle layer interface mapping library communicates and connects with the application program through the mapping library interface.

一种对传感器数据进行抽象管理的框架设计方法,采用上述的对传感器数据进行抽象管理的框架系统,该方法由中间层接口映射库读取从应用程序传递的配置文件,并根据配置文件初始化需要使用的传感器抽象库,然后根据初始化好的传感器抽象库与传感器抽象库模块中各个传感器抽象库的文件句柄映射关系动态绑定所使用的传感器抽象库,以通过中间层接口映射库向应用程序提供的接口调用传感器抽象库中的函数。A framework design method for abstract management of sensor data, using the above-mentioned framework system for abstract management of sensor data, the method reads the configuration file passed from the application program by the middle layer interface mapping library, and initializes the needs according to the configuration file. The sensor abstraction library used, and then dynamically bind the sensor abstraction library used according to the initialized sensor abstraction library and the file handle mapping relationship of each sensor abstraction library in the sensor abstraction library module, so as to provide the application program through the middle layer interface mapping library The interface calls functions in the sensor abstraction library.

在本实施例中,配置文件中的信息包括:需要使用的传感器的类型及安装位置信息。In this embodiment, the information in the configuration file includes: type and installation location information of the sensor to be used.

如附图2所示,在本实施例中,中间层接口映射库对配置文件进行初始化的流程包括以下步骤:As shown in FIG. 2, in this embodiment, the process of initializing the configuration file by the interface mapping library of the middle layer includes the following steps:

步骤1)中间层接口映射库解析应用程序传递的配置文件,获取需要使用的每个传感器的类型;Step 1) The middle layer interface mapping library parses the configuration file passed by the application, and obtains the type of each sensor that needs to be used;

步骤2)所有类型的传感器是否处理完,若是则执行步骤8),若否则执行步骤3)Step 2) Whether all types of sensors have been processed, if so, go to step 8), if not, go to step 3)

步骤3)中间层接口映射库根据步骤1)中获取的传感器的类型检查该传感器是否在中间层接口映射库的支持列表中,若是则执行步骤4),若否则进行错误处理并返回执行步骤2);Step 3) The middle-layer interface mapping library checks whether the sensor is in the support list of the middle-layer interface mapping library according to the type of the sensor obtained in step 1). If so, go to step 4). If not, perform error handling and return to step 2. );

步骤4)中间层接口映射库检查步骤3)中传感器对应的传感器抽象库是否已经加载,若是则执行步骤6),若否则执行步骤5);Step 4) The intermediate layer interface mapping library checks whether the sensor abstract library corresponding to the sensor in step 3) has been loaded, if so, go to step 6), if not, go to step 5);

步骤5)根据传感器的类型找到对应的传感器抽象库的路径并加载传感器抽象库;Step 5) Find the path of the corresponding sensor abstract library according to the type of the sensor and load the sensor abstract library;

步骤6)使用传感器抽象库的文件句柄初始化传感器抽象库中的传感器;Step 6) Initialize the sensor in the sensor abstract library using the file handle of the sensor abstract library;

步骤7)返回执行步骤2);Step 7) Return to step 2);

步骤8)结束。Step 8) End.

如附图3所示,在本实施例中,中间层接口映射库向应用程序提供的接口调用传感器抽象库中函数的方法包括以下步骤:As shown in FIG. 3, in this embodiment, the method for calling the function in the sensor abstract library to the interface provided by the interface mapping library of the middle layer to the application program includes the following steps:

步骤S1)中间层接口映射库解析应用程序传递的配置文件,获取需要使用的传感器的位置信息,并根据传感器的位置信息取出对应的传感器抽象库中的文件句柄;Step S1) The middle layer interface mapping library parses the configuration file passed by the application, obtains the position information of the sensor to be used, and retrieves the file handle in the corresponding sensor abstract library according to the position information of the sensor;

步骤S2)从传感器抽象库中的文件句柄中取出对应的接口函数;Step S2) take out the corresponding interface function from the file handle in the sensor abstract library;

步骤S3)执行步骤S2)中的函数;Step S3) execute the function in step S2);

步骤S4)返回执行结果。Step S4) returns the execution result.

在本实施例中,通过传感器实例标记的方法来定义传感器的安装位置信息。In this embodiment, the installation position information of the sensor is defined by the method of tagging the sensor instance.

具体使用时,传感器的安装位置比如左前,左后,但是在代码中,不会写左前,左后这样的字眼,会采用传感器实例标记的方法来定义其安装位置,如传感器识别标记数字为1代表传感器的安装位置为左前,2代表传感器的安装位置为左后,由此根据传感器实例标记的数字,就能对应到它对应的安装位置信息。In specific use, the installation position of the sensor is such as left front and left rear, but in the code, the words such as left front and left rear will not be written, and the method of sensor instance mark will be used to define its installation position, such as the sensor identification mark number is 1 It means that the installation position of the sensor is the left front, and 2 means that the installation position of the sensor is the left rear. Therefore, according to the number marked by the sensor instance, it can correspond to its corresponding installation position information.

本方案还提供一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序被处理器运行时,执行上述的对传感器数据进行抽象管理的框架设计方法的步骤。This solution also provides a storage medium, where one or more programs are stored in the storage medium, and when the one or more programs are run by the processor, the steps of the above-mentioned framework design method for abstract management of sensor data are executed.

与现有技术相比,本发明适用于汽车智能平台上传感器数据的抽象管理,将所有的传感器抽象出统一的抽象库接口,并使用统一的抽象库接口将不同厂商、不同类型的传感器抽象为独立的动态传感器抽象库,同时引入一个管理各个传感器抽象库的中间层接口映射库,用于解耦上层的应用程序与底层的传感器,上层应用程序直接调用中间层接口映射库的映射库接口,使上层应用程序使用统一的数据接口,不需关注底层传感器的具体操作。本发明如果需要接入新的传感器或者更换其他厂商的传感器,直接修改应用程序中的配置文件即可,不需要对应用代码进行修改,操作简单方便。本发明的配置文件包括的信息有:接入的传感器类型以及接入位置,传感器接入位置以及接入类型取决于整车平台设计,应用程序调用函数时只需使用中间层接口映射库中统一的接口,指定传感器接入位置进行初始化即可获取对应的传感器的数据。本发明将对每个厂商的每个类型的传感器的具体操作使用接口封装到对应的传感器抽象库中,同类型的传感器则使用相同的数据抽象接口,如所有的摄像头抽象库都实现相同的抽象函数接口。本发明由中间层接口映射库读入配置文件,并根据配置文件进行初始化,实现中间映射库提供的函数接口与传感器抽象库的绑定,根据配置文件的不同,实现不同传感器的绑定,屏蔽对底层传感器的具体操作,让上层应用开发人员更多的关注于程序的功能逻辑,从而实现各个功能模块的解耦。本发明最下部的传感器抽象库通过预先定义的数据操作接口对传感器的具体操作进行封装,同类型的不同厂商、不同类型的传感器均向中间层接口映射库提供统一定义的抽象库接口,通过此种方式,屏蔽了传感器的差异,实现了中间层接口映射库的独立开发。在初始化时,中间层接口映射库解析上层应用程序传递过来的配置文件,中间层接口映射库维护一个其支持的传感器抽象库的列表,上层应用程序调用中间层接口映射库的函数时需要传递传感器的位置信息作为参数,中间层接口映射库根据初始化好的传感器位置信息与传感器抽象库中的文件句柄映射关系实现对底层传感器抽象库中函数的调用。Compared with the prior art, the invention is suitable for the abstract management of sensor data on the automobile intelligent platform, abstracts all sensors into a unified abstract library interface, and uses the unified abstract library interface to abstract sensors of different manufacturers and types as An independent dynamic sensor abstract library, and a middle-layer interface mapping library that manages each sensor abstract library is introduced to decouple the upper-layer application and the underlying sensor. The upper-layer application directly calls the mapping library interface of the middle-layer interface mapping library. Make the upper-layer application use a unified data interface without paying attention to the specific operation of the underlying sensor. In the present invention, if a new sensor needs to be connected or a sensor of another manufacturer needs to be replaced, the configuration file in the application program can be directly modified without modifying the application code, and the operation is simple and convenient. The information included in the configuration file of the present invention includes: the type of the sensor to be accessed and the access position, the access position and the access type of the sensor depend on the design of the vehicle platform, and the application program only needs to use the unified interface mapping library in the middle layer when calling the function. The interface of the specified sensor access position can be initialized to obtain the data of the corresponding sensor. The present invention encapsulates the specific operation interface of each type of sensor of each manufacturer into the corresponding sensor abstract library, and the same type of sensor uses the same data abstract interface, for example, all camera abstract libraries implement the same abstraction functional interface. The invention reads the configuration file from the intermediate layer interface mapping library, and initializes it according to the configuration file to realize the binding of the function interface provided by the intermediate mapping library and the sensor abstract library, and realizes the binding of different sensors according to the different configuration files. The specific operation of the underlying sensor allows the upper-level application developers to pay more attention to the functional logic of the program, thereby realizing the decoupling of each functional module. The sensor abstract library at the bottom of the present invention encapsulates the specific operation of the sensor through a predefined data operation interface. Different manufacturers and different types of sensors of the same type provide a uniformly defined abstract library interface to the intermediate layer interface mapping library. In this way, the difference of sensors is shielded, and the independent development of the interface mapping library of the middle layer is realized. During initialization, the middle-level interface mapping library parses the configuration file passed by the upper-layer application. The middle-level interface mapping library maintains a list of sensor abstract libraries it supports. When the upper-layer application calls the function of the middle-level interface mapping library, it needs to pass the sensor. The location information of the sensor is taken as a parameter, and the middle-level interface mapping library implements the call to the function in the underlying sensor abstract library according to the initialized sensor location information and the file handle mapping relationship in the sensor abstract library.

最后需要说明的是,以上实施例仅用以说明本发明的技术方案而非限制技术方案,本领域的普通技术人员应当理解,那些对本发明的技术方案进行修改或者等同替换,而不脱离本技术方案的宗旨和范围,均应涵盖在本发明的权利要求范围当中。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the technical solutions. Those skilled in the art should understand that those technical solutions of the present invention are modified or equivalently replaced without departing from the present technology. The purpose and scope of the solution should be included in the scope of the claims of the present invention.

Claims (7)

1. A frame system for abstract management of sensor data is characterized by comprising an application program, a middle layer interface mapping library and a sensor abstract library module;
the sensor abstraction library module comprises a plurality of sensor abstraction libraries, the plurality of sensor abstraction libraries are provided with uniform abstraction library interfaces, all sensors of the same type are packaged in the same sensor abstraction library, and sensors of different types are packaged in different sensor abstraction libraries;
the intermediate layer interface mapping library is in communication connection with the sensor abstraction library module through a uniform abstraction library interface so as to shield sensor differences in different sensor abstraction libraries;
the intermediate layer interface mapping library is provided with a mapping library interface and is in communication connection with the application program through the mapping library interface.
2. A framework design method for abstract management of sensor data is characterized in that the framework system for abstract management of sensor data as claimed in claim 1 is adopted, the method reads configuration files transferred from the application program by the middle layer interface mapping library, initializes the sensor abstraction library required to be used according to the configuration files, and then dynamically binds the used sensor abstraction library according to the initialized sensor abstraction library and the file handle mapping relation of each sensor abstraction library in the sensor abstraction library module, so as to call functions in the sensor abstraction library through the middle layer interface mapping library to an interface provided by the application program.
3. A method of framework design for abstract management of sensor data according to claim 2, wherein the information in the configuration file comprises: the type of sensor used and the installation location information are required.
4. A framework design method for abstract management of sensor data according to claim 3, wherein the procedure of initializing configuration files by the middle layer interface mapping library comprises the following steps:
step 1) the intermediate layer interface mapping library analyzes the configuration file transmitted by the application program to acquire the type of each sensor required to be used;
step 2) whether all types of sensors are processed or not, if so, executing step 8), otherwise, executing step 3)
Step 3) the intermediate layer interface mapping library checks whether the sensor is in a support list of the intermediate layer interface mapping library according to the type of the sensor acquired in the step 1), if so, the step 4) is executed, otherwise, error processing is carried out, and the step 2) is returned to be executed;
step 4) the intermediate layer interface mapping library checks whether the sensor abstract library corresponding to the sensor in the step 3) is loaded, if so, the step 6) is executed, and if not, the step 5) is executed;
step 5) finding a corresponding path of the sensor abstract library according to the type of the sensor and loading the sensor abstract library;
step 6) initializing the sensor in the sensor abstract library by using the file handle of the sensor abstract library;
step 7) returning to execute the step 2);
and 8) finishing.
5. The framework design method for abstract management of sensor data according to claim 4, wherein the method for calling the function in the sensor abstraction library from the interface mapping library of the middle layer to the interface provided by the application program comprises the following steps:
step S1), the middle layer interface mapping library analyzes the configuration file transmitted by the application program, acquires the position information of the sensor needed to be used, and takes out the corresponding file handle in the sensor abstract library according to the position information of the sensor;
step S2) extracting the corresponding interface function from the file handle in the sensor abstract library;
step S3) executing the function in step S2);
step S4) returns the execution result.
6. The method of claim 5, wherein the sensor installation location information is defined by a sensor instance mark method.
7. A storage medium storing one or more programs which, when executed by a processor, perform the steps of the framework design method for abstract management of sensor data according to any of claims 2 to 6.
CN202210582686.4A 2022-05-26 2022-05-26 A framework system and design method for abstract management of sensor data Pending CN114840189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210582686.4A CN114840189A (en) 2022-05-26 2022-05-26 A framework system and design method for abstract management of sensor data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210582686.4A CN114840189A (en) 2022-05-26 2022-05-26 A framework system and design method for abstract management of sensor data

Publications (1)

Publication Number Publication Date
CN114840189A true CN114840189A (en) 2022-08-02

Family

ID=82572869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210582686.4A Pending CN114840189A (en) 2022-05-26 2022-05-26 A framework system and design method for abstract management of sensor data

Country Status (1)

Country Link
CN (1) CN114840189A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118227696A (en) * 2024-05-21 2024-06-21 深圳合众致达科技有限公司 System and method for abstract management of functional data of water, electricity and gas meters

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030171846A1 (en) * 2001-11-28 2003-09-11 Murray Thomas J. Sensor and actuator abstraction and aggregation in a hardware abstraction layer for a robot
CN102781119A (en) * 2012-06-13 2012-11-14 哈尔滨工业大学深圳研究生院 Wireless ubiquitous network application terminal system and software component application process management method
CN110569206A (en) * 2019-07-16 2019-12-13 广州市中海达测绘仪器有限公司 Driving frame supporting multiple sensors, method, electronic equipment and storage medium
CN112799730A (en) * 2021-02-18 2021-05-14 上海元及数据科技有限公司 Method and system for abstracting and packaging equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030171846A1 (en) * 2001-11-28 2003-09-11 Murray Thomas J. Sensor and actuator abstraction and aggregation in a hardware abstraction layer for a robot
CN102781119A (en) * 2012-06-13 2012-11-14 哈尔滨工业大学深圳研究生院 Wireless ubiquitous network application terminal system and software component application process management method
CN110569206A (en) * 2019-07-16 2019-12-13 广州市中海达测绘仪器有限公司 Driving frame supporting multiple sensors, method, electronic equipment and storage medium
CN112799730A (en) * 2021-02-18 2021-05-14 上海元及数据科技有限公司 Method and system for abstracting and packaging equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118227696A (en) * 2024-05-21 2024-06-21 深圳合众致达科技有限公司 System and method for abstract management of functional data of water, electricity and gas meters
CN118227696B (en) * 2024-05-21 2024-08-02 深圳合众致达科技有限公司 System and method for abstract management of functional data of water, electricity and gas meters

Similar Documents

Publication Publication Date Title
US6636901B2 (en) Object-oriented resource lock and entry register
CN110389829B (en) Classification and distribution of extended objects in a multi-tenant environment
EP1049973B1 (en) Object-oriented global resource conflict resolver
US8549144B2 (en) Common configuration framework for applications to configure database objects and resources
US8074231B2 (en) Configuration of isolated extensions and device drivers
US5915106A (en) Method and system for operating a scanner which emulates a disk drive
CN114077462A (en) Method, device, device and medium for calling Android HIDL interface by software operating system
JP2010015595A (en) Apparatus and method for modeling behavior of expansion board in computer system
US20150277936A1 (en) Device Flags
CN112631684B (en) Executable program running method and device, electronic equipment and computer storage medium
US9235456B2 (en) Configuration technique for an electronic control unit with intercommunicating applications
CN114840189A (en) A framework system and design method for abstract management of sensor data
EP1347380A2 (en) SMbus notifications
US8141070B2 (en) Bridging class loader name spaces
US6161150A (en) System for informing a computer user of a conflict encountered during resource allocation to expansion cards of different types having resource information in different format
CN114564241B (en) Method and device for accessing hardware device, computer device and storage medium
CN116028392B (en) General drive management method, system and equipment oriented to hardware based on KPU architecture
CN113568603B (en) Component object creating and interface method calling method, terminal and storage device
CN117331616A (en) Complex driving method and system for block equipment
CN112099772A (en) Communication interface packaging method, device, equipment and storage medium
CN114428636A (en) Method for repairing unmatched module callback function parameters and related equipment
CN111314493A (en) Data processing method of heterogeneous cloud storage system and readable medium and system thereof
CN118796316B (en) A multi-sensor access and data management micro-architecture system for intelligent controllers
CN109901826B (en) Data processing method and device for Java program and electronic equipment
CN118963857A (en) Chip issuance detection system, method, and chip issuance system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination