Data processing method and device, data transmission system and method and storage medium
By setting up a virtual network card in the data processing device and modifying its corresponding relationship, the complexity of the upper machine frequently modified the network address information in the development and testing of the upper machine in the vehicle electronic system, and achieves simpler and efficient data transmission.
Patent Information
- Application Number
- CN202411281832.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-01-28
AI Technical Summary
In the development and testing of on-board electronic systems, the host computer needs to frequently modify the network address information of the data, resulting in complex operations and may affect data transmission due to insufficient permissions or IP address conflicts.
Set up virtual network cards in the data processing device, and use the network address information of the corresponding virtual network card as the network address information of the source device when sending the packets of the simulation node. Network address information.
Simplified operations, avoiding the user's manually entering the lengthy network address information, reducing the risk of insufficient permissions and IP address conflicts, and increasing the convenience of data transmission of the upper -to -Ethernet device.
Smart Images

Figure CN119383032A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data transmission, and in particular to a data processing method, device, data transmission system, method and storage medium. Background Art
[0002] The vehicle electronic system is a system composed of some or all electronic devices in the vehicle, such as the engine electronic control system, automatic air conditioning system, driver assistance system and infotainment system. When developing and testing the vehicle electronic system, it involves data interaction between the host computer and the electronic devices used for the vehicle electronic system. For example, the host computer sends data to real electronic devices, where the data sent by the host computer can simulate the data sent by one or more electronic devices, and then test, calibrate, diagnose and control the real electronic devices.
[0003] In the development and testing related to Ethernet, the data sent by the host computer needs to be encapsulated into Ethernet message frames and then sent to Ethernet devices. Ethernet devices are electronic devices that use the Ethernet communication protocol. According to the Ethernet physical layer data transmission requirements, Ethernet frames include parameters such as the target MAC address, source MAC address, frame type, and data packets. Data packets are further subdivided into data packets of different protocols, such as IP data packets.
[0004] Therefore, it is generally necessary to set a network address information as the source address information for one or a group of data on the host computer. The network address information includes at least the MAC address, and may also include the IP address, port number, etc. The data is encapsulated into an Ethernet message frame through the kernel network protocol stack of the host computer and sent to the Ethernet device. On the one hand, when simulating data sent by different Ethernet devices, different MAC addresses, IP addresses and other address information need to be set, that is, users need to frequently modify the network address information of the data. On the other hand, due to insufficient user permissions and other network devices in the local area network where the host computer itself is located, IP addresses have been assigned, etc., there may be problems such as the inability to call the network protocol stack of the host computer and IP address conflicts, which brings inconvenience to the data transmission from the host computer to the Ethernet device. Summary of the invention
[0005] The embodiments of the present application provide a data processing method, device, data transmission system, method and storage medium. The virtual network card has network address information. When the message of the simulation node is sent, the network address information of the corresponding virtual network card can be used as the network address information of the source device. The correspondence between the simulation node and the virtual network card can be directly modified to use different network address information as the network address information of the source device. The operation is simpler, and the work of encapsulating Ethernet message frames is delegated to the data processing device for execution. The network protocol stack of the data processing device is called to avoid problems such as insufficient authority and IP conflict, and data transmission from the host computer to the Ethernet device can be more conveniently realized.
[0006] An embodiment of the present application provides a data processing method, which is applied to a data processing device, wherein at least one virtual network card is pre-set in the data processing device, and the virtual network card is configured with network address information. The data processing method includes: receiving a message from at least one simulation node sent from a host computer, obtaining the virtual network card corresponding to the simulation node, encapsulating the message of the simulation node into an Ethernet message frame through the network protocol stack of the data processing device and the virtual network card corresponding to the simulation node, and sending the Ethernet message frame to an Ethernet device through the Ethernet interface of the data processing device; wherein the simulation node is predefined and corresponds to at least one message to be sent, and a corresponding relationship is set between the simulation node and the virtual network card.
[0007] An embodiment of the present application provides a data processing device for implementing the above-mentioned data processing method.
[0008] An embodiment of the present application provides a data transmission system, including a host computer and the above-mentioned data processing device; the host computer predefines at least one simulation node, which is used to send a message of at least one simulation node from the host computer to the data processing device; the data processing device is used to receive a message of at least one simulation node sent from the host computer, obtain a virtual network card corresponding to the simulation node, encapsulate the message of the simulation node into an Ethernet message frame through a network protocol stack and the virtual network card corresponding to the simulation node, and send the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device.
[0009] An embodiment of the present application provides a data transmission method, which is applied to the above-mentioned data transmission system, and the data transmission method includes: obtaining mapping information of a simulation node, wherein the mapping information is at least used to indicate the corresponding relationship between the simulation node and the virtual network card set in the data processing device; sending a message of at least one simulation node from the upper computer to the data processing device; the data processing device receives a message of at least one simulation node sent from the upper computer, obtains the virtual network card corresponding to the simulation node, encapsulates the message of the simulation node into an Ethernet message frame through the network protocol stack and the virtual network card corresponding to the simulation node, and sends the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device.
[0010] An embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data processing method are implemented.
[0011] In some embodiments, the data processing method also includes: receiving and executing network card configuration instructions, wherein the network card configuration instructions include one or more of the following instructions: a network card creation instruction, used to instruct the data processing device to create a virtual network card; a network card deletion instruction, used to instruct the data processing device to delete the virtual network card; a network card modification instruction, used to instruct the data processing device to modify the network address information of the virtual network card.
[0012] In some embodiments, the data processing device has multiple Ethernet interfaces, and the data processing device sends Ethernet message frames to the Ethernet device through the Ethernet interface corresponding to the simulation node; wherein a corresponding relationship is set between the simulation node and the Ethernet interface.
[0013] In some embodiments, the simulation node corresponds to at least one virtual network card, and the simulation node corresponds to different virtual network cards in different time periods.
[0014] In some embodiments, obtaining the virtual network card corresponding to the simulation node includes: the data processing device receives a message of at least one simulation node and network card identification information sent from the host computer, and determines at least one virtual network card according to the network card identification information, and the network card identification information is used to instruct the data processing device to determine at least one virtual network card.
[0015] In some embodiments, the data processing device stores a correspondence between simulation nodes and virtual network cards set in the data processing device, and obtaining the virtual network card corresponding to the simulation node includes: the data processing device receives a message of at least one simulation node and node identification information sent from a host computer, and determines at least one virtual network card according to the node identification information, the correspondence between the simulation node and the virtual network card, and the node identification information is used to instruct the data processing device to determine a simulation node.
[0016] In some embodiments, the data processing device has multiple Ethernet interfaces, and the mapping information of the simulation node includes: the correspondence between the simulation node and the logical port, the correspondence between the logical port and the Ethernet interface, and the correspondence between the Ethernet interface and the virtual network card. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 It is a schematic diagram of the connection between the data processing device and the host computer provided in the embodiment of the present application;
[0019] Figure 2 It is a schematic diagram of the connection between the data processing device and the host computer provided in the embodiment of the present application;
[0020] Figure 3 It is a flowchart of the data processing method provided in the embodiment of the present application;
[0021] Figure 4 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of connection between a terminal device and a data processing device provided in an embodiment of the present application;
[0023] Figure 6 is a schematic diagram of connection between a terminal device and a data processing device provided in an embodiment of the present application;
[0024] Figure 7 is a schematic diagram of cascading multiple data processing devices in a data transmission system provided in an embodiment of the present application;
[0025] Figure 8 is a schematic diagram of a plurality of data processing devices in a data transmission system provided in an embodiment of the present application being cascaded and connected to a timing device;
[0026] Fig. 9 It is a flowchart of the data transmission method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application. At the same time, in the description of the embodiments of the present application, terms and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0028] In the application scenario of the embodiment of the present application, Figure 1 , Figure 2 As shown, the host computer 200 is connected to the data processing device 100, the data processing device 100 is connected to at least one real Ethernet device 300, and the host computer 200 communicates with the real Ethernet device 300 through the data processing device 100 to perform operations such as testing, calibration, diagnosis, and control on the real Ethernet device 300.
[0029] The host computer can communicate with the real Ethernet device through the data processing device in the following ways: the host computer sends data to the real Ethernet device, for example, during an open-loop test, it only needs to send data to the Ethernet device. The host computer can communicate with the real Ethernet device through the data processing device in the following ways: the host computer sends data to the real Ethernet device and receives data sent by the real Ethernet device, for example, during a closed-loop test, it sends data to the Ethernet device and receives data fed back by it, for example, when calibrating the Ethernet device, it sends a signal value to the Ethernet device, and determines whether it needs to continue to modify and send the signal value based on the data fed back by it.
[0030] Exemplarily, the Ethernet device to which the data processing device is connected may be an electronic device that uses the Ethernet communication protocol and is used in an on-board electronic system, such as a sensor (e.g., a lidar sensor), a vehicle electronic control unit (ECU), a clock source, a test bench, etc., and may also be a network device such as a switch. It should be noted that the electronic device used in the on-board electronic system here is not limited to the electronic device mounted on the vehicle, but also includes any electronic device used in the development and testing process of the on-board electronic system. The electronic device may be in the development process or may have been developed, and may include electronic devices that can be installed in the vehicle after development and form an on-board electronic system with other electronic devices, and may include a test bench, and the test bench is equipped with a simulation model, wherein the simulation model can be used to simulate one or more electronic devices.
[0031] Exemplarily, the data processing device includes a plurality of Ethernet interfaces, and the plurality of Ethernet interfaces may all be vehicle-mounted Ethernet interfaces, or may all be common Ethernet interfaces, or may be partly vehicle-mounted Ethernet interfaces and partly common Ethernet interfaces. The Ethernet device may support at least one of the vehicle-mounted Ethernet communication protocol and the common Ethernet communication protocol. According to the supported Ethernet communication protocol, the Ethernet device may have at least one of the vehicle-mounted Ethernet port and the common Ethernet port. For example, an ECU supports the vehicle-mounted Ethernet communication protocol and the common Ethernet communication protocol, and also supports communication protocols such as the CAN bus communication protocol, and has communication ports such as the vehicle-mounted Ethernet port, the common Ethernet port, and the CAN bus port.
[0032] The Ethernet device can be connected to the data processing device and communicate with the data processing device using the Ethernet communication protocol. For example, the Ethernet device can be connected to the vehicle-mounted Ethernet interface of the data processing device and communicate with the data processing device using the vehicle-mounted Ethernet communication protocol. For example, the Ethernet device can be connected to the ordinary Ethernet interface of the data processing device and communicate with the data processing device using the ordinary Ethernet communication protocol. In addition, it is not excluded that the Ethernet device has an in-vehicle Ethernet port and an ordinary Ethernet port, is connected to both the in-vehicle Ethernet interface and the ordinary Ethernet interface of the data processing device, and communicates with the data processing device using the in-vehicle Ethernet communication protocol and the ordinary Ethernet communication protocol at the same time or at different times.
[0033] Exemplarily, the host computer is, for example, a computer such as a computer connected to the data processing device, an industrial computer, etc. According to the commonly used design, the host computer can support one or more communication protocols such as USB, ordinary Ethernet protocol, PCEI protocol, etc. For a specially designed host computer, more types of communication protocols may also be supported. The ordinary Ethernet interface of the data processing device can be connected to an ordinary Ethernet device, or it can be connected to the host computer as a host computer interface for transmitting data with the host computer. Further, the data processing device can also be provided with a USB interface, a PCIE interface and more types of interfaces, which are connected to the host computer as a host computer interface for transmitting data with the host computer. The data processing device can be connected to the host computer via a USB cable, or it can be connected to the host computer via a network cable. In addition, the possibility of connecting the host computer by other communication means such as optical fiber and wireless communication is not excluded.
[0034] The host computer can be connected to the data processing device, and send data to the Ethernet device through the data processing device, and the host computer can display the content of the data to be sent. In addition, the host computer can also receive data sent by the Ethernet device through the data processing device, directly store the received data, and continue to send the received data to other devices, such as to a cloud server or storage device, and can also display and analyze the received data, such as displaying data content, timestamp, etc.
[0035] Exemplarily, the host computer can be connected to the data processing device via at least one host computer interface. For example, the host computer can be connected to the data processing device via a USB interface and transmit data. For example, the host computer can be connected to the data processing device via a USB interface and an ordinary Ethernet interface. When the amount of data is small, the data is transmitted through the USB interface. When the amount of data is large, the data is transmitted through the ordinary Ethernet interface. This can meet data transmission requirements in different scenarios.
[0036] Exemplarily, the number of host computers may be one or more. When the data processing device is connected to multiple host computers, each host computer is connected to the data processing device through at least one host computer interface, and the data processing device is used to realize data transmission between the Ethernet device and the multiple host computers. As an example, the Ethernet devices communicated by each host computer may be different, that is, the data processing device is connected to multiple host computers and multiple Ethernet devices, one host computer realizes communication with at least one Ethernet device through the data processing device, and one Ethernet device communicates with only one host computer. As an example, multiple host computers can communicate with the same Ethernet device, that is, the data processing device is connected to multiple host computers and at least one Ethernet device, one host computer realizes communication with at least one Ethernet device through the data processing device, and one Ethernet device can communicate with at least one host computer.
[0037] The present application embodiment provides a data processing method, which is applied to a data processing device. At least one virtual network card is pre-set in the data processing device. The virtual network card is configured with network address information, such as Figure 3 As shown, the data processing method includes:
[0038] S100, receiving a message of at least one simulation node sent from a host computer, and obtaining a virtual network card corresponding to the simulation node;
[0039] S200, encapsulating the message of the simulation node into an Ethernet message frame through the network protocol stack of the data processing device and the virtual network card corresponding to the simulation node, and sending the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device;
[0040] The simulation node is predefined and corresponds to at least one message to be sent, and a corresponding relationship is set between the simulation node and the virtual network card.
[0041] For example, Figure 4As shown, the data processing device may include a control unit and multiple interface modules, the interface module may connect the control unit and the physical interface, the interface module may be, for example, a USB module, an in-vehicle Ethernet module, an ordinary Ethernet module, etc., each interface module may include, for example, a transceiver chip of a corresponding communication protocol, such as a USB transceiver chip, an in-vehicle Ethernet transceiver chip, an ordinary Ethernet transceiver chip, etc. The physical interface may be, for example, a USB interface, an in-vehicle Ethernet interface, an ordinary Ethernet interface, etc. The transceiver chip receives the digital signal provided by the control unit, converts it into a level signal and sends it out through the physical interface, and the receiving chip receives the level signal, converts it into a digital signal and sends it to the control unit. Further, the data processing device may also include one or more interfaces of a CAN interface, a LIN interface, a Flexray interface, a DSI3 interface, and a PSI5 interface, so that the data processing device can be connected to more diverse electronic devices, and correspondingly, the interface module of the data processing device may also be a CAN module, a LIN module, a Flexray module, and the transceiver chip of the interface module may be, for example, a CAN transceiver chip, a LIN transceiver chip, a Flexray transceiver chip, etc.
[0042] Exemplarily, each interface of the data processing device may have a unique interface identifier, so that the interface can be determined based on the interface identifier. For example, the interface identifier may include a type and a serial number, such as USB_0, TX_0, TX_1, T1_0, T1_1, etc.
[0043] The data processing device is used to realize data transmission between the host computer and the real Ethernet device. Considering that the number of interfaces and interface types of the host computer are limited, the Ethernet devices that can be connected are limited. Therefore, in the prior art, an interface card is often used as an interface extension, and its function is generally to forward messages between the host computer and the Ethernet device. In addition to realizing interface extension and message forwarding, the data processing device in the present application also uses the above-mentioned data processing method, which can encapsulate the message of the simulation node sent by the host computer into an Ethernet message frame.
[0044] Exemplarily, a virtual network adapter (Virtual Network Adapter or Virtual NIC) is a software-defined network device that can simulate the functions of a physical network card. Although it is not a physical device, the operating system and application will recognize it as a real physical network card. A virtual network card can be configured with independent MAC address, IP address, subnet mask and other network address information. For example, tap is a virtual network card device that can send and receive data provided by the Linux system. Each virtual network card can have a network card identification number for uniquely identifying the virtual network card, such as a name, number, etc., such as VN01, VN02.
[0045] Exemplarily, the control unit of the data processing device includes a processor and an FPGA, and is provided with a memory. The processor can be a processor chip such as an Intel chip, an ARM chip, etc. that can run an embedded operating system. The processor and the FPGA are connected via a PCIE bus or an Ethernet bus, and the interface module is arranged on the FPGA. The processor runs an embedded operating system, such as a Linux operating system, and the FPGA is used to realize the communication between the processor and each interface module. The data processing device can be a circuit board structure or a box structure. The network protocol stack of the data processing device can be a kernel network protocol stack of the Linux operating system, or a network protocol stack built by coding. As the core of the operating system, the Linux kernel is responsible for memory management, application management, hardware resource management, etc. The kernel network protocol stack of the Linux operating system is a protocol stack in the Linux kernel, which is responsible for network communication and data transmission, and is the core part of realizing Ethernet communication. During the kernel startup process, socket_init() will be executed to complete the initialization of the network protocol stack.
[0046] Exemplarily, the simulation node is predefined, and can also be expressed as a simulation unit, a simulation module, which refers to a node, a unit, or a module that is configured with a corresponding one or a series of messages to be sent. Further, the simulation node can be understood as an abstract concept defined for distinguishing different messages (for example, distinguished by the source of the message, and / or: distinguished by the sending conditions of the message), and the message is sent accordingly, which can help to reasonably and effectively standardize the processing flow of various messages. The simulation node corresponds to at least one message to be sent, and the message of the simulation node is used to simulate the message sent by the Ethernet device. Exemplarily, the host computer predefines one or more simulation nodes, and the user can create a simulation node in the host computer, edit the message of the simulation node, and the number of simulation nodes and the message of each simulation node can be defined according to the data transmission requirements of the user, and each simulation node can have a node identification number for uniquely identifying the simulation node, such as a name, a number, etc. The message of the simulation node can be sent to a data processing device and an Ethernet message frame is generated by the data processing device, and then sent to the Ethernet device. The simulation node may have one or a group of messages to be sent. The message to be edited in the simulation node may be the content of the message manually input by the user, or may be a message recorded in advance by the user, wherein the message recorded in advance may be a message collected and recorded from a real Ethernet device. The messages to be sent of each simulation node may be the same or different.
[0047] The message of the simulation node is sent to the data processing device. In different scenarios, the message of the simulation node can be a message of different purposes, and at least one of testing, calibration, diagnosis, and control of the Ethernet device can be performed. For example, in the test scenario, the message of the simulation node can simulate the vehicle sensor signal to test the Ethernet device; for example, in the control scenario, the message of the simulation node can simulate the electronic control unit signal to control the Ethernet device.
[0048] In Ethernet communication, according to the communication protocol of the data link layer, the Ethernet message frame is the basic unit of data transmission. The Ethernet message frame includes a header, a data segment, and a checksum. The header contains three fields, which are: the destination MAC address, which is 6 bytes long, is used to mark which device receives the Ethernet message frame; the source MAC address, which is 6 bytes long, is used to mark which device sends the Ethernet message frame; the type / length field, which is 2 bytes long, is used to mark the upper layer protocol type used or the data length of the data segment. The upper layer protocol is such as the IP protocol, the ARP protocol, etc. The data segment includes actual data information and can carry multiple types of upper layer protocol data. It is a datagram containing other protocol headers in the Ethernet message frame. For example, when the upper layer protocol is the IP protocol, the data segment is an IP datagram, including actual data information, source IP address, and destination IP address. The checksum is used for error detection. In addition, if the Ethernet message frame contains a VLAN tag, an additional 4 bytes of VLAN tag information are required. Therefore, to construct an Ethernet message frame, in addition to the actual data information, some frame parameters are also required. The frame parameters may include the network address information of the source device, the network address information of the target device, the upper layer protocol type, VLAN tag, etc. The network address information includes at least the MAC address, and may also include the MAC address, IP address, port, etc., which are used to identify the address information of the Ethernet device.
[0049] Exemplarily, the message of the simulation node may include actual data information, as well as frame parameters other than the network address information of the source device. For example, an Ethernet layer 2 packet may be added to the simulation node, and parameters such as the target address, protocol type, and data segment length may be edited or imported to obtain a message to be sent by the simulation node; an IPv4 type packet may be added to the simulation node, and the target MAC address, as well as the target IP, service type, identifier, mark, segment offset, survival time and other parameters required by the IPv4 protocol may be edited or imported to obtain a message to be sent by the simulation node; similarly, a TCP type packet, a UDP type packet, and an ARP type packet may be added to the simulation node, and the corresponding frame parameters may be edited or imported. In addition, if the message of the simulation node is used to simulate the message sent by an Ethernet device using an application layer protocol such as the SomeIP protocol and the DoIP protocol, a message packet may be added to the simulation node, and the corresponding frame parameters may be edited or imported. Since the message of the simulation node will be encapsulated into an Ethernet message frame through the network protocol stack of the data processing device and the virtual network card corresponding to the simulation node, the network address information of the virtual network card can be used as the network address information of the source device. Therefore, the network address information of the source device may not be included in the message to be sent by the simulation node.
[0050] In the prior art, the user creates a simulation node on the host computer and edits the message of the simulation node. Each message includes actual data information and frame parameters for constructing an Ethernet message frame. When the message of the simulation node needs to be sent to an Ethernet device, for each message, the host computer constructs an Ethernet message frame according to the actual data information and frame parameters, and sends the complete Ethernet message frame to the data processing device, which directly sends the Ethernet message frame to the Ethernet device. Each message requires the user to edit the frame parameters, and since the Ethernet message frame is constructed using the network protocol stack of the host computer, there may be problems such as insufficient user authority to call the network protocol stack and IP address conflicts when constructing the Ethernet message frame.
[0051] In the technical solution of the present application, a data processing device receives a message from a simulation node, obtains a virtual network card corresponding to the simulation node, and encapsulates the message from the simulation node into an Ethernet message frame through the network protocol stack of the data processing device and the virtual network card corresponding to the simulation node, wherein the virtual network card is configured with network address information, and the network address information of the virtual network card can be used as the network address information of the source device in the Ethernet message frame, and the message from the simulation node can include actual data information, and frame parameters other than the network address information of the source device. The data processing device encapsulates the received actual data information, frame parameters other than the network address information of the source device, and the network address information of the virtual network card corresponding to the simulation node through its own network protocol stack to obtain an Ethernet message frame.
[0052] On the one hand, by modifying the correspondence between the simulation node and the virtual network card, different network address information can be used as the source device network address information of the Ethernet message frame, which is simpler to operate and does not require users to manually enter lengthy network address information. On the other hand, the work of encapsulating Ethernet message frames is delegated to the data processing device for execution, and the network protocol stack of the data processing device is called, which avoids problems such as insufficient user permissions and IP address conflicts, and can more conveniently realize data transmission from the host computer to the Ethernet device.
[0053] The data processing method further includes: step S300, receiving and executing a network card configuration instruction, the network card configuration instruction including one or more of the following instructions: a network card creation instruction, used to instruct the data processing device to create a virtual network card; a network card deletion instruction, used to instruct the data processing device to delete the virtual network card; a network card modification instruction, used to instruct the data processing device to modify the network address information of the virtual network card. The data processing device executes the network card configuration instruction, and can add, delete, and modify the virtual network card in the data processing device, which is more convenient to use.
[0054] Step S300 can be performed before step S100, that is, the message is sent after the virtual network card of the data processing device is configured, or it can be performed after step S200, and the virtual network card of the data processing device with the latest configuration can be used when sending a message next time.
[0055] The network card configuration instruction may be set by the host computer and sent to the data processing device, or may be sent to the data processing device by a terminal device 400. Figure 5 As shown, the terminal device 400 can be sent to the data processing device via the host computer. In another solution, as shown in Figure 6 As shown, the data processing device is provided with a wireless communication module. At this time, the terminal device 400 can interact with the data processing device through the wireless communication module instead of the host computer, for example, through a local area network and / or the Internet. The wireless communication module can be a wireless communication module of a mobile network such as 4G, 5G, 6G, or a wireless communication module such as Wifi, Bluetooth, etc. In addition, it is not excluded that the data processing device itself is integrated with an input module, which can input network card configuration instructions. The input module is, for example, a keyboard, a touch screen, a touchpad, a brain-computer interface, a pen input, a microphone, a camera, etc.
[0056] Exemplarily, a corresponding relationship is set between the simulation node and the virtual network card, and the corresponding relationship can be set by the user, and one simulation node can correspond to at least one virtual network card. The corresponding relationship between the simulation node and the virtual network card can be recorded through a configuration file, a configuration table, etc. After the virtual network card of the data processing device is modified through the network card configuration instruction, if the virtual network card corresponding to the simulation node is deleted, the virtual network card corresponding to the simulation node can be re-determined.
[0057] In one example, a simulation node may correspond to multiple virtual network cards. The data processing device may use the network address information of the multiple virtual network cards as the network address information of the source device, encapsulate the Ethernet message frames with different network address information of the multiple source devices, and send them to the Ethernet device. Furthermore, the virtual network cards corresponding to the simulation node in different time periods may be different. It can be understood that when sending messages of the simulation node in different time periods, different virtual network cards are used as the source device network address information of the Ethernet message frame. For example, different virtual network cards correspond to different virtual network cards when sending the same message in different time periods. For example, different virtual network cards correspond to different virtual network cards when sending different messages in different time periods.
[0058] In one example, the simulation node may include multiple messages to be sent, each message to be sent may correspond to at least one virtual network card, and the virtual network cards corresponding to different messages may be the same or different, so that the simulation node corresponds to multiple virtual network cards, for example, all messages correspond to the same virtual network card, for example, some messages correspond to virtual network card VN01, and some messages correspond to virtual network card VN02. Furthermore, a message may correspond to different virtual network cards in different time periods, for example, different virtual network cards may correspond to sending the message in different time periods.
[0059] In some application scenarios, in order to achieve continuous and automatic data transmission, you can configure the message sending order between simulation nodes, the sending order of multiple messages of simulation nodes, the number of times each message is sent, the sending interval, and the sending interval between different messages, to achieve cyclic sending of messages and sequential sending of multiple messages. You can also configure one or more sending times for each message, and send the message when the sending time is reached, to achieve cyclic sending of messages and sequential sending of multiple messages. In this scenario, for each simulation node, you can configure the virtual network card corresponding to the simulation node in multiple time periods, or the virtual network card corresponding to each message of the simulation node in multiple time periods, to achieve more flexible data transmission.
[0060] A time period is a time interval, and its start time can be a fixed time, such as a fixed time determined by hours, minutes and seconds. Its start time can be generated according to input or state changes, such as the start time is the time when the mouse clicks a certain area or presses a certain key on the keyboard, such as the start time is 1 second after the last message is sent. A time period can be of fixed length, such as 1 second, that is, it ends after a fixed length of time from the start time. A time period can be of variable length, that is, the length between the end time and the start time of the time period can be determined according to input or state changes, such as the end time is the time when the mouse clicks a certain area or presses a certain key on the keyboard, such as the end time is the time when the message fed back by the Ethernet device is received, etc.
[0061] In one example, the host computer can maintain the correspondence between the simulation node and the virtual network card, and the data processing device receives the message of at least one simulation node and the network card identification information sent from the host computer. The network card identification information is used to instruct the data processing device to determine at least one virtual network card, so that the data processing device can directly obtain the virtual network card corresponding to the simulation node through the network card identification information. Further, the host computer transmits the message of the simulation node to the data processing device, and can simultaneously inform the data processing device of the virtual network card corresponding to the simulation node. The network card identification information includes, for example, a network card identification number. The data processing device determines at least one virtual network card according to the network card identification information. The network card identification information can be sent to the data processing device together with the message of the simulation node, and can be sent to the data processing device before or after the message of the simulation node.
[0062] In one example, the data processing device can maintain the correspondence between the simulation node and the virtual network card. The data processing device receives at least one simulation node message and node identification information sent from the host computer. The node identification information is used to instruct the data processing device to determine a simulation node. The data processing device can determine a simulation node through the node identification information, and determine at least one virtual network card corresponding to the simulation node according to the correspondence between the simulation node and the virtual network card. Further, the host computer transmits the simulation node message to the data processing device, and can send the node identification information to the data processing device at the same time. The node identification information includes, for example, a node identification number. The data processing device determines a simulation node according to the node identification information. The node identification information can be sent to the data processing device together with the simulation node message, and can be sent to the data processing device before or after the simulation node message.
[0063] Exemplarily, the data processing device encapsulates the message of the simulated node into an Ethernet message frame and sends it to the Ethernet device through the Ethernet interface. The data processing device has multiple Ethernet interfaces, and one Ethernet interface can be connected to one Ethernet device. Therefore, the data processing device needs to clearly know which Ethernet device to send the Ethernet message frame to, and the Ethernet device should be able to successfully receive the Ethernet message frame encapsulated by the message of the simulated node.
[0064] In one example, the message of the simulation node includes the network address information of the target device, the target interface is determined according to the network address information of the target device, and the message of the simulation node is encapsulated into an Ethernet message frame and sent through the target interface. For example, the data processing device can obtain the MAC address of the connected Ethernet device and match it with the target MAC address in the message of the simulation node, and determine the Ethernet interface connected to the Ethernet device with the same target MAC address in the message as the target interface.
[0065] In one example, a correspondence is set between the simulation node and the Ethernet interface, which may be set by the user. One simulation node may correspond to at least one Ethernet interface, and the correspondence between the simulation node and the Ethernet interface may be recorded through a configuration file, a configuration table, and the like.
[0066] The simulation node may correspond to an Ethernet interface, and after the message of the simulation node is encapsulated as an Ethernet message frame, it can be sent out through the Ethernet interface corresponding to the simulation node. In a feasible implementation, when editing the message of the simulation node, the host computer can obtain the network address information of the Ethernet device connected to the Ethernet interface corresponding to the simulation node as the network address information of the target device in the message, such as the target MAC address, the target IP address, etc., so that when the message of the simulation node is sent to different Ethernet devices, it is only necessary to modify the Ethernet interface corresponding to the simulation node, and the user does not need to manually modify the network address information of the target device in the message. Of course, it is not ruled out that the user manually modifies the network address information of the target device in the message to send the message of the simulation node to different Ethernet devices.
[0067] The simulation node may include multiple messages to be sent, each message to be sent may correspond to an Ethernet interface, and the Ethernet interfaces corresponding to different messages may be the same or different. For example, all messages correspond to the same Ethernet interface, for example, some messages correspond to Ethernet interface T1_0, and some messages correspond to Ethernet interface T1_1.
[0068] Furthermore, the Ethernet interfaces corresponding to the simulated nodes in different time periods may be different. It can be understood that when sending messages from the simulated nodes in different time periods, the encapsulated Ethernet message frames are sent out through different Ethernet interfaces. For example, different Ethernet interfaces correspond to different messages when they are sent in different time periods.
[0069] It should be noted that if multicast is involved, the target MAC address is no longer a specific receiver, but a group with uncertain members. At this time, the simulation node can correspond to multiple Ethernet interfaces, and a message of the simulation node can correspond to multiple Ethernet interfaces. The data processing device encapsulates the message of the simulation node into an Ethernet message frame and sends it out through multiple simulation nodes.
[0070] Similarly, in the scenario of achieving continuous and automatic data transmission, similar to configuring the virtual network card corresponding to the simulation node in multiple time periods, for each simulation node, it is also possible to configure the Ethernet interface corresponding to the simulation node in multiple time periods, or the Ethernet interface corresponding to each message of the simulation node in multiple time periods, to achieve more flexible data transmission.
[0071] In one example, the host computer can maintain the corresponding relationship between the simulation node and the Ethernet interface, and the host computer can send the message of the simulation node and the sending interface identifier to the data processing device. The data processing device determines at least one sending interface according to the sending interface identifier, and sends the Ethernet message frame through the sending interface. The sending interface identifier can be sent to the data processing device together with the message of the simulation node, and can be sent to the data processing device before or after the message of the simulation node. Among them, the sending interface identifier is used to indicate the Ethernet interface determined to send the Ethernet message frame among the multiple Ethernet interfaces of the data device. For example, the sending interface identifier includes the interface identifier of one or more Ethernet interfaces, indicating that the data processing device sends the Ethernet message frame through the one or more Ethernet interfaces as the sending interface, that is, the Ethernet message frame will be sent to the Ethernet device connected to each sending interface through the sending interface. An Ethernet message frame can be sent to an Ethernet device, then the sending interface identifier includes the interface identifier of an Ethernet interface, and an Ethernet message frame can be sent to multiple Ethernet devices, then the sending interface identifier includes the identifiers of multiple Ethernet interfaces. In addition, different messages of a simulation node, or multiple messages of different simulation nodes, may use the same sending interface identifier, indicating that the multiple messages are encapsulated into Ethernet message frames and then transmitted to the same Ethernet device.
[0072] In one example, the data processing device can maintain the correspondence between the simulation node and the Ethernet interface, the data processing device receives at least one simulation node message and node identification information sent from the host computer, the node identification information is used to instruct the data processing device to determine a simulation node, the data processing device can determine a simulation node through the node identification information, and determine at least one Ethernet interface corresponding to the simulation node according to the correspondence between the simulation node and the Ethernet interface. Further, the host computer transmits the message of the simulation node to the data processing device, and can send the node identification information to the data processing device at the same time, the node identification information includes, for example, a node identification number, the data processing device determines a simulation node according to the node identification information, the node identification information can be sent to the data processing device together with the message of the simulation node, and can be sent to the data processing device before or after the message of the simulation node.
[0073] Exemplarily, the corresponding relationship between the simulation node and the Ethernet interface, and the corresponding relationship between the simulation node and the virtual network card, can be established in the host computer. For example, the host computer obtains all virtual network cards of the data processing device, and establishes the corresponding relationship between the simulation node and the virtual network card. For example, the host computer obtains all Ethernet interfaces of the data processing device, and establishes the corresponding relationship between the simulation node and the Ethernet interface. In addition, the corresponding relationship between the simulation node and the Ethernet interface, and the corresponding relationship between the simulation node and the virtual network card can also be directly established by the user, recorded in the form of configuration files, configuration tables, etc., and sent to the host computer and / or the data processing device.
[0074] In one example, establishing a correspondence between a simulation node and an Ethernet interface in a host computer can be as follows: the host computer obtains all Ethernet interfaces of a data processing device, creates at least one logical port, and establishes a correspondence between the logical port and the Ethernet interface, for example, one logical port corresponds to one Ethernet interface; the host computer obtains the defined simulation node, establishes a mapping relationship between the simulation node and the logical port, for example, one simulation node corresponds to one logical port, thereby establishing a correspondence between the simulation node and the Ethernet interface.
[0075] The number of logical ports is configured by the user. It is the port abstracted from the application running on the host computer. The mapping of logical ports to Ethernet interfaces is actually the mapping between the application running on the host computer and the data processing device. It can realize the abstraction of resources, make the development and maintenance of applications more flexible and efficient, improve the scalability and maintainability of the system as a whole, and allow the replacement and upgrading of data processing devices without changing the application. In addition, in addition to configuring logical ports of Ethernet type, you can also configure logical channels of CAN, LIN, flexray, etc.
[0076] In one example, there is a corresponding relationship between the Ethernet interface of the data processing device and the virtual network card, the virtual network card corresponds to one Ethernet interface, and one Ethernet interface can correspond to one or more virtual network cards. Furthermore, the host computer can connect to the data processing device and read all Ethernet interfaces of the data processing device, check the virtual network cards corresponding to each Ethernet interface, and when the network card configuration instruction is sent to the data processing device through the host computer, the network card configuration instruction can be issued for each Ethernet port to add, modify or delete the virtual network card for each Ethernet port.
[0077] Thus, the correspondence between the simulation node and the virtual network card can be established in the upper computer as follows: the upper computer obtains all Ethernet interfaces of the data processing device, creates at least one logical port, and establishes a correspondence between the logical port and the Ethernet interface, for example, one logical port corresponds to one Ethernet interface; the upper computer obtains the defined simulation node, establishes a mapping relationship between the simulation node and the logical port, for example, one simulation node corresponds to one logical port, thereby establishing a correspondence between the simulation node and the Ethernet interface; obtains all virtual network cards corresponding to the Ethernet interface corresponding to the simulation node, and selects at least one virtual network card from them as the virtual network card corresponding to the simulation node, thereby establishing a correspondence between the simulation node and the virtual network card. That is, the correspondence between the simulation node and the virtual network card includes the correspondence between the simulation node and the logical port, the correspondence between the logical port and the Ethernet interface, and the correspondence between the Ethernet interface and the virtual network card.
[0078] A corresponding relationship is established between the simulation node and the logical port, a corresponding relationship is established between the logical port and the Ethernet interface, and a corresponding relationship is established between the Ethernet interface and the virtual network card. Thus, a corresponding relationship between the simulation node and the virtual network card can be established, and the corresponding relationship between the simulation node, the Ethernet interface and the virtual network card is unified, so that the virtual network card selected when sending a message from the simulation node is the virtual network card of the Ethernet interface corresponding to the simulation node. There is no need to separately set the corresponding relationship between the simulation node and the Ethernet interface, and the corresponding relationship between the simulation node and the virtual network card, which makes it more convenient for users to use.
[0079] An embodiment of the present application also provides a data processing device, in which at least one virtual network card is pre-set, and the virtual network card is configured with network address information. The data processing device is configured to: receive a message from at least one simulation node sent from a host computer, obtain the virtual network card corresponding to the simulation node, encapsulate the message of the simulation node into an Ethernet message frame through the network protocol stack of the data processing device and the virtual network card corresponding to the simulation node, and send the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device; wherein the simulation node is predefined, corresponding to at least one message to be sent, and a corresponding relationship is set between the simulation node and the virtual network card.
[0080] Exemplarily, the data processing device also includes at least one synchronization interface, which is used to connect to a timing device or a data processing device. The data processing device is configured to transmit time synchronization messages between the data processing device and the connected timing device or data processing through the synchronization interface, so that the data processing device and the connected timing device or data processing are synchronized through a time synchronization protocol.
[0081] Exemplarily, the time synchronization protocol is a time synchronization protocol such as PTP (Precision Time Protocol), gPTP (Generalized Precision Time Protocol), etc., which can achieve high-precision time synchronization. The synchronization interface can be a common Ethernet interface, that is, the common Ethernet interface can be connected to an Ethernet device, and can also be connected to a synchronization interface of a timing device or another data processing device. Time synchronization can be performed between a timing device and a data processing device, and between data processing devices and data processing devices through a time synchronization protocol.
[0082] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof, and implement the above data processing method. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0083] An embodiment of the present application provides a data transmission system, including a host computer and the above-mentioned data processing device, wherein at least one virtual network card is pre-set in the data processing device, and the virtual network card is configured with network address information. The host computer pre-defines at least one simulation node for sending messages of at least one simulation node from the host computer to the data processing device; the data processing device is used to receive messages of at least one simulation node sent from the host computer, obtain the virtual network card corresponding to the simulation node, encapsulate the messages of the simulation node into Ethernet message frames through the network protocol stack and the virtual network card corresponding to the simulation node, and send the Ethernet message frames to the Ethernet device through the Ethernet interface of the data processing device.
[0084] For example, Figure 7As shown, the data transmission system includes multiple data processing devices, which are cascaded, that is, connected in sequence. By transmitting synchronization messages, multiple data processing devices transmit time synchronization messages to achieve time synchronization. Each data processing device can be connected to one or more Ethernet devices respectively, and some or all of the data processing devices in the cascaded multiple data processing can be connected to the host computer. Multiple data processing devices connected to the host computer are synchronized by time synchronization protocol. When these data processing devices send device data to the host computer and send messages of simulation nodes in the host computer to the Ethernet device, they can be performed in the same time coordinate system, avoiding the problem of inconsistent clocks. For example, during testing, calibration, and diagnosis, the data processing device sends messages of simulation nodes in the host computer to the Ethernet device. If the messages of the simulation nodes need to be sent regularly or need to be sent at a specified time, the clocks of each data processing device are fast or slow, and the clock accuracy is different, which will affect the sending of messages of the simulation nodes. For example, when a data processing device receives a message from an Ethernet device and sends it to a host computer, the data processing device adds a timestamp when receiving the message from the Ethernet device. If time synchronization is not performed, each data processing device adds a timestamp according to its own clock. Since the clocks of each data processing device are fast or slow, the host computer cannot accurately determine the time when the message of each Ethernet device is received by the data processing device. Therefore, when using multiple data processing devices, it is crucial to use a time synchronization protocol to allow multiple data processing devices to work with reference to the same time reference for data reception, processing, transmission, and control of the data processing devices.
[0085] Furthermore, if Figure 8 As shown, among the multiple cascaded data processing devices, one data processing device is connected to the timing device 500, for example, the data processing device at the head or tail position is connected to the timing device 500. The timing device 500 can provide standard time, so that the data processing devices can achieve time synchronization with the timing device 500, that is, the data processing devices all work with reference to the clock of the timing device 500. On the one hand, when the clock accuracy of the data processing device itself is not high enough, the timing device 500 can provide higher time accuracy. On the other hand, the time provided by the timing device 500 can be Coordinated Universal Time (UTC). When the data processing device needs to add a timestamp to the device data, the timestamp under UTC can be obtained, which is convenient for subsequent analysis and processing of the data.
[0086] Among them, the timing device 500 can be a clock source such as an RTK / GPS device, or can be a computer. In one example, the timing device 500 is a host computer connected to a data processing device, that is, the host computer can perform time synchronization with the data processing device through a time synchronization protocol via an ordinary Ethernet interface. At the same time, the synchronization interface can only transmit messages used for time synchronization, and can also serve as a host computer interface at the same time to realize the transmission of other data between the host computer and the data processing device except time synchronization messages.
[0087] Exemplarily, the host computer sends the message to the data processing device when the message sending condition of one or a group of messages of the simulation node is met, and the data processing device encapsulates the message into an Ethernet message frame and sends it to the Ethernet device, that is, the host computer determines when the message is sent, and the data processing device only needs to receive the message transmitted by the host computer and encapsulate and send it. In another example, the host computer sends the message of the simulation node to the data processing device, and the data processing device encapsulates the message into an Ethernet message frame and sends it to the Ethernet device when the message sending condition of one or a group of messages of the simulation node is met, that is, the data processing device determines when the Ethernet message frame is sent, and the data processing device needs to receive the message transmitted by the host computer, and determines whether the message sending condition is met, and encapsulates and sends when the message sending condition is met. In other examples, the host computer can also determine when the message of some simulation nodes is sent and send it to the data processing device, the data processing device receives the message and encapsulates and sends it, and the data processing device determines when the message of some simulation nodes is sent and encapsulates and sends it.
[0088] In one example, for multiple simulation nodes, the judgment of whether the message meets the message sending condition and the sending are independent and executed in parallel. The host computer or data processing device can construct a processing unit for each simulation node, and each processing unit can execute its own message sending in parallel (including judging whether the message sending condition is met, and the message sending after meeting, Ethernet message frame sending), and further, each processing unit can be allocated to use processing resources (such as processor resources and memory resources, and interface resources) or its priority can be pre-configured, and can also be dynamically adjusted. In addition, if a simulation node is newly created during the target processing, a corresponding processing unit can also be newly created, and the resources of each created processing unit are redistributed. In another example, the corresponding relationship between the simulation node and the constructed processing unit can also be non-one-to-one, for example, multiple simulation nodes may correspond to one processing unit, and the corresponding relationship can be established according to the model complexity of the simulation node, and the model complexity is, for example, the total number of messages to be sent.
[0089] In addition, when allocating resources for each processing unit, allocation can be made based on at least one of the following factors of the simulation node corresponding to each processing unit: data volume, priority; based on data volume, it helps to give more resources to the processing work of the simulation node with a larger data volume processing demand; the priority can be the priority of the Ethernet device simulated by the message of the simulation node, which can be set manually. For example, the message of simulation node 1 simulates the message sent by ECU1, and the message of simulation node 2 simulates the message sent by ECU2. Simulation node 1 has a higher priority, which can help to give more resources to more important objects.
[0090] In one example, a message or a group of messages of a simulation node has a corresponding message sending condition, and the message sending condition is, for example, at least one of reaching the sending time and receiving the start sending instruction. For example, the start sending time is set for the message, and when the time reaches the set start sending time, the message and Ethernet message frame are started to be sent, wherein the host computer or the data processing device determines whether the time reaches the set start sending time according to its local clock. For example, after receiving the start sending instruction, the message and Ethernet message frame are started to be sent, wherein the receiving start sending instruction can be triggered by a button, a mouse, a touch screen, etc., or can be triggered by an executable program, and the executable program is, for example, a timer, which controls the timing and cyclic sending of the message. For example, when the start sending instruction is received and the time reaches the set start sending time, the message is started to be sent. For example, when the start sending instruction is received and the time reaches the set start sending time, the message is started to be sent. For example, when the start sending instruction is received, or when the time reaches the set start sending time, the message is started to be sent.
[0091] The present application also provides a data transmission method, which is applied to the above-mentioned data transmission system. Fig. 9 As shown, including:
[0092] Step S1, obtaining mapping information of the simulation node, where the mapping information is at least used to indicate the corresponding relationship between the simulation node and the virtual network card set in the data processing device;
[0093] Step S2, sending a message of at least one simulation node from the host computer to the data processing device;
[0094] Step S3, the data processing device receives a message from at least one simulation node sent from the upper computer, obtains the virtual network card corresponding to the simulation node, encapsulates the message of the simulation node into an Ethernet message frame through the network protocol stack and the virtual network card corresponding to the simulation node, and sends the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device.
[0095] Among them, in step S1, the mapping information between the simulation node and the virtual network card is obtained. The corresponding relationship between the simulation node and the virtual network card can be established in the host computer as the mapping information, or the corresponding relationship between the simulation node and the virtual network card can be established externally as the mapping information and sent to the host computer and / or the data processing device.
[0096] Exemplarily, establishing a correspondence between a simulation node and a virtual network card on a host computer can be as follows: connecting the host computer to a data processing device, reading all Ethernet interfaces of the data processing device through the host computer, reading the virtual network cards corresponding to each Ethernet interface, and checking whether the Ethernet interface has a corresponding virtual network card, the number of corresponding virtual network cards, and the network information of the corresponding virtual network card. It is also possible to add, modify or delete virtual network cards for some or all Ethernet interfaces of the data processing group device through network card configuration instructions; creating at least one logical port on the host computer, and establishing a correspondence between the logical port and the Ethernet interface, for example, one logical port corresponds to one Ethernet interface; the host computer obtains the defined simulation node, and establishes a mapping relationship between the simulation node and the logical port, for example, one simulation node corresponds to one logical port, thereby establishing a correspondence between the simulation node and the Ethernet interface; obtaining all virtual network cards corresponding to the Ethernet interface corresponding to the simulation node, and selecting at least one virtual network card from them as the virtual network card corresponding to the simulation node, thereby establishing a correspondence between the simulation node and the virtual network card. That is, the user can create mapping information of the simulation node on the host computer. When the message corresponding to the simulation node on the host computer is sent to the data processing device, the mapping information of the simulation node can be obtained. The mapping information of the simulation node may include: the correspondence between the simulation node and the logical port, the correspondence between the logical port and the Ethernet interface, and the correspondence between the Ethernet interface and the virtual network card.
[0097] In one example, different users have different user identifiers, and the mapping information also includes user information, and the user information includes one or more user identifiers, which are used to identify one or a group of users. That is, mapping information with different user information can be established. When different users send messages corresponding to the simulation nodes on the host computer to the data processing device, the mapping information available to each user can be determined based on the user's user identifier and the user information of each mapping information. As a result, the foundation is improved for the common operation of multiple users sending messages of simulation nodes to the data processing device through the host computer. Different users can establish mapping information separately, and when different users send messages to the data processing device, they can send them according to different mapping information. The different users here can be users with different accounts and different user names.
[0098] Exemplarily, the data transmission method further includes: receiving, by the data processing device, an Ethernet message frame sent from an Ethernet device, and sending the Ethernet message frame to a host computer.
[0099] Among them, the data processing device can parse the Ethernet message frame through the network protocol stack to obtain actual data information and frame parameters, and send the actual data information and frame parameters to the host computer, or it can send the received Ethernet message frame directly to the host computer, and the host computer will use its own network protocol stack to parse it.
[0100] Exemplarily, before the Ethernet message frame sent by the Ethernet device is sent to the host computer, the method further includes: filtering the received Ethernet message frame according to the preset data upload condition to obtain the message frame to be sent. The data upload condition can be sent to the data processing device through the host computer or the terminal device, and different data upload conditions can be configured for different time periods.
[0101] In one example, during testing or acquisition, the user may be interested in the Ethernet message frames of some or all Ethernet devices. In the prior art, all Ethernet message frames are sent to the host computer through the interface card, and the host computer screens and filters them, and then displays, analyzes and stores them. In the embodiment of the present application, the data processing device sends the Ethernet message frames to the host computer, and the Ethernet message frames sent to the host computer can be filtered and screened by setting the data upload conditions, retaining the data of interest, avoiding unnecessary data from participating in the transmission, and reducing the data transmission pressure between the data processing device and the host computer, saving resources.
[0102] In one example, the factors considered in the data upload condition may include at least one of the following: the Ethernet interface receiving the Ethernet message frame; the data content of the Ethernet message frame; the timestamp information of the Ethernet message frame. For example, one or more Ethernet message frames received by the Ethernet interface can be retained or filtered according to the interface type and interface identifier of the Ethernet interface receiving the Ethernet message frame; the Ethernet message frames whose data content falls within a preset data range can be retained or filtered according to the data content of the Ethernet message frame; the Ethernet message frames whose timestamp falls within a preset time range can be retained or filtered according to the timestamp of the Ethernet message frame. In addition, the data upload condition can also be set according to other considerations to filter and screen the Ethernet message frames sent to the host computer. For example, one or more Ethernet messages can be retained or filtered according to whether the Ethernet message carries a VLAN tag and the value of the VLAN number in the VLAN tag.
[0103] The Ethernet message frame is a complete message, and the data content is, for example, the data segment in the message, that is, the actual data information. For example, the Ethernet message frame is a radar signal, and the data content is a radar point cloud; the data content is, for example, the frame parameters in the message, such as the target MAC address, source MAC address, VLAN number, priority and other frame parameters. The timestamp can be the timestamp of the Ethernet message frame itself, such as the timestamp of the radar collecting point cloud data in the point cloud data output by the radar, and the timestamp can be the timestamp added to the device data when the data processing device receives the Ethernet message frame.
[0104] In one example, the data upload condition may include multiple consideration factors, and the multiple consideration factors are combined through logical AND, logical OR, or logical NOT.
[0105] Exemplarily, before sending the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device, it also includes: obtaining a fault injection instruction, modifying the Ethernet message frame according to the fault injection instruction, and / or modifying the sending time of the Ethernet message frame according to the fault injection instruction, and the fault injection instruction is at least used to indicate at least one of the following: sending the Ethernet message frame in advance; delaying the sending of the Ethernet message frame; modifying the data content of the Ethernet message frame.
[0106] In addition to realizing data interaction between the host computer and Ethernet devices and data interaction between Ethernet devices, the data processing device can also realize fault injection. After fault injection, the Ethernet device receives messages with incorrect content, advanced or delayed time, so as to perform fault testing on the Ethernet device.
[0107] The fault injection instruction is used to indicate the fault added to the Ethernet message frame, including adjusting the data content and / or sending time of the Ethernet message frame. The data content of the Ethernet message frame can be the actual data content, or it can be a frame parameter, or it can be the actual data content and frame parameter. By adjusting the data content and sending time according to the fault injection instruction, the fault of incorrect message content and incorrect sending time can be simulated. The fault injection instruction can be sent to the data processing device through the host computer or the terminal device, and the fault injection instructions for different time periods can be different.
[0108] When the data processing device encapsulates the message of the simulation node into an Ethernet message frame and sends it to the Ethernet device, it adds faults according to the fault injection instruction, which can simulate faults such as message content error, premature transmission, delayed transmission, etc., so that the Ethernet device can be fault tested without generating fault messages of data memory errors on the upper computer or adjusting the timing of message transmission on the upper computer.
[0109] The message of the simulation node in the host computer is sent to the data processing device. In order to realize fault injection, under one scheme, the message sending conditions and message content of the simulation node can be controlled so that the host computer data itself is used as a fault message, for example, the data segment of the message sent by the simulation node is an erroneous data content, such as adjusting the time when the simulation node sends the host computer data to the data processing device, etc. The data processing device only needs to receive the host computer data, determine the Ethernet interface and mode. Under another scheme, the message of the simulation node can be a message of a normally working Ethernet device, and the data processing device performs fault injection. In this way, the simulation node can directly import the message transmitted by the normal Ethernet device recorded by the event and send it to the data processing device according to the recorded sending interval, without the need to control the message sending time of the simulation node and adjust the message of the simulation node on the host computer. For users, the operation is simpler and more convenient.
[0110] In one example, the fault injection instructions are applied to at least one Ethernet interface.
[0111] There may be multiple fault injection instructions. The fault injection instruction may be abstract, for example, the fault injection instruction is: delay Ethernet message frame, then the data processing device may randomly determine a delay time, or select a delay time within a predefined delay time range and execute, for example, the fault injection instruction is: modify the data content of the message, then the data processing device may randomly modify the data content. The fault injection instruction may be specific, for example, the fault injection instruction is: delay the Ethernet message frame by 100ms to send, for example, the fault injection instruction is: modify the VLAN number of the Ethernet message frame to 1.
[0112] A fault injection instruction can be applied to one or more Ethernet interfaces. Exemplarily, the fault injection instruction can correspond to the Ethernet interface, and one fault injection instruction corresponds to one or more Ethernet interfaces, that is, the Ethernet message frame sent through the Ethernet interface is fault-injected according to the fault injection instruction corresponding to the Ethernet interface.
[0113] The embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0114] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.
[0115] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0116] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0117] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0118] The above is a detailed introduction to a data processing method, a data processing device and a data transmission system, a data transmission method and a storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data processing method, characterized in that: Applied to a data processing device, wherein at least one virtual network card is pre-set in the data processing device, and the virtual network card is configured with network address information, the data processing method comprises: Receive a message from at least one simulation node sent from the host computer, obtain a virtual network card corresponding to the simulation node, encapsulate the message of the simulation node into an Ethernet message frame through the network protocol stack of the data processing device and the virtual network card corresponding to the simulation node, and send the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device; The simulation node is predefined and corresponds to at least one message to be sent, and a corresponding relationship is set between the simulation node and the virtual network card.
2. The data processing method according to claim 1, characterized in that: Also includes: Receive and execute network card configuration instructions, wherein the network card configuration instructions include one or more of the following instructions: A network card creation instruction, used to instruct the data processing device to create a virtual network card; A network card deletion instruction, used to instruct the data processing device to delete the virtual network card; The network card modification instruction is used to instruct the data processing device to modify the network address information of the virtual network card.
3. The data processing method according to claim 1, characterized in that: The data processing device has multiple Ethernet interfaces, and the data processing device sends Ethernet message frames to Ethernet devices through the Ethernet interfaces corresponding to the simulation nodes; wherein a corresponding relationship is set between the simulation nodes and the Ethernet interfaces.
4. The data processing method according to claim 1, characterized in that: The simulation node corresponds to at least one virtual network card, and the simulation node corresponds to different virtual network cards in different time periods.
5. The data processing method according to claim 1, characterized in that: Obtaining the virtual network card corresponding to the simulation node includes: the data processing device receives a message of at least one simulation node and network card identification information sent from the host computer, and determines at least one virtual network card according to the network card identification information, wherein the network card identification information is used to instruct the data processing device to determine at least one virtual network card.
6. The data processing method according to claim 1, characterized in that: The data processing device stores the correspondence between the simulation node and the virtual network card set in the data processing device. Obtaining the virtual network card corresponding to the simulation node includes: the data processing device receives a message of at least one simulation node and node identification information sent from a host computer, and determines at least one virtual network card according to the node identification information, the correspondence between the simulation node and the virtual network card, and the node identification information is used to instruct the data processing device to determine a simulation node.
7. A data processing device, characterized in that: Used to implement the data processing method as described in any one of claims 1-6.
8. A data transmission system, characterized in that: comprising a host computer and the data processing device as claimed in claim 7; The host computer predefines at least one simulation node, and is used to send a message of at least one simulation node from the host computer to the data processing device; The data processing device is used to receive a message from at least one simulation node sent from a host computer, obtain a virtual network card corresponding to the simulation node, encapsulate the message of the simulation node into an Ethernet message frame through a network protocol stack and the virtual network card corresponding to the simulation node, and send the Ethernet message frame to an Ethernet device through the Ethernet interface of the data processing device.
9. A data transmission method, characterized in that: Applied to the data transmission system according to claim 8, the data transmission method comprises: Acquire mapping information of the simulation node, where the mapping information is at least used to indicate a corresponding relationship between the simulation node and a virtual network card set in the data processing device; Sending a message of at least one simulation node from the host computer to the data processing device; The data processing device receives a message from at least one simulation node sent from a host computer, obtains the virtual network card corresponding to the simulation node, encapsulates the message of the simulation node into an Ethernet message frame through the network protocol stack and the virtual network card corresponding to the simulation node, and sends the Ethernet message frame to the Ethernet device through the Ethernet interface of the data processing device.
10. The data transmission method according to claim 9, characterized in that: The data processing device has a plurality of Ethernet interfaces, and the mapping information of the simulation node includes: The correspondence between simulation nodes and logical ports, the correspondence between logical ports and Ethernet interfaces, and the correspondence between Ethernet interfaces and virtual network cards.
11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Configuration information synchronization method and device, storage medium and electronic equipment
CN119854320A