CN111444609B - Data processing method and simulation system - Google Patents

Data processing method and simulation system Download PDF

Info

Publication number
CN111444609B
CN111444609B CN202010215015.5A CN202010215015A CN111444609B CN 111444609 B CN111444609 B CN 111444609B CN 202010215015 A CN202010215015 A CN 202010215015A CN 111444609 B CN111444609 B CN 111444609B
Authority
CN
China
Prior art keywords
channel
board card
data
communication
communication board
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.)
Active
Application number
CN202010215015.5A
Other languages
Chinese (zh)
Other versions
CN111444609A (en
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.)
Beijing Runke General Technology Co Ltd
Original Assignee
Beijing Runke General Technology 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 Beijing Runke General Technology Co Ltd filed Critical Beijing Runke General Technology Co Ltd
Priority to CN202010215015.5A priority Critical patent/CN111444609B/en
Publication of CN111444609A publication Critical patent/CN111444609A/en
Application granted granted Critical
Publication of CN111444609B publication Critical patent/CN111444609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a data processing method and a simulation system, which are used for solving the data processing problem of a multi-channel communication board card. In the embodiment of the invention, the simulation system comprises an upper computer and a lower computer; wherein, the upper computer is provided with a simulation machine resource management platform; the lower computer is provided with a multi-channel communication board card and a real-time processor, and is provided with a driving program for running the multi-channel communication board card; different channels of the multi-channel communication board card correspond to independent memory spaces; the real-time processor of the lower computer utilizes a multi-channel independent interrupt processing mechanism in the process of running the drive program of the multi-channel communication board card, establishes corresponding queue caches for all channels in the interrupt response process, adopts a multi-thread processing mechanism for the multi-channel queue caches, and returns the read communication data to the resource management platform of the simulator of the upper computer to perform data interaction with the upper computer after threads corresponding to the channels receiving the communication data messages read corresponding data memory spaces.

Description

