Automatic subscription method for data bus of unmanned intelligent equipment

文档序号:1598847 发布日期:2020-01-07 浏览:18次 中文

阅读说明:本技术 一种面向无人智能装备数据总线的自动订阅方法 (Automatic subscription method for data bus of unmanned intelligent equipment ) 是由 赵伟 饶京宏 周广蕴 王旭 张文叶 于 2019-10-10 设计创作,主要内容包括:本发明涉及一种面向无人智能装备数据总线的自动订阅方法,属于智能装备软件技术领域。该方法包括以下步骤:采用软件框架管理无人智能装备数据总线,所述软件框架包括框架层和核心层;所述软件框架的框架层通过应用服务程序触发订阅数据总线服务,使得框架层关联上所述无人智能装备数据总线;订阅触发后,软件框架的框架层通过定时器或中断方式发送数据读取命令启动框架层中的订阅数据总线服务相应的应用算法程序,以驱动核心层连接的数据总线接口进行数据总线的订阅。本发明解决了目前开发者需要对数据总线使用细节充分了解导致开发周期过长,不利于软件层次划分、软件复用和多应用软件集成问题。(The invention relates to an automatic subscription method for an unmanned intelligent equipment data bus, and belongs to the technical field of intelligent equipment software. The method comprises the following steps: managing an unmanned intelligent equipment data bus by adopting a software framework, wherein the software framework comprises a framework layer and a core layer; the framework layer of the software framework triggers subscription data bus service through an application service program, so that the framework layer is associated with the unmanned intelligent equipment data bus; after the subscription is triggered, the framework layer of the software framework sends a data reading command through a timer or an interrupt mode to start an application algorithm program corresponding to the service of the subscription data bus in the framework layer so as to drive a data bus interface connected with the core layer to subscribe the data bus. The invention solves the problems that the development period is too long, software hierarchy division, software multiplexing and multi-application software integration are not facilitated, which are caused by the fact that developers need to fully know the use details of the data bus at present.)

1. An automatic subscription method facing to an unmanned intelligent equipment data bus is characterized by comprising the following steps:

managing an unmanned intelligent equipment data bus by adopting a software framework, wherein the software framework comprises a framework layer and a core layer;

the framework layer of the software framework triggers subscription data bus service through an application service program, so that the framework layer is associated with the unmanned intelligent equipment data bus;

after the subscription is triggered, the framework layer of the software framework sends a data reading command through a timer or an interrupt mode to start an application algorithm program corresponding to the service of the subscription data bus in the framework layer so as to drive a data bus interface connected with the core layer to subscribe the data bus.

2. The method according to claim 1, wherein the framework layer of the software framework comprises an application service management module, an abstract data management module and an external interface module from a high layer to a low layer in sequence, and linkage is realized through a communication mechanism of a scheduler and a timer of the framework layer;

the application service management module comprises an application service program and an application algorithm program and is used for calling the application service program and the application algorithm program which are suitable for each data bus in real time;

the abstract data management module is used for abstracting the data bus to realize uniform management and communicating with the core layer data bus interface in a VFS virtual file system mode;

the external interface module is used for an external application software program interface of the software framework.

3. The method of claim 2, wherein the software framework is based on middleware management of the os and converts communication among the application service management module, the abstract data management module, and the external interface module into inter-thread communication with a message queue, a semaphore, and a shared memory mechanism in the embedded os through a scheduler and a timer.

4. The method of claim 3, wherein the timer is an application service management module located in the software framework as an incentive mechanism for sending periodic operations, delayed operations, and timeout determinations for data reading.

5. The method of claim 3, wherein the scheduler, as an incentive mechanism, is located in an application service management module of the software framework, and is configured to call the abstract sensor interface through the abstract data management module to read the raw sensor data after receiving the data reading command.

6. The method of claim 1 or 5, wherein sending a data read command by the framework layer of the software framework to start an application algorithm program in the framework layer comprises:

the framework layer of the software framework sends a data reading command to the scheduler so as to read information data from the sensor on the data bus;

judging whether to calibrate the information data of the sensor according to the execution of a calibration algorithm in the frame layer, and directly sending a reading command if not; if the calibration is executed, a calibration algorithm is called and then a reading command is sent;

and after receiving the sending read command, the scheduler sends the information data of the sensor to the application algorithm program through the scheduler.

