Disclosure of Invention
In view of the above-mentioned drawbacks or shortcomings in the prior art, it is desirable to provide a method for detecting bus network traffic, which can select an optimal streaming mode according to data transmission requirements, has good flexibility, and effectively improves detection efficiency.
The invention provides a method for detecting bus network flow, which comprises the following steps:
1) Configuring a sending channel and a receiving channel of a data packet;
2) Defining configuration parameters of the data packet;
3) Selecting a streaming mode according to the data transmission requirement, wherein the streaming mode comprises a hardware generation mode, a software generation mode and a mixed generation mode;
4) The test software transmits a data packet to the bus network through the hardware board card and transmits the data packet to the accompanying test equipment, and the accompanying test equipment feeds back response information to the hardware board card, and the hardware board card uploads the response information to the test software;
5) And the test software performs flow statistics and data analysis processing on the data packet and the response information, and displays the data flow and response time delay of the bus network on a software interface.
Further, in the step 2), the configuration parameters include a frame header and a load.
Furthermore, the hardware generation mode is that the test software sends configuration parameters to the hardware board card through driving, the hardware board card forms the configuration parameters into data packets according to protocol rules, the data packets are sent to the accompanying and testing equipment through a bus network, and the hardware board card uploads response information fed back by the accompanying and testing equipment according to the protocol rules.
Furthermore, the software generation mode is that the test software forms a data packet according to the protocol rule, the data packet is transmitted to the hardware board card in a transparent transmission mode, the hardware board card transmits the data packet to the accompanying and testing equipment through the bus network, and the hardware board card uploads response information fed back by the accompanying and testing equipment according to the protocol rule.
Furthermore, the hybrid generation mode is that the test software composes the data packet according to the protocol rule, the data packet is transmitted to the hardware board card in a transparent transmission mode, the hardware board card stores the data packet into the DDR, the hardware board card circularly transmits the data packet to the accompanying and testing equipment through the bus network, and the hardware board card uploads the response information fed back by the accompanying and testing equipment according to the protocol rule.
Further, the FC header includes a generic header, a command header, and a status header.
Compared with the prior art, the invention has the beneficial effects that:
(1) When the detection method of the invention detects the flow of the bus network, the optimal streaming mode can be selected according to the transmission requirement of data, the hardware generation mode responds to the data processing mode in the most timely mode by framing through hardware and responding to the accompanying detection equipment on the bus network, the framing of the software generation mode is completely controlled by software, the flexibility of data configuration and processing is increased, the flexibility of software and the timeliness of hardware are considered in the mixed generation mode, the requirements of various test scenes are met, the detection flexibility is good, and the detection efficiency of the flow of the bus network is effectively improved.
(2) The detection method of the invention satisfies the creation of various data packets by customizing the frame header and the load of the data packets.
It should be understood that the description in this summary is not intended to limit the critical or essential features of the embodiments of the invention, nor is it intended to limit the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the invention are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other. The invention will be described in detail below with reference to the drawings in connection with embodiments.
Referring to fig. 1 to 6, an embodiment of the present invention provides a method for detecting bus network traffic, including the following steps:
1) Configuring a sending channel and a receiving channel of a data packet;
2) The configuration parameters of the data packet are customized, wherein the configuration parameters comprise frame headers and loads, and the data packet comprises SOFs, FC frame headers, data fields, CRC (cyclic redundancy check) and EOFs;
3) Selecting a streaming mode according to the data transmission requirement, wherein the streaming mode comprises a hardware generation mode, a software generation mode and a mixed generation mode;
The hardware generation mode is that the test software transmits configuration parameters to the hardware board card through driving, the hardware board card forms the configuration parameters into data packets according to protocol rules, and the data packets are transmitted to the accompanying and testing equipment through a bus network;
the software generation mode is that the test software forms a data packet with configuration parameters according to protocol rules, and the data packet is transmitted to the hardware board card in a transparent transmission mode, and the hardware board card transmits the data packet to the accompanying and testing equipment;
The mixed generation mode is that test software forms a data packet according to protocol rules, the data packet is transmitted to a hardware board card in a transparent transmission mode, the hardware board card stores the data packet into the DDR, and the hardware board card circularly transmits the data packet to accompanying test equipment through a bus network;
4) The test software transmits a data packet to the bus network through the hardware board card and transmits the data packet to the accompanying test equipment, and the accompanying test equipment feeds back response information to the hardware board card, and the hardware board card uploads the response information to the test software;
5) And the test software performs flow statistics and data analysis processing on the data packet and the response information, and displays the data flow and response time delay of the bus network on a software interface.
In this embodiment, as shown in fig. 2, the architecture diagram of the test system of the present invention is shown, the bus network traffic test software is connected with the accompanying test device through the hardware board card and the bus network, the bus network traffic test software sends data to the bus, the accompanying test device gives a response according to the protocol after receiving the data frames and returns the data to the hardware board card through the bus network, the hardware board card uploads the data to the bus network traffic test software, the hardware board card respectively time stamps the transceiving data in the data transmission process, the test software counts the transceiving data amount, calculates the transceiving rate, analyzes the transceiving data according to the protocol, and calculates the bus forwarding or response time delay through the transceiving data time stamp.
The composition of the data packet is shown in fig. 3, and the specific meaning is as follows:
SOF, frame delimiter, is an ordered set before frame content;
FC frame header, the first field of frame content, 6 words, namely 24 bytes, whose structure is shown in the general frame header of FIG. 4, followed by SOF, FC frame header is used to control link operation, control device transmission protocol and detect lost or unordered frames;
The data field comprises an extended frame header and a load, wherein the length of the extended frame header is equal to multiple of four bytes, the length of the FC-0 type frame data segment is zero, the length of the FC-1 type frame is equal to multiple of four bytes, the range is 0 byte to 2112 bytes, and if the effective load cannot be divided by 4, the effective load is filled;
CRC is a four byte field following the data field for detecting the data integrity of the frame header and the data field, and SOF and EOF are not included in the CRC check;
EOF, frame delimiter, indicates the end of frame content for an ordered set immediately following the CRC.
After the frame header and the load content of the data packet are configured, a streaming mode is selected, a test is started, the test software transmits data to the hardware board card, the data is the data packet with the configuration parameters or the test software group, the configuration parameters are transmitted to the hardware board card to form the data packet, the hardware board card transmits the data packet with a time stamp to a bus network, acquires response information fed back by a test accompanying device through the bus network, and then transmits the response information with the time stamp to the test software, and the software compares and analyzes the data packet with the response information and counts the data receiving and transmitting quantity, so that the automatic detection of the bus flow is realized.
As shown in fig. 4, the FC universal frame header control has a total of 6 words, each word has 32 bits, and corresponding cells can be edited in real time with 16-system data by double clicking, so that various types of FC universal frame headers can be formed.
As shown in fig. 5, the FC command frame header control has a total of 12 words, each word has 32 bits, and the corresponding cells can be edited in real time with 16-system data by double clicking, so that different types of FC command frame headers can be combined.
As shown in fig. 6, the FC status frame header control has 8 words in total, each word has 32 bits, and the corresponding cells can be edited in real time with 16-system data by double clicking, so that different types of FC status frame headers can be combined.
The invention realizes a whole set of processes of transmitting and collecting bottom layer signals and counting and analyzing data by upper layer test software through bus network flow test software and a matched hardware board card, and provides a solution for bus network flow detection for aviation buses.
In the description of the present specification, the terms "one embodiment," "some embodiments," and the like, mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above is only a preferred embodiment of the present application, and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.