Data processing method and simulation system
Technical Field
The present invention relates to the field of simulation, and in particular, to a data processing method and a simulation system.
Background
Before the vehicle-mounted controller or other vehicle-mounted equipment is put into application, simulation test is required. Currently, a relatively large number of Simulation systems are used as HIL (Hardware in loop Simulation) systems.
The HIL simulation system comprises an upper computer and an HIL lower computer on hardware. The upper computer can be provided with a simulator resource management platform (such as NI Veristand) and test software, and the lower computer can be provided with a third party board card conforming to PXI (PCI extensions for Instrumentation) protocol (PCI expansion for instrument systems) besides the board card of the NI.
The existing third party board card is a single-function board card, and input and output data of the single-function board card can be directly read/written into a corresponding register of the board card through a simple package customdevice driver, and data interaction is carried out with an upper computer by utilizing an RT-FIFO (remote terminal first in first out). And monitoring by a control in a monitoring interface of the resource management platform of the simulator in the upper computer.
After the multi-channel communication board card is developed, how to perform data processing and interaction with the host computer is currently being researched.
Disclosure of Invention
In view of this, the embodiment of the invention provides a data processing method and a simulation system to solve the data processing problem of the multi-channel communication board card.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
a data processing method is applied to a simulation system; the simulation system comprises an upper computer and a lower computer; wherein, the upper computer is provided with a simulation organic resource management platform; the lower computer is provided with a multi-channel communication board card and a real-time processor, and is provided with a driving program for operating the multi-channel communication board card; different channels of the multi-channel communication board card correspond to independent memory spaces;
the method comprises the following steps:
the real-time processor receives an interrupt request sent by the multi-channel communication board card; the interrupt request is generated after the multi-channel communication board card has received communication data in at least one channel; the communication data received by each channel is target communication data, and the target communication data is stored in a data memory space corresponding to the message type of the target communication data;
the real-time processor runs the driving program to execute interrupt processing according to a preset multichannel independent interrupt processing mechanism;
wherein the interrupt processing includes:
reading an interrupt state register of the multi-channel communication board card to obtain channel interrupt state information; the channel interruption state information is used for indicating a channel with received communication data in the multi-channel communication board card; each channel with received communication data is a target channel;
Respectively establishing queue caches for all channels of the multi-channel communication board card;
the interrupt information of the target channel is put into a corresponding queue cache; the interrupt information includes: the channel identification of the target channel, the message type and the message number of the communication data received in the target channel;
respectively establishing message processing threads for all channels of the multi-channel communication board card;
reading communication data from the corresponding data memory space by the message processing thread of the target channel according to the interrupt information in the corresponding queue cache;
and returning the read communication data to the resource management platform of the simulator.
Optionally, a man-machine interaction development environment platform is also deployed in the upper computer; the method further comprises the steps of: the man-machine interaction development environment platform periodically acquires communication data returned by the multi-channel communication board card by calling a read interface function of the simulator resource management platform; the man-machine interaction development environment platform displays the acquired communication data through a display interface of the man-machine interaction development environment platform; the display interface comprises a plurality of display controls; the display interface has the functions of aligning, moving and resizing the plurality of display controls.
Optionally, the communication data obtained by the resource management platform of the simulator includes: double-precision floating point type array; the displaying the acquired communication data comprises the following steps: converting the array of double-precision floating points into an unsigned integer array; the unsigned integer array comprises variable data corresponding to a plurality of physical quantities; analyzing the unsigned integer array according to the byte length and the data type specified by each physical quantity in a preset communication protocol to obtain variable data corresponding to each physical quantity; and displaying the variable data obtained through analysis by using a display control.
Optionally, before receiving the interrupt request, the method further includes: generating an installation file for identifying the multi-channel communication board card by a lower machine side according to the hardware resource information of the multi-channel communication board card; creating a driver of the multi-channel communication board card; the driver comprises an initialization process for the multi-channel communication board card and the multi-channel independent interrupt processing mechanism.
Optionally, before receiving the interrupt request, the method further includes: transmitting the board card installation file to the lower computer; after the multichannel communication board card is installed in the lower computer, the real-time processor identifies the multichannel communication board card according to the board card installation file; and deploying the driver in the lower computer.
Optionally, a communication command interface is reserved on the simulator resource management platform; the method further comprises the steps of: the man-machine interaction development environment platform receives excitation data input by a user; the man-machine interaction development environment platform sends a communication command carrying the excitation data to the simulator resource management platform through the communication command interface; and the communication command is transmitted to the corresponding remote terminal through the simulator resource management platform, the real-time processor and the multi-channel communication board card.
A simulation system comprises an upper computer and a lower computer; wherein, the upper computer is provided with a simulation organic resource management platform; the lower computer is provided with a multi-channel communication board card and a real-time processor, and is provided with a driving program for operating the multi-channel communication board card; different channels of the multi-channel communication board card correspond to independent memory spaces;
the real-time processor is used for:
receiving an interrupt request sent by the multi-channel communication board card; the interrupt request is generated after the multi-channel communication board card has received communication data in at least one channel; the target communication data is stored in a data memory space corresponding to the message type of the target communication data;
Running the driver to execute interrupt processing according to a preset multichannel independent interrupt processing mechanism;
the emulator resource management platform is at least used for: adding and configuring the driver;
wherein the interrupt processing includes:
reading an interrupt state register of the multi-channel communication board card to obtain channel interrupt state information; the channel interruption state information is used for indicating a channel with received communication data in the multi-channel communication board card; each channel with received communication data is a target channel;
respectively establishing queue caches for all channels of the multi-channel communication board card;
the interrupt information of the target channel is put into a corresponding queue cache; the interrupt information includes: the channel identification of the target channel, the message type and the message number of the communication data received in the target channel;
respectively establishing message processing threads for all channels of the multi-channel communication board card;
reading communication data from the corresponding data memory space by the message processing thread of the target channel according to the interrupt information in the corresponding queue cache;
and returning the read communication data to the resource management platform of the simulator.
Optionally, a man-machine interaction development environment platform is also deployed in the upper computer; the man-machine interaction development environment platform is used for: periodically calling a read interface function of the resource management platform of the simulator to acquire communication data returned by the multi-channel communication board card; displaying the acquired communication data through a display interface of the communication device; the display interface comprises a plurality of display controls; the display interface has the functions of aligning, moving and resizing the plurality of display controls.
Optionally, the communication data obtained by the resource management platform of the simulator includes: double-precision floating point type array; in the aspect of obtaining communication return data, the man-machine interaction development environment platform is specifically used for: converting the array of double-precision floating points into an unsigned integer array; the unsigned integer array comprises variable data corresponding to a plurality of physical quantities; analyzing according to the byte length and the data type specified by each physical quantity in a preset communication protocol to obtain variable data corresponding to each physical quantity; and displaying the variable data obtained through analysis by using a display control.
Optionally, the emulator resource management platform is further configured to: generating an installation file for identifying the multi-channel communication board card by a lower machine side according to the hardware resource information of the multi-channel communication board card; creating a driver of the multi-channel communication board card; the driver comprises an initialization process for the multi-channel communication board card and the multi-channel independent interrupt processing mechanism.
In the embodiment of the invention, a real-time processor of a lower computer utilizes a multi-channel independent interrupt processing mechanism in the process of running a driver of a multi-channel communication board card, establishes corresponding queue caches for all channels in the interrupt response process, adopts a multi-thread processing mechanism for the multi-channel queue caches, and returns read communication data to a simulator resource management platform of an upper computer side after threads corresponding to channels receiving communication data messages read corresponding data memory spaces so as to interact data with the upper computer.
Drawings
FIG. 1 is an exemplary architecture of a simulation system provided in an embodiment of the present invention;
FIG. 2 is a schematic diagram of software deployment according to an embodiment of the present invention;
FIG. 3 is another schematic diagram of software deployment provided by an embodiment of the present invention;
FIG. 4a is an exemplary flow of integrating a multi-channel communication board card in an emulator resource management platform, according to an embodiment of the present invention;
FIG. 4b is a schematic diagram of a file deployment scenario according to an embodiment of the present invention;
FIG. 5a is a schematic diagram of a display interface of Veristan according to an embodiment of the present invention;
FIG. 5b is a schematic view of a Labview display interface according to an embodiment of the present invention;
FIG. 6 is an exemplary flow chart of a human-machine interaction interface using a display interface of a human-machine interaction development environment platform instead of a human-machine interaction interface of a simulator resource management platform provided by an embodiment of the invention;
fig. 7 is an exemplary flow of a data processing method according to an embodiment of the present invention.
Detailed Description
Referring to fig. 1, the HIL simulation system currently used in many cases includes an upper computer and a HIL lower computer (real-time target host), in which an NI) real-time processor and a board are installed. The NI real-time processor and the board card can communicate through a PXI (PCI extensions for Instrumentation) interface facing the PCI expansion of the instrument system. As for the upper computer, it may communicate with a real-time processor (real-time processing system) by wired or wireless means, for example, may communicate via ethernet.
The board card can be used for installing a third party communication board card in a lower computer besides the board card of the NI company, and the third party communication board card is also connected with a Remote Terminal (RT).
In terms of software, please refer to fig. 2 and 3, an emulator resource management platform (e.g., NI Veristand engineering) may be deployed in the host computer. In addition, in other embodiments, a human-machine interaction development environment platform (e.g., labview) may also be deployed.
The existing third party board card is a single function board card, and input and output data of the single function board card can be directly read/written into a corresponding register of the board card to perform data interaction with an upper computer by utilizing an RT-FIFO through simple encapsulation of a custom device driver (the custom device driver is a driver of the third party board card and operates on a labview RT operating system). And monitoring by a control in a monitoring interface of Veristand in the upper computer.
In one example, the Labview RT operating system may be installed in the real-time processor of the lower computer, which belongs to the same operating system as windows, linux. And a part of engineering files of the NI Veristand engineering are also downloaded to a lower computer, and after the Veristand engineering is successfully deployed to the lower computer, a custom device driver can normally run on the labview RT system.
After the development of the multi-functional multi-channel communication board card (multi-channel communication board card for short), how to perform the data processing is currently under study.
A multi-channel communication board (e.g., 1553B) has three channels, each corresponding to a separate device, that may be a Bus Controller (BC), bus Monitor (BM), or Remote Terminal (RT). The multifunctional card means that the card can support various modes of BC, BM and RT. Accordingly, the message types supported by it may include BC, BM, RT.
Different channels of the multi-channel communication board card correspond to independent memory spaces. For example, each channel corresponds to a separate RAM. The memory space further includes a data memory space corresponding to at least one type. Further, the memory space of each channel may be constituted by data memory spaces corresponding to different message types.
Taking channel 1 as an example, the corresponding memory space may include: a data memory space storing BC message types, a data memory space storing BM message types, and a data memory space storing RT message types.
In addition, the multi-channel communication board card is also provided with an interrupt status register for storing channel interrupt status information, and the channel interrupt status information will be described in detail later herein.
It should be noted that, if the third party board card works normally on the NI simulator (i.e., the lower computer), the third party board card needs to be integrated into the simulation system first. The common third party board card does not involve interruption, and only needs to read the input register and the output register. However, for a multi-channel communication board card that performs functions depending on interruption, no existing integration method exists, and thus data processing cannot be performed.
In view of this, the embodiment of the invention provides a data processing method and a simulation system for solving the data processing problem of a multi-channel communication board card.
The core of the data processing of the multi-channel communication board card is to add a multi-channel independent interrupt processing mechanism in a driver of the multi-channel communication board card, and the communication return data is acquired by using PXI interrupt.
The interrupt mechanism is one of the basic mechanisms in modern computer systems, which functions as a communication network in the system to coordinate the response and handling of various external events by the system. An interrupt is a reaction by a processor to some event that occurs in the system.
The event that causes an interrupt is referred to as an interrupt source. The request that the interrupt source makes to the processor for processing is referred to as an interrupt request. The point of interruption of the program when an interruption occurs is called a breakpoint. The process of the processor suspending the current program and transitioning to responding to an interrupt request is referred to as interrupt response.
A program or thread that handles an interrupt source is referred to as an interrupt handler or thread. The execution of an associated interrupt handler or thread by a processor is referred to as interrupt handling.
Fig. 4a illustrates an exemplary flow of integrating a multi-channel communications board card at an emulator resource management platform (build NI Veristand project), which may include:
S41: and generating a board card installation file according to the hardware resource information of the multi-channel communication board card.
Specifically, the board installation file includes an ini file and an inf file. The. Ini file and the. Inf file may be generated using an NI-VISA tool.
The inf file mainly contains some information related to the board card, and with the inf file, the board card can be identified by the system after the board card is inserted, and an interrupt request can be generated when the board card receives data; inside the ini file are mainly some initialization information.
The hardware resource information may include: UID, model Code and board interrupt detection configuration information. The UID is vendor specific, unique among PCI-based device vendors, model Code (PID), device specific, defined by the instrument manufacturer, and the configuration information for the interrupt detection of the board, i.e., interrupt mask.
Based on the UID, the PID and the interrupt detection configuration information of the board card, generating the board card installation file can comprise the following steps:
step a: identifying the multi-channel communication board card according to the hardware resource information;
specifically, there are steps for generating. Ini and. Inf files by NI-VISA tool, one of which requires filling in UID and PID of the board card. Filling in the UID and PID of the board card can be understood as identifying the board card.
Step b: and performing interrupt detection setting.
Specifically, the interrupt mask is filled in at the. Inf file interrupt setting section. The interrupt mask is a fixed number, such as 0000111b. The interrupt detection is configured to detect a card interrupt.
Step c: an interrupt flag clear operation is set.
The interrupt flag clearing operation is used for clearing the interrupt flag after the completion of the interrupt response.
Step d: and generating an installation file ini and inf.
S42: a driver for the multi-channel communication board is developed (created).
The driver may specifically be Custom Device engineering.
The Driver further includes Initialization processing (Initialization vi.vi), configuration information setting (Main page vi), and running (RT Driver vi.vi) for the multi-channel communication board.
Specifically, initialization processing (Initialization vi) is used for initializing hardware resource numbers, input/output channel names, number and the like;
the configuration information setting (Main page.vi) is used for hardware resource number modification, board card function selection and the like, and is visual content in Veristand engineering in the upper computer.
And RT Driver vi is responsible for the main part of the board driving.
The above-mentioned multi-channel independent interrupt processing mechanism is added in RT Driver vi. Because the board card is multifunctional and multi-channel, the design method of RT Driver VI.vi needs to add interrupt processing mechanisms which are mutually independent among the multi-channels.
Specifically, a Custom Device project for a multi-channel communication board can be created with a template tool provided by NI. The initialization, configuration information setting and the like are basically the same as the processing method of the input/output board card of the single-function board card, namely, the number of the input/output channels is designed, the information such as the resource number of the board card is modified according to the actual situation and the like. In contrast, the board may be configured in any one or more of BC (bus controller), BM (bus monitor) or RT (remote terminal) execution modes when configured.
It should be noted that, for a single function board card, it means that it has only one of three functions of BC, RT and BM; the multi-channel communication board card has the three functions at the same time, and can be selectively configured and used according to the use condition.
S43: and transmitting the board card installation file to a lower computer, and deploying a driver in the lower computer.
The board card installation file can be transmitted to a lower computer through ftp. When the multi-channel communication board card is installed in a lower computer (such as a C packing catalog), the real-time processor can identify the multi-channel communication board card according to the board card installation file.
The lower computer can follow the relevant setting of the resource management platform of the simulator, and can run the driver of the multi-channel communication board card after the deployment of the lower computer is completed.
See fig. 4b for deployment of files.
In FIG. 4b, labview upper computer program and Veristan project are deployed in the upper computer. The "board card parameter configuration" in fig. 4b refers to: the configuration interface of the custom device in the Veristand project is configured.
Specifically, after the customer device engineering development is completed, build operation is performed, and then the build operation is added to the Veristand engineering. After the addition is completed, a configuration interface can be seen in the Veristand project, and the board card parameters can be configured through the interface.
Specifically, the board parameter may include the visa resource name of the board, which is the name of the board in the Labview RT real-time operating system.
In addition, the board card may be configured into any one or more of execution modes of BC (bus controller), BM (bus monitor) or RT (remote terminal).
The "RT-FIFO input buffer" and "RT-FIFO output buffer" in the lower computer will be described in the embodiment shown in FIG. 7 below.
The "RT-FIFO input buffer" and the "RT-FIFO output buffer" may be collectively referred to as "RT-FIFO".
Subsequently, when the communication data is returned, the real-time processor receives an interrupt request sent by the multi-channel communication board card, and after the interrupt request is received, the multi-channel communication board card driver running on the real-time processor executes interrupt processing according to a preset multi-channel independent interrupt processing mechanism so as to read the communication data on the board and return to the upper computer. Specific interrupt handling procedures will be described later herein.
In the prior art, the communication data of the single-function board card is returned to the Veristand and is generally directly displayed in the display interface of the Veristand.
The variety and quantity of the input and output data of the multi-channel communication board card are more than those of the single-function board card, and the display controls in the display interface of Veristand are correspondingly increased.
When the amount of data to be displayed is large and the number of data to be displayed is huge, the display interface of Veristand cannot arrange the display controls due to the lack of functions of adjustment of alignment, movement, size and the like of multiple controls, so that the problem that all data to be observed cannot be conveniently displayed on the same interface exists.
In order to solve the problem of inconvenient data display, a display interface of a man-machine interaction development environment platform (such as labview) can be used for replacing a man-machine interaction interface of a simulator resource management platform to display data.
Please refer to the display interface of Veristand shown in fig. 5a and the display interface of Labview shown in fig. 5 b. Both include waveform display controls, input controls, and output display controls.
Fig. 5a and fig. 5b show that, in the display interface (Veristand workspace screen) of the Veristand, which is used for monitoring a board card or other objects in the real-time target host, the space occupied by a single display control is larger than that occupied by the whole interface, and the functions of alignment, movement, size adjustment of multiple controls are absent. The number of display controls placed in the Veristand self-contained display interface will be relatively much smaller in the same interface space than Labview.
FIG. 6 illustrates an exemplary flow of replacing a human-machine interaction interface of an emulator resource management platform with a display interface of a human-machine interaction development environment platform, including:
s61: the lower computer side returns communication data to the simulator resource management platform (Veristand).
In one example, when communication data is returned, the real-time processor of the lower computer side receives an interrupt request sent by the multi-channel communication board card, and after receiving the interrupt request, the multi-channel communication board card driver running on the real-time processor executes interrupt processing according to a preset multi-channel independent interrupt processing mechanism to read the communication data on the board and return to the resource management platform of the simulator.
Specifically, the simulator resource management platform is provided with an output interface, and communication data can be written into the output interface of the simulator resource management platform.
The communication data returned by the lower computer side can comprise communication data output by one or more channels of the multi-channel communication board card, and the communication data comprises variable data of at least one physical quantity.
The data format of the physical quantities is not uniform, and may be various data types such as boolean, integer, floating point, etc.
In one example, the lower side will first convert the data to be transferred into a string, then convert the string into one double (double floating point type) of data every 8 bytes (since only double type of data can be used by the control interacting with Veristand workspace screen), and these converted data are combined into a tuple to be transferred to Veristand.
S62: and periodically calling a read interface function of the simulator resource management platform by a human-computer interaction development environment platform (e.g. Labview) to acquire communication data returned by the multi-channel communication board card.
The read interface function is an API (Application Programming Interface, application program interface) function.
S63: the man-machine interaction development environment platform displays the acquired communication data through a display interface of the man-machine interaction development environment platform.
Taking Labview as an example, the display interface of the man-machine interaction development environment platform comprises a plurality of display controls, such as a waveform display control, an input control and an output control. The output display control is used to display the communication data from the lower machine side (such data is read from the board card through the RT-FIFO).
The display interface of the man-machine interaction development environment platform has the functions of aligning, moving and adjusting the sizes of a plurality of display controls. Therefore, compared with the man-machine interaction interface of the resource management platform of the simulator, the system has the advantages of convenience in operation and the like, for example, a plurality of command input controls and data display controls can be conveniently aligned and moved, and the size can be conveniently adjusted.
As mentioned above, the data sent out by the driver is an array of double-precision floating point type, and correspondingly, in displaying the acquired communication data, the emulator resource management platform may perform the following operations:
step A: converting the double-precision floating-point type array into an unsigned 8-bit integer (byte) array (this is done mainly to recover the original mixed data);
and (B) step (B): unpacking according to the byte length and the data type specified in the preset communication protocol of each physical quantity to obtain variable data corresponding to each physical quantity.
Unpacking is understood herein as parsing, or extracting data from an array.
The physical quantities of different data types are different in specified byte length, for example, one boolean type physical quantity is one byte length and one single precision floating point type physical quantity is four byte length, so that variable data of the physical quantity is extracted according to the specified byte length and data type.
Step C: and displaying the variable data by using a display control.
In the embodiment of the invention, the man-machine interaction development environment platform can call the read interface function of the simulator resource management platform to acquire the communication data returned by the multi-channel communication board card, and the communication data is displayed on the display interface by using the display control.
Because the display interface of the man-machine interaction development environment platform has the functions of aligning, moving and adjusting the size of a plurality of display controls, when the amount of data to be displayed is large in variety and quantity, the size of the display controls can be adjusted by using the functions to arrange the display controls, so that all the data to be observed can be displayed on the same interface.
In addition, referring still to fig. 6, under the operation of the user, the man-machine interaction development environment platform (e.g. Labview) may also send the communication command and its related parameters, that is, the excitation data, to the board driver of the lower computer by calling the write interface function (API function) of the emulator resource management platform (i.e. S64). On the lower side, the driver writes the stimulus data to the board through an RT (real time) FIFO (first in first out).
More specifically, the driver reserves a write interface, and Labview sends the communication command by calling the API function of Veristan to write data into the write interface reserved by the board card driver.
In the following, an interaction process between the components in the upper and lower computers based on the Initialization vi.vi will be described with reference to fig. 7, which includes:
S1: and the man-machine interaction development environment platform writes the excitation data into the RT-FIFO input buffer memory through a write-in interface created by the Initialization VI.vi by calling a write-in interface function of the simulator resource management platform, and then writes the excitation data into the multi-channel communication board card.
The simulator resource management platform can be used for monitoring communication data of the multichannel communication board card in the lower computer through a man-machine interaction interface of the man-machine interaction development environment platform by providing interface functions (writing interface functions and reading interface functions).
The excitation data, i.e. the data controlling the multi-channel communication board (i.e. the aforementioned communication commands), corresponds to an input to the multi-channel communication board. The multi-channel communication card is written because data is to be transmitted through the card to the terminal device with which it communicates.
The excitation data are input by a user through an input control of a man-machine interaction interface Labwiew. After the excitation data is input, the RT terminal which is communicated with the multi-channel communication board card replies communication data.
The operation of the man-machine interaction development environment platform and the simulator resource management platform can be regarded as the operation of the upper machine side.
S2: the multi-channel communication board card stores the communication data (which can be called as target communication data) received by each channel into the corresponding memory space, and writes the channel interrupt state information in the interrupt state register.
The communication data received by the channel is from the terminal device communicating with the channel.
The channel disruption status information indicates a channel in which communication data is received. For example, assuming there are two channels, data 1 (binary 01) indicates that only channel 1 has an interrupt, data 2 (binary 10) indicates that only channel 2 has an interrupt, and data 3 (binary 11) indicates that both channels 1, 2 have an interrupt.
The channel indicated by the channel disruption status information may be the target channel, for example, channel 1 and channel 2 may have received communication data (i.e., have data output), and then channel 1 and channel 2 may be the target channels, respectively.
S3: the multi-channel communication board card sends an interrupt request to the real-time processor.
S4: and the real-time processor judges that the interrupt belongs to the board card according to the interrupt setting in the inf file, and then the S5 is entered.
The inf file records the interrupt information of the board card.
S5: and the RT Driver VI.vi program reads an interrupt state register of the multi-channel communication board card to acquire channel interrupt state information.
The target channel may be determined by the channel disruption status information.
S6: and the RT Driver VI.vi program respectively establishes queue caches for all channels of the multi-channel communication board card.
S7: and the RT Driver VI.vi program puts the interrupt information of the target channel into a corresponding queue cache.
Wherein the interrupt information includes a channel identification, a message type, and a message number.
S8: the RT Driver vi.vi program establishes a message processing thread for each channel.
S9: and reading data in the corresponding memory space by the message processing thread of the target channel according to the interrupt information in the corresponding queue cache, and returning the read communication data to the simulator resource management platform.
As mentioned above, the different channels of the multi-channel communication board card correspond to independent memory spaces. The memory space includes at least one type of data memory space. Further, the memory space of the channel may be constituted by data memory spaces corresponding to different message types.
Therefore, the method can determine which type of message type should be used for reading data in the data memory space according to the channel identification and the message type in the interrupt information. And reading correct communication data from the data memory space according to the message number.
The data format of the physical quantity to be transmitted by each channel is not uniform, and may be various data types such as boolean, integer, floating point, etc.
The RT Driver vi program will first convert the data to be transferred into a string and then convert the string into one double (double floating point) data every 8 bytes (since only double type data can be used by the control interacting with Veristand workspace screen), and these converted data are combined into a data group for transfer to the emulator resource management platform.
Steps S4 to S9 are performed based on the above-described multi-channel independent interrupt handling mechanism.
In addition, the message processing thread writes the communication data into the RT-FIFO output buffer, and the RT-FIFO output buffer returns the read communication data to the emulator resource management platform.
S10: and periodically calling a read interface function of the simulator resource management platform by a human-computer interaction development environment platform (e.g. Labview) to acquire communication data returned by the multi-channel communication board card.
S10 is the same as S62 described above, and will not be described here.
S11: the man-machine interaction development environment platform displays the acquired communication data through a display interface of the man-machine interaction development environment platform.
S11 is the same as S63 described above, and will not be described here.
In the embodiment of the invention, a real-time processor of a lower computer utilizes a multi-channel independent interrupt processing mechanism in the process of running a driver of a multi-channel communication board card, establishes corresponding queue caches for all channels in the interrupt response process, adopts a multi-thread processing mechanism for the multi-channel queue caches, and returns read communication data to a simulator resource management platform of an upper computer side after threads corresponding to channels receiving communication data messages read corresponding data memory spaces so as to interact data with the upper computer.
The invention also claims a simulation system, please refer to fig. 1, which may include an upper computer and a lower computer.
And an NI real-time processor and a board card are arranged in the lower computer. The NI real-time processor and the board card can communicate through a PXI (PCI extensions for Instrumentation) interface facing the PCI expansion of the instrument system. As for the upper computer, it may communicate with a real-time processor (real-time processing system) by wired or wireless means, for example, may communicate via ethernet.
The board card can be used for installing a third party communication board card in a lower computer besides the board card of the NI company, and the third party communication board card is also connected with a Remote Terminal (RT).
In terms of software, please refer to fig. 2 and 3, an emulator resource management platform (e.g., NI Veristand engineering) may be deployed in the host computer. In addition, in other embodiments, a human-machine interaction development environment platform (e.g., labview) may also be deployed.
The third party communication board in this embodiment is a multi-channel communication board, and the board has a plurality of channels (for example, 1553B has three channels), and the different channels correspond to independent memory spaces. For example, each channel corresponds to a separate RAM. The memory space further includes a data memory space corresponding to at least one type. Further, the memory space of each channel may be constituted by data memory spaces corresponding to different message types.
The real-time processor may be configured to:
receiving an interrupt request sent by the multi-channel communication board card; the interrupt request is generated after the multi-channel communication board card has received communication data in at least one channel; wherein, the communication data received by each channel is target communication data; the target communication data is stored in a data memory space corresponding to the message type of the target communication data;
running the driver to execute interrupt processing according to a preset multichannel independent interrupt processing mechanism;
the resource management platform of the simulator at least can be used for: adding and configuring the driving program;
specifically, the interrupt processing may include:
reading an interrupt state register of the multi-channel communication board card to obtain channel interrupt state information; the channel interruption state information is used for indicating a channel with received communication data in the multi-channel communication board card; each channel with received communication data is a target channel;
respectively establishing queue caches for all channels of the multi-channel communication board card;
the interrupt information of the target channel is put into a corresponding queue cache; the interrupt information includes: the channel identification of the target channel, the message type and the message number of the communication data received in the target channel;
Respectively establishing message processing threads for all channels of the multi-channel communication board card;
reading communication data from the corresponding data memory space by the message processing thread of the target channel according to the interrupt information in the corresponding queue cache;
and returning the read communication data to the resource management platform of the simulator.
The specific description is referred to the foregoing description, and will not be repeated here.
In other embodiments of the present invention, a man-machine interaction development environment platform may be deployed in the upper computer in all the embodiments described above;
the man-machine interaction development environment platform is used for: periodically acquiring communication data returned by the multi-channel communication board card by calling a read interface function of the resource management platform of the simulator;
displaying the acquired communication data through a display interface of the communication device; the display interface comprises a plurality of display controls; the display interface has the functions of aligning, moving and resizing the plurality of display controls.
The specific description is referred to the foregoing description, and will not be repeated here.
In other embodiments of the present invention, the communication data obtained by the resource management platform of the emulator in all the above embodiments includes: double-precision floating point type array;
In the aspect of acquiring communication return data, the man-machine interaction interface platform is specifically used for:
converting the array of the double-precision floating point type into an unsigned integer array; the unsigned integer array comprises variable data corresponding to a plurality of physical quantities;
analyzing according to the data length and the data type specified by each physical quantity in a preset communication protocol to obtain variable data corresponding to each physical quantity;
and displaying the variable data obtained through analysis by using a display control.
The specific description is referred to the foregoing description, and will not be repeated here.
In other embodiments of the present invention, the emulator resource management platform in all the embodiments described above may be further configured to:
generating an installation file for identifying the multi-channel communication board card on the lower machine side according to the hardware resource information of the multi-channel communication board card;
creating a driver of the multi-channel communication board card; the driver includes an initialization process for the multi-channel communication board card and the multi-channel independent interrupt processing mechanism.
The specific description is referred to the foregoing description, and will not be repeated here.
In other embodiments of the present invention, before receiving the interrupt request, the emulator resource management platform in all the embodiments may further transmit the board card installation file to the lower computer; when the multi-channel communication board card is installed in the lower computer, the real-time processor identifies the multi-channel communication board card according to the board card installation file.
In addition, the above-mentioned driver can be deployed in the lower computer by the emulator resource management platform.
The specific description is referred to the foregoing description, and will not be repeated here.
In other embodiments of the present invention, the emulator resource management platform in all the above embodiments reserves a communication command interface;
the man-machine interaction development environment platform can be used for:
receiving excitation data input by a user;
transmitting a communication command carrying the excitation data to the simulator resource management platform through the communication command interface; the communication command is transmitted to the corresponding remote terminal through the simulator resource management platform, the real-time processor and the multi-channel communication board card.
The specific description is referred to the foregoing description, and will not be repeated here.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and reference is made to the description of the method section.
Those of skill would further appreciate that the elements and model steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the elements and steps of the examples have been described generally in terms of functionality in the foregoing description to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or model described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, WD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. The data processing method is characterized by being applied to a simulation system; the simulation system comprises an upper computer and a lower computer; wherein, the upper computer is provided with a simulation organic resource management platform; the lower computer is provided with a multi-channel communication board card and a real-time processor, and is provided with a driving program for operating the multi-channel communication board card; different channels of the multi-channel communication board card correspond to independent memory spaces;
the method comprises the following steps:
the real-time processor receives an interrupt request sent by the multi-channel communication board card; the interrupt request is generated after the multi-channel communication board card has received communication data in at least one channel; the communication data received by each channel is target communication data, and the target communication data is stored in a data memory space corresponding to the message type of the target communication data;
the real-time processor runs the driving program to execute interrupt processing according to a preset multichannel independent interrupt processing mechanism;
wherein the interrupt processing includes:
reading an interrupt state register of the multi-channel communication board card to obtain channel interrupt state information; the channel interruption state information is used for indicating a channel with received communication data in the multi-channel communication board card; each channel with received communication data is a target channel;
Respectively establishing queue caches for all channels of the multi-channel communication board card;
the interrupt information of the target channel is put into a corresponding queue cache; the interrupt information includes: the channel identification of the target channel, the message type and the message number of the communication data received in the target channel;
respectively establishing message processing threads for all channels of the multi-channel communication board card;
reading communication data from the corresponding data memory space by the message processing thread of the target channel according to the interrupt information in the corresponding queue cache;
and returning the read communication data to the resource management platform of the simulator.
2. The method of claim 1, wherein,
a man-machine interaction development environment platform is also deployed in the upper computer;
the method further comprises the steps of:
the man-machine interaction development environment platform periodically acquires communication data returned by the multi-channel communication board card by calling a read interface function of the simulator resource management platform;
the man-machine interaction development environment platform displays the acquired communication data through a display interface of the man-machine interaction development environment platform; the display interface comprises a plurality of display controls; the display interface has the functions of aligning, moving and resizing the plurality of display controls.
3. The method of claim 2, wherein,
the communication data obtained by the resource management platform of the simulator comprises: double-precision floating point type array;
the displaying the acquired communication data comprises the following steps:
converting the array of double-precision floating points into an unsigned integer array; the unsigned integer array comprises variable data corresponding to a plurality of physical quantities;
analyzing the unsigned integer array according to the byte length and the data type specified by each physical quantity in a preset communication protocol to obtain variable data corresponding to each physical quantity;
and displaying the variable data obtained through analysis by using a display control.
4. A method as claimed in any one of claims 1 to 3, further comprising, prior to receiving the interrupt request:
generating an installation file for identifying the multi-channel communication board card by a lower machine side according to the hardware resource information of the multi-channel communication board card;
creating a driver of the multi-channel communication board card; the driver comprises an initialization process for the multi-channel communication board card and the multi-channel independent interrupt processing mechanism.
5. The method of claim 4, prior to receiving the interrupt request, further comprising:
Transmitting the board card installation file to the lower computer;
after the multichannel communication board card is installed in the lower computer, the real-time processor identifies the multichannel communication board card according to the board card installation file;
and deploying the driver in the lower computer.
6. The method of claim 2, wherein,
the resource management platform of the simulator is reserved with a communication command interface;
the method further comprises the steps of:
the man-machine interaction development environment platform receives excitation data input by a user;
the man-machine interaction development environment platform sends a communication command carrying the excitation data to the simulator resource management platform through the communication command interface; and the communication command is transmitted to the corresponding remote terminal through the simulator resource management platform, the real-time processor and the multi-channel communication board card.
7. The simulation system is characterized by comprising an upper computer and a lower computer; wherein, the upper computer is provided with a simulation organic resource management platform; the lower computer is provided with a multi-channel communication board card and a real-time processor, and is provided with a driving program for operating the multi-channel communication board card; different channels of the multi-channel communication board card correspond to independent memory spaces;
The real-time processor is used for:
receiving an interrupt request sent by the multi-channel communication board card; the interrupt request is generated after the multi-channel communication board card has received communication data in at least one channel; the communication data received by each channel is target communication data, and the target communication data is stored in a data memory space corresponding to the message type of the target communication data;
running the driver to execute interrupt processing according to a preset multichannel independent interrupt processing mechanism;
the emulator resource management platform is at least used for: adding and configuring the driver;
wherein the interrupt processing includes:
reading an interrupt state register of the multi-channel communication board card to obtain channel interrupt state information; the channel interruption state information is used for indicating a channel with received communication data in the multi-channel communication board card; each channel with received communication data is a target channel;
respectively establishing queue caches for all channels of the multi-channel communication board card;
the interrupt information of the target channel is put into a corresponding queue cache; the interrupt information includes: the channel identification of the target channel, the message type and the message number of the communication data received in the target channel;
Respectively establishing message processing threads for all channels of the multi-channel communication board card;
reading communication data from the corresponding data memory space by the message processing thread of the target channel according to the interrupt information in the corresponding queue cache;
and returning the read communication data to the resource management platform of the simulator.
8. The system of claim 7, wherein a human-computer interaction development environment platform is further deployed in the upper computer;
the man-machine interaction development environment platform is used for: periodically calling a read interface function of the resource management platform of the simulator to acquire communication data returned by the multi-channel communication board card;
displaying the acquired communication data through a display interface of the communication device; the display interface comprises a plurality of display controls; the display interface has the functions of aligning, moving and resizing the plurality of display controls.
9. The system of claim 8, wherein,
the communication data obtained by the resource management platform of the simulator comprises: double-precision floating point type array;
in the aspect of obtaining communication return data, the man-machine interaction development environment platform is specifically used for:
Converting the array of double-precision floating points into an unsigned integer array; the unsigned integer array comprises variable data corresponding to a plurality of physical quantities;
analyzing according to the byte length and the data type specified by each physical quantity in a preset communication protocol to obtain variable data corresponding to each physical quantity;
and displaying the variable data obtained through analysis by using a display control.
10. The method of any of claims 1-3, wherein the emulator resource management platform is further to:
generating an installation file for identifying the multi-channel communication board card by a lower machine side according to the hardware resource information of the multi-channel communication board card;
creating a driver of the multi-channel communication board card; the driver comprises an initialization process for the multi-channel communication board card and the multi-channel independent interrupt processing mechanism.
CN202010215015.5A 2020-03-24 2020-03-24 Data processing method and simulation system Active CN111444609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010215015.5A CN111444609B (en) 2020-03-24 2020-03-24 Data processing method and simulation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010215015.5A CN111444609B (en) 2020-03-24 2020-03-24 Data processing method and simulation system