7. The method of claim 6, wherein data calibration algorithms of different processors are obtained by fitting information data of the sensors, and the calibration algorithms are compiled and integrated into an abstract data management module of a software framework, and when the abstract data management module is executed, the corresponding calibration algorithms are called according to sensor types.

8. The method of claim 1, wherein the timer mode periodically reads data through a timer until data is processed after being updated;

the data bus interrupt mode acquires data through an interrupt mechanism of the embedded operating system.

9. The method of any of claims 1-8, wherein the data types of the software framework include an application algorithm data type and a data bus data type;

the application algorithm data type is used for an abstract data management module of a framework layer;

and the data bus data type is used for a data bus supported by the core layer.

10. The method according to any one of claims 1 to 9, wherein the software framework has three data tables including an application service table, an abstract data table, and a data bus table, and a service abstraction, a data abstraction, and a physical abstraction of the data bus, respectively;

the application service table is a data structure of an application service management module; the abstract data table is a data structure of an abstract data management module; the data bus table is a data structure of a data bus supported by the core layer.

Technical Field

The invention relates to the technical field of intelligent equipment software, in particular to an automatic subscription method for an unmanned intelligent equipment data bus.

Background

The intelligent equipment refers to industrial equipment with sensing, analyzing, reasoning, decision making and control functions, and is integration and deep fusion of advanced manufacturing technology, information technology and intelligent technology.

The unmanned intelligent equipment is an equipment technology which is endowed with a certain degree of intelligent decision and autonomous action capability along with the massive application of autonomous control and artificial intelligence technology, so that specific tasks can be autonomously and cooperatively completed, and mainly comprises an underwater robot, a water surface robot, a ground robot, an unmanned aerial vehicle and the like.

The unmanned intelligent equipment control main board is usually integrated with various low-speed and high-speed data buses, each bus is provided with an independent device driver and an application algorithm, a developer is required to develop the unmanned intelligent equipment control main board directly based on a driver API (application program interface), the designed API is too much, the developer needs to fully know the use details of the data buses, the development period is too long, and the unmanned intelligent equipment control main board is not beneficial to software level division, software multiplexing and multi-application software integration.

Disclosure of Invention

In view of the foregoing analysis, the present invention aims to provide an automatic subscription method for an unmanned intelligent device data bus, so as to solve the problems that at present, developers need to fully understand details of data bus usage, which results in an excessively long development period, and is not beneficial to software hierarchy partitioning, software multiplexing, and multi-application software integration.

The purpose of the invention is mainly realized by the following technical scheme:

the invention provides an automatic subscription method for an unmanned intelligent equipment data bus, which comprises the following steps: managing an unmanned intelligent equipment data bus by adopting a software framework, wherein the software framework comprises a framework layer and a core layer; the framework layer of the software framework triggers subscription data bus service through an application service program, so that the framework layer is associated with the unmanned intelligent equipment data bus; after the subscription is triggered, the framework layer of the software framework sends a data reading command through a timer or an interrupt mode to start an application algorithm program corresponding to the service of the subscription data bus in the framework layer so as to drive a data bus interface connected with the core layer to subscribe the data bus.

Furthermore, a framework layer of the software framework sequentially comprises an application service management module, an abstract data management module and an external interface module from a high layer to a low layer, and linkage is realized through a scheduler of the framework layer and a communication mechanism of a timer; the application service management module comprises an application service program and an application algorithm program and is used for calling the application service program and the application algorithm program which are suitable for each data bus in real time; the abstract data management module is used for abstracting the data bus to realize uniform management and communicating with the core layer data bus interface in a VFS virtual file system mode; the external interface module is used for an external application software program interface of the software framework.

Furthermore, the software framework is based on a middleware management mode of an operating system, and converts a communication mode among the application service management module, the abstract data management module and the external interface module into a thread-to-thread communication with a message queue, a semaphore and a shared memory mechanism in the embedded operating system through a scheduler and a timer.

Further, the timer is used as an excitation mechanism and located in an application service management module of the software framework, and is used for sending periodic operation, delay operation and timeout judgment of data reading.

Further, the scheduler is used as an excitation mechanism and located in an application service management module of the software framework, and is used for calling the abstract sensor interface through the abstract data management module after receiving the data reading command so as to read the raw data of the sensor.

Further, the sending of the data reading command by the framework layer of the software framework to start the application algorithm program in the framework layer includes: the framework layer of the software framework sends a data reading command to the scheduler so as to read information data from the sensor on the data bus; judging whether to calibrate the information data of the sensor according to the execution of a calibration algorithm in the frame layer, and directly sending a reading command if not; if the calibration is executed, a calibration algorithm is called and then a reading command is sent; and after receiving the sending read command, the scheduler sends the information data of the sensor to the application algorithm program through the scheduler.

Furthermore, data calibration algorithms of different processors are obtained through fitting of information data of the sensors, the calibration algorithms are compiled and integrated into an abstract data management module of the software framework, and when the calibration algorithms are executed, corresponding calibration algorithms are called according to the types of the sensors.

Further, the timer mode periodically reads data through a timer until the data is processed after being updated; the data bus interrupt mode acquires data through an interrupt mechanism of the embedded operating system.

Further, the data types of the software framework comprise an application algorithm data type and a data bus data type; the application algorithm data type is used for an abstract data management module of a framework layer; and the data bus data type is used for a data bus supported by the core layer.

Furthermore, the software framework is provided with three data tables including an application service table, an abstract data table and a data bus table, wherein the three data tables respectively perform service abstraction, data abstraction and physical abstraction on the data bus;

the application service table is a data structure of an application service management module;

the abstract data table is a data structure of an abstract data management module;

the data bus table is a data structure of a data bus supported by the core layer.

The technical scheme has the beneficial effects that: the invention discloses an automatic subscription method for an unmanned intelligent equipment data bus, which adopts a subscription type data bus management software framework, follows a modular design principle of hierarchical decoupling, can realize the componentized transplantation adaptation of the software framework according to different services and requirements, simplifies an API (application programming interface), shields the bottom-layer details of the data bus, improves the development efficiency, enables a publisher and a subscriber of a message not to know whether the other party exists or not, and is beneficial to the integration of various application software.

Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

Drawings

The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, wherein like reference numerals are used to designate like parts throughout.

Fig. 1 is a flowchart of an automated subscription method for an unmanned intelligent equipment data bus according to an embodiment of the present invention;

FIG. 2 is a software framework diagram of a subscription-based data bus management system according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating a software framework data reading process according to an embodiment of the present invention.

Detailed Description

The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate preferred embodiments of the invention and together with the description, serve to explain the principles of the invention and not to limit the scope of the invention.

The technical idea of the invention is as follows: the subscription management is a message paradigm provided by the invention, a sender (called a publisher) of a message does not directly send the message to a specific receiver (called a subscriber), but divides the published message into different categories without knowing whether the subscriber exists, and similarly, the subscriber only expresses interest (subscription) in one or more categories of messages, only receives the subscribed message without knowing whether the publisher exists.

A specific embodiment of the present invention, as shown in fig. 1, discloses an automatic subscription method for an unmanned intelligent equipment data bus, comprising the following steps:

s1, managing the unmanned intelligent equipment data bus by adopting a software framework, wherein the software framework comprises a framework layer and a core layer;

specifically, the software framework performs data reading and data comparison processing on the unmanned intelligent equipment data bus subscription.

S2, triggering and subscribing data bus service by a framework layer of the software framework through an application service program, so that the framework layer is associated with the unmanned intelligent equipment data bus;

and S3, after subscription triggering, the framework layer of the software framework sends a data reading command through a timer or an interrupt mode to start an application algorithm program corresponding to the subscription data bus service in the framework layer so as to drive the data bus interface connected with the core layer to subscribe the data bus.

Compared with the prior art, the embodiment of the invention follows the modular design principle of hierarchical decoupling, can realize the componentization transplantation adaptation of the software framework according to different services and requirements by managing the software framework through the subscription type data bus, provides the functions of bus interface driving, port configuration, application algorithm integration and the like, has the software framework convenient for application algorithm integration, and is favorable for software multiplexing and multi-application software integration.

Specifically, the technical scheme of the invention adopts a subscription type data bus management software framework, which mainly comprises a core layer and a framework layer, and is directly called by a function interface, wherein the core layer is a data bus abstraction layer and is mainly responsible for bus interface driving and hardware port configuration, the core layer provides a driving interface of a data bus, such as registration, creation of a driving object and the like, and provides a hardware configuration interface, such as I2C, and related configuration of SPI, 1553B, SRIO, 422 and 485; the framework layer is mainly responsible for application service management, abstract data management and external module interfaces.