Publications (2)

Publication Number Publication Date
CN111444609A CN111444609A (en) 2020-07-24
CN111444609B true CN111444609B (en) 2023-08-08

Family

ID=71652425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010215015.5A Active CN111444609B (en) 2020-03-24 2020-03-24 Data processing method and simulation system

Country Status (1)

Country Link
CN (1) CN111444609B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114430287B (en) * 2022-01-27 2024-03-01 杭州长川科技股份有限公司 Control method of multichannel control system and multichannel control system
CN114826938B (en) * 2022-04-20 2022-11-11 国家工业信息安全发展研究中心 Method for realizing communication protocol simulation

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1501754A (en) * 1974-02-01 1978-02-22 Cii Data-processing system
CN101996148A (en) * 2010-09-29 2011-03-30 清华大学 Instrument test board configuration method for a plurality of communication protocols
WO2012155396A1 (en) * 2011-05-19 2012-11-22 中兴通讯股份有限公司 Control device and method for simulation channel in wireless network
CN107066693A (en) * 2017-03-14 2017-08-18 长沙鼎端电子技术有限公司 The spaceborne AIS reconnaissance signals simulation system of multi-channel multi-target
CN107229584A (en) * 2017-06-01 2017-10-03 西南电子技术研究所(中国电子科技集团公司第十研究所) Aviation electronics simulation test platform I/O management systems
CN110399702A (en) * 2019-05-10 2019-11-01 武汉精能电子技术有限公司 A kind of method of board synchronizing information, visualized operation interface and power supply analogue system
CN110674584A (en) * 2019-09-29 2020-01-10 北京润科通用技术有限公司 Multi-aircraft combined simulation system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8762125B2 (en) * 2008-02-25 2014-06-24 International Business Machines Corporation Emulated multi-tasking multi-processor channels implementing standard network protocols
US11157014B2 (en) * 2016-12-29 2021-10-26 Tesla, Inc. Multi-channel sensor simulation for autonomous control systems
US10885240B2 (en) * 2017-11-02 2021-01-05 Uatc, Llc Deterministic simulation framework for autonomous vehicle testing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1501754A (en) * 1974-02-01 1978-02-22 Cii Data-processing system
CN101996148A (en) * 2010-09-29 2011-03-30 清华大学 Instrument test board configuration method for a plurality of communication protocols
WO2012155396A1 (en) * 2011-05-19 2012-11-22 中兴通讯股份有限公司 Control device and method for simulation channel in wireless network
CN107066693A (en) * 2017-03-14 2017-08-18 长沙鼎端电子技术有限公司 The spaceborne AIS reconnaissance signals simulation system of multi-channel multi-target
CN107229584A (en) * 2017-06-01 2017-10-03 西南电子技术研究所(中国电子科技集团公司第十研究所) Aviation electronics simulation test platform I/O management systems
CN110399702A (en) * 2019-05-10 2019-11-01 武汉精能电子技术有限公司 A kind of method of board synchronizing information, visualized operation interface and power supply analogue system
CN110674584A (en) * 2019-09-29 2020-01-10 北京润科通用技术有限公司 Multi-aircraft combined simulation system