In a specific embodiment of the present invention, as shown in fig. 2, a framework layer of the software framework sequentially includes an application service management module, an abstract data management module, and an external interface module from a high layer to a low layer, and the linkage is realized through a scheduler of the framework layer and a communication mechanism of a timer;

the application service management module comprises an application service program and an application algorithm program and is used for calling the application service program and the application algorithm program which are suitable for each data bus in real time;

the abstract data management module is used for abstracting the data bus to realize uniform management and communicating with the core layer data bus interface in a VFS virtual file system mode;

the external interface module is used for an external application software program interface of the software framework. .

Specifically, the framework layer mainly comprises an application service management module, an abstract data management module and an external interface module, and the application service management module, the abstract data management module and the external interface module are linked through a communication mechanism of a task scheduler and a timer. The application algorithm program in the application service management module is an algorithm program aiming at various application service functions. The application service management module is used for managing application algorithm services based on a data bus, such as registration, a data protocol and the like, supporting an event scheduling mechanism of the whole software framework and managing service requirements of external components, such as subscription and the like; the abstract data management module performs abstract unified management on the data bus, is isolated from the actual data bus, realizes one-to-one correspondence between the subscription service function and the bus equipment, namely is separated from the actual physical equipment, performs 1:1 mapping, and communicates with the core layer data bus interface in a VFS mode; the external interface module is an external application software programming interface of the software framework and provides 5 programming interfaces for message publishing, subscription service, return service, parameter configuration, information query and the like. That is to say, the abstract concrete implementation process includes the abstraction of the subscription service, the abstract data management module uses various data buses as a device through the subscription function interface, and the configuration of the data buses is realized through the subscription service function, so as to realize reading and writing. The method can realize read-write interaction with the data bus in a mode of VFS virtual file system, and realize access to the data bus in a mode of file read-write, wherein the interaction process comprises contents such as data processing algorithm and the like.

It should be noted that the vfs (virtual File system) is used for reading and writing different File systems on different physical media by using standard Unix system calls, so as to provide a uniform operation interface and application programming interface for each File system. The VFS is a bond layer that allows system calls such as open (), read (), write (), and the like to operate without regard to the underlying storage medium and file system type.

In a specific embodiment of the present invention, the software framework is based on a middleware management mode of an operating system, and converts a communication mode among the application service management module, the abstract data management module, and the external interface module into an inter-thread communication through a message queue, a semaphore, and a shared memory mechanism in an embedded operating system through a scheduler and a timer.

Specifically, the inter-module communication of the software framework is based on an asynchronous message mechanism of a real-time operating system, when the data of the software framework is ready, an event is broadcasted to notify relevant external modules, and at the framework layer of the software framework, a task scheduler and a timer are designed to realize the communication mechanism of the whole software framework, wherein the communication mechanism is inter-thread communication. The specific implementation of the conversion into inter-thread communication is through the middleware management mode of the operating system.

In a specific embodiment of the present invention, the timer is an application service management module located in a software framework as an excitation mechanism, and is configured to send a periodic operation, a delay operation, and a timeout determination for data reading.

It should be noted that the subscription method is implemented based on an operating system, and the current operating system already implements the timer and the interrupt function.

In a specific embodiment of the present invention, the scheduler, as an excitation mechanism, is located in an application service management module of the software framework, and is configured to call the abstract sensor interface through the abstract data management module after receiving the data reading command, so as to read the raw data of the sensor.

In an embodiment of the present invention, the sending a data reading command by the framework layer of the software framework to start an application algorithm program in the framework layer includes: the framework layer of the software framework sends a data reading command to the scheduler so as to read information data from the sensor on the data bus; judging whether to calibrate the information data of the sensor according to the execution of a calibration algorithm in the frame layer, and directly sending a reading command if not; if the calibration is executed, a calibration algorithm is called and then a reading command is sent; and after receiving the sending read command, the scheduler sends the information data of the sensor to the application algorithm program through the scheduler.

Specifically, as shown in fig. 3, the specific flow of reading the software framework data is as follows:

1) subscription triggering: and triggering the subscription data bus service by the framework layer of the software framework through an application service program, so that the framework layer is associated with the unmanned intelligent equipment data bus.

2) Subscribing to query: after subscription triggering, the application service program sends a data reading command; and after receiving the data reading command, the scheduler calls an abstract sensor interface through the data abstract module so as to read the original data of the sensor.

3) And (3) data calibration: determining whether to calibrate the original data of the sensor according to whether to execute a calibration algorithm, and directly sending a reading command if the data of the sensor is not calibrated; and if the sensor data is calibrated, calling a calibration algorithm and then sending a reading command.

4) Acquiring data information: the sensor data information is sent to the application algorithm program through the scheduler.

According to a specific embodiment of the invention, data calibration algorithms of different processors are obtained by fitting information data of the sensors, the calibration algorithms are compiled and integrated into an abstract data management module of a software framework, and the corresponding calibration algorithms are called according to the types of the sensors when the calibration algorithms are executed.

In a specific embodiment of the present invention, the timer mode periodically reads data through a timer until the data is processed after being updated; the data bus interrupt mode acquires data through an interrupt mechanism of the embedded operating system.

Specifically, the data reading mode of the software framework mainly includes a polling mode (based on a timer initiation mode) and an interrupt mode (based on a data bus interrupt initiation mode), and the data reading mode is basically used for low power consumption management, system wake-up and other services, and can meet the service requirements in a general service.

In a specific embodiment of the present invention, the data types of the software framework include an application algorithm data type and a data bus data type; the application algorithm data type is used for an abstract data management module of a framework layer; and the data bus data type is used for a data bus supported by the core layer.

Specifically, the software framework mainly includes two types of data, one type is an application algorithm data type of the software framework, for example, 1553B, CAN, SRIO, IIC, SPI communication protocol, attitude control algorithm based on sensor data, and the like, and the developer and the external module only communicate and interact with the type of data; the other is a data bus data category, for example, 1553B, CAN, SRIO, IIC, SPI exist in the core layer and communicate and interact with the framework layer, and are not externally provided for the moment. Generally, each application algorithm service data is subscribed to data of one data bus, and possibly one application algorithm service data is based on data of a plurality of data buses.

According to a specific embodiment of the invention, the software framework has three data tables including an application service table, an abstract data table and a data bus table, wherein the application service table, the abstract data table and the data bus table are respectively used for service abstraction, data abstraction and physical abstraction of a data bus;

the application service table is a data structure of an application service management module;

the abstract data table is a data structure of an abstract data management module;

the data bus table is a data structure of a data bus supported by the core layer.

Specifically, the application service table data structure is:

Figure BDA0002228422400000091

the abstract data table data structure is as follows:

Figure BDA0002228422400000101

the data bus table data structure is:

Figure BDA0002228422400000102

in summary, the present invention discloses an automatic subscription method for an unmanned intelligent equipment data bus, which includes the following steps: managing an unmanned intelligent equipment data bus by adopting a software framework, wherein the software framework comprises a framework layer and a core layer; the framework layer of the software framework triggers subscription data bus service through an application service program, so that the framework layer is associated with the unmanned intelligent equipment data bus; after the subscription is triggered, the framework layer of the software framework sends a data reading command through a timer or an interrupt mode to start an application algorithm program corresponding to the service of the subscription data bus in the framework layer so as to drive a data bus interface connected with the core layer to subscribe the data bus. The technical scheme of the invention adopts a subscription type data bus management software framework, follows a modular design principle of hierarchical decoupling, can realize the componentized transplantation adaptation of the software framework according to different services and requirements, simplifies an API (application programming interface), shields the bottom-layer details of the data bus, improves the development efficiency, ensures that a publisher and a subscriber of a message do not need to know whether the other party exists, and is beneficial to the integration of various application software. The invention solves the problems that the development period is too long, software hierarchy division, software multiplexing and multi-application software integration are not facilitated, which are caused by the fact that developers need to fully know the use details of the data bus at present.

Those skilled in the art will appreciate that all or part of the processes for implementing the methods in the above embodiments may be implemented by a computer program, which is stored in a computer-readable storage medium, to instruct associated hardware. The computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory.

The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:存储器系统以及用于访问存储器系统的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!