Also Published As

Publication number Publication date
CN111444609A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
US5640572A (en) System and method for mapping driver level event function calls from a process-based driver level program to a session-based instrumentation control driver level system
US7739693B2 (en) Generic application program interface for native drivers
US5847955A (en) System and method for controlling an instrumentation system
US6173438B1 (en) Embedded graphical programming system
US7546584B2 (en) Method and system for remote software testing
US4231087A (en) Microprocessor support system
CN111444609B (en) Data processing method and simulation system
EP2148259A1 (en) Field device management apparatus and field device management system
GB2383437A (en) Integrated hardware treace unit
KR102243791B1 (en) Systems and methods for simulated device testing using a memory-based communication protocol
EP0477124A1 (en) Method and apparatus for distributed processing of display panel information
US7385927B2 (en) Methods and structure for improved testing of embedded systems
US5958028A (en) GPIB system and method which allows multiple thread access to global variables
US7441158B1 (en) Embedded hardware debugging tool and associated method
Wells et al. Hardware and software considerations for implementing hardware-in-the loop traffic simulation
CN1312583C (en) Simulation apparatus, simulation program, and recording medium
CN111930628B (en) Security level display module graphic configuration simulation system and simulation method thereof
US11958511B2 (en) Train signal system and linkage method therefor
CN113609052A (en) Chip simulation system based on FPGA and microprocessor and implementation method
CN114428702A (en) Information physical test system containing general interface module
CN111813673A (en) Hard disk filling test method and system
US7818627B2 (en) Systems and methods for gathering debug information
JP2001318805A (en) Test method for built-in system and test system
HUT66465A (en) Interface system for coupling two computer environments
US6606635B1 (en) Data processing apparatus

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
GR01 Patent grant
GR01 Patent grant