Multi-core virtual Ethernet data interaction system, data interaction method and multi-core chip
Virtual Ethernet technology is used to realize cross-core data exchange on multi-core chips, which solves the problem of insufficient Ethernet driver hardware resources of in-vehicle multi-core SOC chips, improves the data exchange rate and communication quality, and is suitable for in-vehicle intelligent network connection and intelligent driving. field.
Patent Information
- Application Number
- CN202410793646.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-19
AI Technical Summary
The single Ethernet network card Ethernet driver hardware resources of the vehicle multi-core SOC chip cannot meet the Ethernet network communication needs of the entire vehicle, and when data interaction in the field of intelligent network connection and intelligent driving, the existing technology cannot meet the requirements of high real-time performance and low delay. communication needs.
Through virtual Ethernet technology, shared memory transmission modules and multi-core chips are used to set up virtual Ethernet driver modules and inter-core interaction driver modules to achieve multi-core cross-core inter-core data interaction, reduce the cost of Ethernet driver hardware resources, and improve the data interaction rate and Communication quality.
The Ethernet driver hardware resource cost of multi-core chips is reduced, the data exchange rate is increased, and the communication quality is improved. It is adapted to MCU and MPU cores, has strong compatibility, and is suitable for vehicle-mounted Ethernet communication systems.
Smart Images

Figure CN118802416A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a multi-core virtual Ethernet data interaction system, a data interaction method and a multi-core chip. Background Art
[0002] In-vehicle Ethernet is a new local area network communication technology used in electronic control units in automobiles. With its significant advantages such as high bandwidth, good maturity, and fast communication, it is widely used in technical fields such as smart cars and intelligent networking. At the same time, as the automotive electronic and electrical architecture tends to develop towards regional architecture and central computing domain architecture, core controllers with highly integrated functions are more widely used. For this reason, multi-core SOC (System on Chip) is widely used in intelligent in-vehicle computing platform systems such as intelligent driving and intelligent cockpits with its unique advantages of high integration and integration. The commonly used basic architecture of in-vehicle Ethernet is composed of MAC (Media Access Control), PHY (Physical Layer) chip and upper protocol stack transmission link. It currently mainly supports bandwidths of 10M, 100M, 1G, and even 10G bandwidth, and is being used in the field of intelligent driving. The main automotive physical layer technical standards involved are 100BASE-T1 and 1000BASE-T1. This type of in-vehicle Ethernet communication needs to be implemented based on the hardware 10Mbps / 100Mbps / 1000Mbps Ethernet network card driver when processing physical layer data, and is therefore limited by the network card Ethernet driver hardware resources that the SOC chip can support.
[0003] For multi-core SOC chips in vehicles, the hardware resources of a single Ethernet network card and Ethernet driver can no longer meet the Ethernet network communication needs of the entire vehicle. At the same time, the mainstream data interaction technology in the field of intelligent networking and intelligent driving is based on vehicle Ethernet. If Ethernet network communication in more application scenarios is required, it is necessary to add Ethernet network cards, which increases the cost of SOC. In addition, some SOC chips currently do not support Ethernet network card interfaces, so USB or other interface configurations are used to replace Ethernet network card interfaces. However, this method has problems such as low communication rate and cannot meet the communication needs of high real-time and low latency of vehicle data.
[0004] It should be noted that the information disclosed in the background technology section of the invention is only intended to deepen the understanding of the general background technology of the invention, and should not be regarded as an admission or suggestion in any form that the information constitutes prior art already known to those skilled in the art. Summary of the invention
[0005] The purpose of the present invention is to provide a multi-core virtual Ethernet data interaction system, a data interaction method and a multi-core chip, which can realize multi-core cross-core and inter-core data interaction through virtual Ethernet, reduce the Ethernet driver hardware resource cost of the multi-core chip, and effectively improve the data interaction rate and communication quality.
[0006] To achieve the above object, the present invention provides a multi-core virtual Ethernet data interaction system, comprising a shared memory transmission module and at least two cores;
[0007] One of the cores is configured as a core node of a virtual Ethernet interactive system, and the remaining cores are configured as remote nodes of the virtual Ethernet interactive system;
[0008] The shared memory transmission module is configured to allocate a corresponding shared memory space to each pair of the remote node and the core node for data interaction, and manage the shared memory space;
[0009] The core node includes a first driver layer, a first Ethernet protocol stack and a first application layer;
[0010] The remote node includes a second driver layer, a second Ethernet protocol stack and a second application layer;
[0011] The first driver layer includes a first virtual Ethernet driver module and a first inter-core interaction driver module, the second driver layer includes a second virtual Ethernet driver module and a second inter-core interaction driver module, the first virtual Ethernet driver module and the second virtual Ethernet driver module are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, and the first inter-core interaction driver module and the second inter-core interaction driver module are configured to read or write Ethernet data in the corresponding shared memory space.
[0012] Optionally, the virtual Ethernet interaction system also includes a built-in switch and an external switch, the first driver layer also includes a UDMA driver module, the built-in switch is connected to the external switch, the external switch is configured to receive Ethernet data from an external Ethernet node or an external diagnostic device and transmit it to the built-in switch, or transmit the Ethernet data to the corresponding external Ethernet node or external diagnostic device; the UDMA driver module is configured to read Ethernet data from the built-in switch, or transmit Ethernet data to the built-in switch.
[0013] Optionally, the core node further includes a first virtual Ethernet interface module disposed between the first driver layer and the first Ethernet protocol stack, and the first virtual Ethernet interface module is configured to provide a unified Ethernet network interface.
[0014] Optionally, the remote node further includes a second virtual Ethernet interface module disposed between the second driver layer and the second Ethernet protocol stack, and the second virtual Ethernet interface module is configured to provide a unified Ethernet network interface.
[0015] To achieve the above object, the present invention also provides a multi-core virtual Ethernet data interaction method, the data interaction method comprising:
[0016] The first inter-core interaction driving module in the core node writes the first Ethernet data into the corresponding shared memory space;
[0017] The second inter-core interaction driving module in the remote node reads the first Ethernet data from the shared memory space;
[0018] The second virtual Ethernet driver module in the remote node transmits the first Ethernet data to the second Ethernet protocol stack in the remote node for processing;
[0019] The second Ethernet protocol stack in the remote node transmits the processed first Ethernet data to the second application layer in the remote node.
[0020] Optionally, the data interaction method further includes:
[0021] The second inter-core interaction driver module in the remote node writes the second Ethernet data sent sequentially through the second application layer, the second Ethernet protocol stack and the second virtual Ethernet driver module into the shared memory space;
[0022] The first inter-core interaction driving module in the core node reads the second Ethernet data from the shared memory space;
[0023] The UDMA driver module in the core node sends the second Ethernet data to the built-in switch, and transmits the second Ethernet data to the corresponding external Ethernet node or external diagnostic device through the external switch.
[0024] Optionally, the data interaction method further includes:
[0025] The UDMA driver module in the core node receives third Ethernet data uploaded from an external Ethernet node or an external diagnostic device through an external switch and a built-in switch in sequence;
[0026] The first virtual Ethernet driver module in the core node transmits the third Ethernet data to the first virtual Ethernet interface module and the first Ethernet protocol stack in the core node in sequence for processing to obtain the first Ethernet data.
[0027] To achieve the above object, the present invention also provides a multi-core virtual Ethernet data interaction method, the data interaction method comprising:
[0028] The first inter-core interaction driver module in the core node reads the fourth Ethernet data from the first shared memory space, and copies the fourth Ethernet data to the second shared memory space, wherein the first shared memory space is a shared memory space for data interaction between the core node and the first remote node, the second shared memory space is a shared memory space for data interaction between the core node and the second remote node, and the fourth Ethernet data is written into the first shared memory space by the second inter-core interaction driver module in the first remote node;
[0029] The second inter-core interaction driving module in the second remote node reads the fourth Ethernet data from the second shared memory space;
[0030] The second virtual Ethernet driver module in the second remote node transmits the fourth Ethernet data to the second Ethernet protocol stack in the second remote node for processing;
[0031] The second application layer in the second remote node receives the processed fourth Ethernet data.
[0032] To achieve the above object, the present invention further provides a multi-core chip, the multi-core chip comprising a shared memory transmission module and at least two cores, one of the cores being configured as a core node of a virtual Ethernet interactive system, and the remaining cores being configured as remote nodes of the virtual Ethernet interactive system;
[0033] The shared memory transmission module is configured to allocate a corresponding shared memory space to each pair of the remote node and the core node for data interaction, and manage the shared memory space;
[0034] The core node includes a first driver layer, a first Ethernet protocol stack and a first application layer;
[0035] The remote node includes a second driver layer, a second Ethernet protocol stack and a second application layer;
[0036] The first driver layer includes a first virtual Ethernet driver module and a first inter-core interaction driver module, the second driver layer includes a second virtual Ethernet driver module and a second inter-core interaction driver module, the first virtual Ethernet driver module and the second virtual Ethernet driver module are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, and the first inter-core interaction driver module and the second inter-core interaction driver module are configured to read or write Ethernet data in the corresponding shared memory space.
[0037] Optionally, the multi-core chip also includes a built-in switch, and the first driver layer also includes a UDMA driver module. The built-in switch is configured to be connected to an external switch and receive Ethernet data from an external Ethernet node or an external diagnostic device transmitted by the external switch, or transmit the Ethernet data to a corresponding external Ethernet node or external diagnostic device through the external switch; the UDMA driver module is configured to read Ethernet data from the built-in switch, or transmit Ethernet data to the built-in switch.
[0038] Compared with the prior art, the multi-core virtual Ethernet data interaction system, data interaction method and multi-core chip provided by the present invention have the following beneficial effects:
[0039] The multi-core virtual Ethernet data interaction system provided by the present invention comprises a shared memory transmission module and at least two cores; one of the cores is configured as a core node of the virtual Ethernet interaction system, and the remaining cores are configured as remote nodes of the virtual Ethernet interaction system; the shared memory transmission module is configured to allocate corresponding shared memory space for each pair of the remote node and the core node for data interaction, and manage the shared memory space; the core node comprises a first driver layer, a first Ethernet protocol stack and a first application layer; the remote node comprises a second driver layer, a second Ethernet protocol stack and a second application layer; the first driver layer comprises a first virtual Ethernet driver module and a first inter-core interaction driver module, the second driver layer comprises a second virtual Ethernet driver module and a second inter-core interaction driver module, the first virtual Ethernet driver module and the second virtual Ethernet driver module are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, and the first inter-core interaction driver module and the second inter-core interaction driver module are configured to read or write Ethernet data in the corresponding shared memory space. Thus, the multi-core virtual Ethernet data interaction system provided by the present invention is provided with a virtual Ethernet driver module and an inter-core interaction driver module in the driver layer of each core of the multi-core chip, and a shared memory space that can be accessed by both nodes is allocated to each pair of remote nodes and core nodes for data interaction through a shared memory transmission module, so that multi-core cross-core inter-core data interaction can be realized through virtual Ethernet, and then the Ethernet driver hardware resource cost of the multi-core chip can be reduced, and the data interaction rate and communication quality can be effectively improved. Since virtual Ethernet is implemented by pure software, it is reusable, portable and highly compatible, and is adapted to MCU (Micro Controller Unit, microcontroller unit) core and MPU (Micro Processor Unit, microprocessor) core, reducing the cost of code duplication development. At the same time, since the implementation of virtual Ethernet does not need to rely on hardware Ethernet network card resources, the Ethernet driver hardware resource cost and dependence degree of multi-core chips (such as SOC chips) can be reduced. In addition, since shared memory is an efficient inter-core communication method, multiple cores can access the same physical memory area (i.e., shared memory space) at the same time, and data interaction is performed by reading and writing the shared memory space, so that data can be directly transmitted in memory, and the transmission speed is faster.
[0040] Since the Ethernet data interaction method and multi-core chip provided by the present invention belong to the same inventive concept as the multi-core virtual Ethernet data interaction system provided by the present invention, the Ethernet data interaction method and multi-core chip provided by the present invention at least have all the beneficial effects of the multi-core virtual Ethernet data interaction system provided by the present invention. For details, please refer to the relevant description of the beneficial effects of the multi-core virtual Ethernet data interaction system provided by the present invention in the above text. Therefore, the beneficial effects of the multi-core virtual Ethernet data interaction method provided by the present invention will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of the block structure of a multi-core virtual Ethernet data interaction system provided by an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of cross-core data interaction between MCU cores based on virtual Ethernet provided by an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of cross-core data interaction between an MCU core and an MPU core based on virtual Ethernet provided by an embodiment of the present invention;
[0044] Figure 4 A flow chart of Ethernet data control in an MPU core provided by an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of a multi-core virtual Ethernet data interaction method provided by an embodiment of the present invention;
[0046] Figure 6 A control flow chart of Ethernet data in a core node provided by an embodiment of the present invention;
[0047] Figure 7 A control flow chart of Ethernet data in a remote node provided by an embodiment of the present invention;
[0048] Figure 8 A schematic flow chart of a multi-core virtual Ethernet data interaction method provided in accordance with another embodiment of the present invention.
[0049] The reference numerals are as follows:
[0050] Multi-core chip-100; first MCU core-110; first driver layer-111; first virtual Ethernet driver module-1111; first inter-core interaction driver module-1112; UDMA driver module-1113; first Ethernet protocol stack-112; first application layer-113; first virtual Ethernet interface module-114; second MCU core-120; MPU core-130; second driver layer-121, 131; second virtual Ethernet driver module-1211, 1311; second inter-core interaction driver module-1212, 1312; second Ethernet protocol stack-122, 132; second application layer-123, 133; second virtual Ethernet interface module-124; user space-134; kernel space-135; memory mapping module-1341; shared memory transmission module-140; built-in switch-150; external switch-200. DETAILED DESCRIPTION
[0051] The following is a further detailed description of the multi-core virtual Ethernet data interaction system, data interaction method and multi-core chip proposed in the present invention in combination with the accompanying drawings and specific embodiments. According to the following description, the advantages and features of the present invention will be clearer. It should be noted that the drawings are in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose provided by the present invention. In order to make the purposes, features and advantages of the present invention more obvious and easy to understand, please refer to the accompanying drawings. It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention. Any structural modification, change in proportional relationship or adjustment of size, under the same or similar conditions as the effects that can be produced by the present invention and the purposes that can be achieved, should still fall within the scope of the technical content disclosed by the present invention.
[0052] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The singular forms "a", "an" and "the" include plural objects, the term "or" is generally used in a sense including "and / or", the term "several" is generally used in a sense including "at least one", and the term "at least two" is generally used in a sense including "two or more". In addition, the terms "first", "second" and "third" are used for descriptive purposes only and are not to be understood as indicating or suggesting relative importance or implicitly indicating the number of the indicated technical features.
[0053] In addition, in the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0054] The core node idea of the present invention is to provide a multi-core virtual Ethernet data interaction system, a data interaction method and a multi-core chip, which can realize multi-core cross-core and inter-core data interaction through virtual Ethernet, reduce the Ethernet driver hardware resource cost of the multi-core chip, and effectively improve the data interaction rate and communication quality.
[0055] It should be noted that the multi-core virtual Ethernet data interaction method provided by the present invention can be applied to the multi-core virtual Ethernet data interaction system provided by the present invention, and the multi-core virtual Ethernet data interaction system provided by the present invention can be applicable to the vehicle-mounted Ethernet communication system, and can be configured on the vehicle, the vehicle can include general motor vehicles, such as passenger vehicles including sports utility vehicles (SUV), buses, trucks, various commercial vehicles, and hybrid vehicles, electric vehicles, plug-in hybrid electric vehicles, etc. In addition, it should be noted that, as those skilled in the art can understand, the "virtual Ethernet" referred to in the present invention is independent of the hardware Ethernet network card driver and has nothing to do with the hardware network card interface, but is implemented by pure software. It should also be noted that, as those skilled in the art can understand, the multi-core chip referred to in the present invention can not only be a multi-core SOC chip, but also other multi-core chips, such as a chip of multiple Ethernet controllers.
[0056] To realize the above idea, the present invention provides a multi-core virtual Ethernet data interaction system, please refer to Figure 1 , which is a block diagram of a multi-core virtual Ethernet data interaction system provided by an embodiment of the present invention. Figure 1 As shown, the multi-core virtual Ethernet data interaction system provided by the present invention includes a shared memory transmission module 140 and at least two cores (eg Figure 1 The first MCU core 110, the second MCU core 120 and the MPU core 130); one of the cores (e.g. Figure 1 The first MCU core 110 in the example is configured as a core node of the virtual Ethernet interactive system, and the remaining cores (e.g. Figure 1 The second MCU core 120 and the MPU core 130 in the virtual Ethernet interaction system are configured as remote nodes of the virtual Ethernet interaction system; the shared memory transmission module 140 is configured to allocate corresponding shared memory space for each pair of the remote node and the core node for data interaction, and manage the shared memory space; the core node (for example Figure 1 The first MCU core 110 in the embodiment includes a first driver layer 111, a first Ethernet protocol stack 112 and a first application layer 113; the remote node (eg Figure 1The second MCU core 120 and the MPU core 130 in the embodiment include a second driver layer 121 / 131 and a second application layer 123 / 133; the first driver layer 111 includes a first virtual Ethernet driver module 1111 and a first inter-core interaction driver module 1112, the second driver layer 121 / 131 includes a second virtual Ethernet driver module 1211 / 1311 and a second inter-core interaction driver module 1212 / 1312, the first virtual Ethernet driver module 1111 and the second virtual Ethernet driver module 1211 / 1311 are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, the first inter-core interaction driver module 1112 and the second inter-core interaction driver module 1212 / 1312 are configured to read or write Ethernet data in the corresponding shared memory space.
[0057] Thus, the multi-core virtual Ethernet data interaction system provided by the present invention is provided with a virtual Ethernet driver module and an inter-core interaction driver module in the driver layer of each kernel of the multi-core chip 100, and a shared memory space that can be accessed by both nodes is allocated to each pair of remote nodes and core nodes for data interaction through a shared memory transmission module 140, so that multi-core cross-core inter-core data interaction can be realized through virtual Ethernet, and then the Ethernet driver hardware resource cost of the multi-core chip 100 can be reduced, and the data interaction rate and communication quality can be effectively improved. Since the virtual Ethernet is implemented by pure software, it is reusable, portable and highly compatible, and is adapted to MCU (Micro Controller Unit, microcontroller unit) core and MPU (Micro Processor Unit, microprocessor) core, reducing the cost of code duplication development. At the same time, since the implementation of virtual Ethernet does not need to rely on hardware Ethernet network card resources, the Ethernet driver hardware resource cost and dependence degree of the multi-core chip 100 (such as SOC chip) can be reduced. In addition, since shared memory is an efficient way of inter-core communication, multiple cores can access the same physical memory area (i.e., shared memory space) at the same time, and interact with data by reading and writing the shared memory space, so that data can be transmitted directly in the memory at a faster speed.
[0058] It should be noted that although Figure 1 The multi-core virtual Ethernet data interaction system includes three cores, namely, the first MCU core 110, the second MCU core 120 and the MPU core 130, and the first MCU core 110 is used as the core node for explanation. However, as those skilled in the art can understand, this does not constitute a limitation of the present invention. In some other embodiments, the multi-core virtual Ethernet data interaction system may also include two, four or more cores, and the present invention does not limit the specific type of the core and which core is specifically selected as the core node.
[0059] Specifically, the MCU core is an R core (i.e., an embedded real-time processor core) under the ARM (Advanced RISC Machines) architecture, which is suitable for handling real-time control tasks. It implements function development based on the FreeRTOS system (the FreeRTOS system is a mini real-time operating system) or Autosar (Automotive Open System Architecture) OS. The MPU core 130 is an application processing core in the ARM architecture (reduced instruction set computer (RISC) architecture), called the A core, which is usually used for high-performance computing and the execution of general-purpose operating systems. For example, software functions and applications can be developed based on the Linux operating system. The MCU core can be configured as a remote node of a virtual Ethernet real-time operating system, and the MPU core 130 can be configured as a remote node of a virtual Ethernet Linux operating system.
[0060] Furthermore, the first Ethernet protocol stack 112 and the second Ethernet protocol stack 122 / 132 both include a network layer and a transport layer.
[0061] Furthermore, in addition to allocating a corresponding shared memory space for each pair of the remote node and the core node that perform data interaction, the shared memory transmission module 140 is also responsible for managing the shared memory space. The number of slices of the shared memory space managed by the shared memory transmission module 140 is the same as the number of remote nodes. For example, when the number of remote nodes is 2, the shared memory space managed by the shared memory transmission module 140 is two slices, one of which is used for the interaction of Ethernet data between the core node and one of the remote nodes, and the other is used for the interaction of Ethernet data between the core node and another remote node.
[0062] It should be noted that, as can be understood by those skilled in the art, the core node assumes the central hub responsibility in the virtual Ethernet interactive link, each Ethernet node in the network (including remote nodes and external Ethernet nodes) communicates directly with the core node, and the communication between other remote nodes is also routed through the core node. It should also be noted that, as can be understood by those skilled in the art, the first virtual Ethernet driver module 1111, the second virtual Ethernet driver module 1211 / 1311, the first inter-core interaction driver module 1112 and the second inter-core interaction driver module 1212 / 1312 are all implemented by pure software, the first virtual Ethernet driver module 1111 and the second virtual Ethernet driver module 1211 / 1311 provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card through a virtual Ethernet driver, and the first inter-core interaction driver module 1112 and the second inter-core interaction driver module 1212 / 1312 read or write Ethernet data in a shared memory space through an inter-core interaction driver. In addition, it should be noted that, as can be understood by those skilled in the art, the functional responsibilities of the first virtual Ethernet driver module 1111 and the second virtual Ethernet driver module 1211 / 1311 in the present invention are equivalent to the L2 layer (data link layer) in the OSI model (Open Systems Interconnection Reference Model, a conceptual model for describing computer network architecture), and the first virtual Ethernet driver module 1111 and the second virtual Ethernet driver module 1211 / 1311 can be abstracted as independent modules of software interfaces and can be implemented based on a variety of driver programs.
[0063] Please continue to refer to Figure 1 ,like Figure 1 As shown, in some exemplary embodiments, the virtual Ethernet interactive system also includes a built-in switch 150 and an external switch 200, the first driver layer 111 also includes a UDMA driver module 1113, the built-in switch 150 is connected to the external switch 200 (specifically, they can be connected through a T1 port SGMII module), and the external switch 200 is configured to receive Ethernet data from an external Ethernet node or an external diagnostic device and transmit it to the built-in switch 150, or transmit the Ethernet data to the corresponding external Ethernet node or external diagnostic device; the UDMA driver module 1113 is configured to read Ethernet data from the built-in switch 150, or transmit Ethernet data to the built-in switch 150.
[0064] Specifically, the built-in switch 150 is an Ethernet driver hardware resource that comes with the multi-core chip 100 (such as a multi-core SOC chip), and is an Ethernet external device shared between different cores in the multi-core chip 100. The built-in switch 150 can be configured and software-driven at the core node, and it acts on the Ethernet data routing function of the L2 layer (data link layer). The external switch 200 assumes the Ethernet routing responsibility of the L2 layer (data link layer) of the Ethernet data interaction between the external Ethernet node and the multi-core chip 100, and can divide the IP addresses of different Ethernet nodes into VLANs (Virtual Local Area Network, i.e., virtual local area networks). External Ethernet nodes can transmit and interact Ethernet data between the external switch 200, the built-in switch 150, the core node and the remote node. In addition, the external diagnostic device can also transfer the Ethernet diagnostic request message to the remote node through the Tx port of the external switch 200, the built-in switch 150 and the core node to realize the diagnostic function.
[0065] Furthermore, an EMAC (Enet Media Access Control) port (EMAC port) of the built-in switch 150 is connected to the MAC port (MAC port) of the external switch 200, and the Ethernet data from the external Ethernet node or the external diagnostic device will pass through the external switch 200 to the host port (host port) memory space of the built-in switch 150. The UDMA driver module 1113 can provide a UDMA (Undefined Direct Memory Access) driver. The essence of the UDMA driver is still DMA (Direct Memory Access). It can directly copy data from one address space to another address space without CPU intervention, and provide interactive data transmission between peripherals and memories or between memories. Its function is to solve the problem of excessive consumption of CPU (Central Processing Unit) resources by large amounts of data transmission, save a lot of CPU resources, and is more suitable for interactive application scenarios of Ethernet data (large message data volume and long message length).
[0066] Please continue to refer to Figure 1 ,like Figure 1 As shown, in some exemplary embodiments, the core node (e.g. Figure 1The first MCU core 110 in the embodiment also includes a first virtual Ethernet interface module 114 disposed between the first driver layer 111 and the first Ethernet protocol stack 112, wherein the first virtual Ethernet interface module 114 is configured to provide a unified Ethernet network interface. Thus, by setting the first virtual Ethernet interface module 114 to connect the bottom layer driver (i.e., the first driver layer 111) and the upper layer Ethernet protocol stack (the first Ethernet protocol stack 112), the development cost of adding a hardware Ethernet network card is reduced, the Ethernet communication resources are expanded, and there is no need to design a network communication protocol separately, which can shorten the development cycle, improve code reusability, and be compatible with both the MCU core and the MPU core 130, thereby increasing software maintainability and expanding the Ethernet communication resources of the multi-core chip 100 (e.g., a multi-core SOC chip).
[0067] Specifically, the first virtual Ethernet interface module 114 does not rely on the transmission and reception of the bottom layer driver (first driver layer 111) and the upper layer protocol stack (first Ethernet protocol stack 112), and only needs to complete the standard interface encapsulation of the data, and can be abstracted as an independent module, which is applied to data access between different clients and servers. The first virtual Ethernet interface module 114 can adapt to the standard Ethernet protocol stack on the upper side and to different drivers on the lower side, thereby increasing its scalability and reusability.
[0068] Please continue to refer to Figure 1 ,like Figure 1 As shown, in some exemplary embodiments, the remote node (e.g. Figure 1 The second MCU core 120 in the embodiment also includes a second virtual Ethernet interface module 124 provided between the second driver layer 121 and the second Ethernet protocol stack 122. Thus, by providing the Ethernet second virtual Ethernet interface module 124 between the second driver layer 121 and the second Ethernet protocol stack 122, the second driver layer 121 and the second Ethernet protocol stack 122 can be connected, further reducing the development cost of adding a hardware Ethernet network card, expanding Ethernet communication resources, and no need to design a network communication protocol separately, which can shorten the development cycle, improve code reusability, and be compatible with the MCU core and the MPU core 130 at the same time, increase software maintainability, and expand the Ethernet communication resources of the multi-core chip 100 (such as a multi-core SOC chip).
[0069] It should be noted that, as can be understood by those skilled in the art, the second virtual Ethernet interface module 124 does not rely on the sending and receiving of the second driver layer 121 and the second Ethernet protocol stack 122, and only needs to complete the standard interface encapsulation of data, and can be abstracted as an independent module and applied to data access between different clients and servers. The second virtual Ethernet interface module 124 can adapt to the standard Ethernet protocol stack at the top and to different drivers at the bottom, thereby increasing its scalability and reusability.
[0070] Please continue to refer to Figure 2 , which is a schematic diagram of cross-core data interaction between MCU cores based on virtual Ethernet provided by an embodiment of the present invention. Figure 2 As shown, taking the core node as the first MCU core 110 and the remote node as the second MCU core 120 as an example, the data interaction process in the uplink direction includes: the second MCU core 120 can read Ethernet data from the shared memory space (virtual Ethernet message queue) shared by the first MCU core 110 and the second MCU core 120 through its second inter-core interaction driver module 1212 / 1312, and transmit the read Ethernet data to the upper Ethernet second virtual Ethernet interface module 124 through the second virtual Ethernet driver module 1211, and then transmit it to the second application layer 123 after being processed by the second Ethernet protocol stack, so as to complete the uplink data interaction based on virtual Ethernet. The data interaction process in the downlink direction includes: the second application layer 123 converts the signal encapsulation into Ethernet data, transmits the Ethernet data to the second virtual Ethernet driver module 1211 through the second Ethernet protocol stack 122 and the Ethernet second virtual Ethernet interface module 124, and then writes it into the shared memory space (virtual Ethernet message queue) shared by the first MCU core 110 and the second MCU core 120 through the second inter-core interaction driver module 1212. The first MCU core 110 reads the Ethernet data stored in the shared memory space through the first inter-core interaction driver module 1112, and then transfers the read Ethernet data to the host port of the built-in switch 150 through the UDMA driver module 1113, and routes the data through the external switch 200 to the remote external Ethernet node or external diagnostic device to complete the data interaction.
[0071] Please continue to refer to Figure 1 ,like Figure 1 As shown, in some exemplary embodiments, the remote node includes a user space 134 and a kernel space 135, the kernel space 135 includes the second driver layer 131 and the second Ethernet protocol stack 132, the user space 134 includes the second application layer 133 and a memory mapping module 1341, and the memory mapping module 1341 is configured to perform shared memory address mapping.
[0072] Please continue to refer to Figure 3 , which is a schematic diagram of cross-core data interaction between the MCU core and the MPU core 130 based on virtual Ethernet provided by an embodiment of the present invention. Figure 3 As shown, taking the core node as the first MCU core 110 and the remote node as the MPU core 130 as an example, when the external Ethernet node needs to interact with the MPU core 130 in the multi-core chip 100 (for example, a multi-core SOC chip) for Ethernet data, the Ethernet data sent by the external Ethernet node or the external diagnostic device is transferred to the built-in switch 150 through the external switch 200 and then reaches the host port, and then the first MCU core 110 moves the Ethernet data to the host port memory space through the UDMA driver module 1113, and transmits it to the first virtual Ethernet driver module 1111, and then copies the Ethernet data to the shared memory space shared by the first MCU core 110 and the MPU core 130 through the first inter-core interaction driver module 1112, and then notifies the MPU core 130 that the kernel space of the MPU core 130 needs to complete the driver of the virtual Ethernet network card (create and start the virtual Ethernet network card through the second virtual Ethernet driver module 1311), and then creates the inter-core interaction process and the address mapping adaptation process of the virtual Ethernet device in the user space 134 (performs shared memory address mapping). After reading the Ethernet data from the shared memory space (virtual Ethernet message queue) shared by the first MCU core 110 and the MPU core 130 through the second inter-core interaction driver module 1312 of the MPU core 130 (remote node), the data is encapsulated and processed by the second Ethernet protocol stack 132 of the MPU core 130 and forwarded to the user space 134. At this time, through the receiving task thread created by the user space 134, the user space 134 establishes a socketAPI application interface based on Ethernet implementation, and then transmits the Ethernet data to the upper-level Ethernet application (second application layer 133) through the socketAPI application interface, completing the entire data reception interaction process.
[0073] Please continue to refer to Figure 4 , which is a flow chart of Ethernet data control in the MPU core 130 provided by an embodiment of the present invention. Figure 4As shown, the Ethernet data control process in the MPU core 130 is as follows: 1) The second virtual Ethernet driver module 1311 in the MPU core 130 creates a virtual Ethernet network card through the file descriptor / dev / net / tun; 2) Set attribute information for the created virtual Ethernet network card; 3) Start the virtual Ethernet network card; 4) Map the shared memory data area, which is allocated from the shared memory space of the core node (such as the first MCU core 110) and the MPU core 130; 5) Create a receive / send handle; 6) Create a data pool handle and associate it with the allocated shared memory data area; 7) Create a receive / send task thread: The receive task thread is responsible for The descriptor of the received frame is polled in the network message queue. If the descriptor exists, the data in the virtual Ethernet message queue is read through the second inter-core interaction driver module 1312, and copied to the second Ethernet protocol stack 132 based on the Linux system through the virtual Ethernet network card, and then uploaded to the upper application (second application layer 133); the responsibility of the sending task thread is to poll the second Ethernet protocol stack 132 based on the Linux system through the virtual Ethernet network card to check whether there is a sending frame. If so, the sending frame is copied to the allocated shared memory data area through the second inter-core interaction driver module 1312, and wait for the core node (such as the first MCU core 110) to read and complete the data interaction. In any process in the above control flow, in the event of failure, the CPU will release resources, the program will exit abnormally, and the current thread or process will be closed.
[0074] It should be noted that, as those skilled in the art can understand, when data interaction needs to be implemented based on virtual Ethernet between two remote cores (a first remote node and a second remote node, such as a second MCU core 120 and an MPU core 130) of a multi-core chip 100 (for example, a multi-core SOC chip), the core node is also needed as a central hub to forward the interactive data. Specifically, the core node (the first MCU core 110) reads Ethernet data from the shared memory space (virtual Ethernet queue) shared by the core node (e.g., the first MCU core 110) and the first remote node (e.g., the second MCU core 120) through the first inter-core interaction driver module 1112, and copies the read Ethernet data to the virtual Ethernet queue in the shared memory space shared by the core node (e.g., the first MCU core 110) and the second remote node (e.g., the MPU core 130) through the first inter-core interaction driver module 1112 (this queue is used for data interaction between the core node (e.g., the first MCU core 110) and the second remote node (e.g., the MPU core 130)); then notifies the second remote node (e.g., the MPU core 130) that the kernel space of the second remote node (e.g., the MPU core 130) needs to complete the driver of the virtual Ethernet network card (create and start the virtual Ethernet network card through the second virtual Ethernet driver module 1311), and then creates the inter-core interaction process and the address mapping adaptation process of the virtual Ethernet device in the user space 134 (performs shared memory address mapping). After the second inter-core interaction driver module 1312 of the second remote node (e.g., MPU core 130) reads data from the virtual Ethernet queue in the shared memory space shared by the core node (e.g., the first MCU core 110) and the second remote node (e.g., MPU core 130), it is encapsulated and processed by the second Ethernet protocol stack 132 of the second remote node (e.g., MPU core 130) and forwarded to the user space 134. At this time, through the receiving task thread created by the user space 134, the user space 134 establishes a socketAPI application interface based on Ethernet implementation, and then transmits the Ethernet data to the upper-level Ethernet application (second application layer 133) through the socketAPI application interface, completing the entire data reception interaction process.
[0075] Based on the same inventive concept, the present invention also provides a multi-core virtual Ethernet data interaction method, which is applied to the multi-core virtual Ethernet data interaction system described above. Figure 5 , which is a flow chart of a multi-core virtual Ethernet data interaction method provided by an embodiment of the present invention. Figure 5 As shown, the multi-core virtual Ethernet data interaction method provided in this embodiment includes the following steps:
[0076] Step S110: The first inter-core interaction driver module 1112 in the core node writes the first Ethernet data into the corresponding shared memory space.
[0077] Step S120: The second inter-core interaction driver module 1212 / 1312 in the remote node reads the first Ethernet data from the shared memory space.
[0078] Step S130: The second virtual Ethernet driver module 1211 / 1311 in the remote node transmits the first Ethernet data to the second Ethernet protocol stack 122 / 132 in the remote node for processing.
[0079] Step S140: The second Ethernet protocol stack 122 / 132 in the remote node transmits the processed first Ethernet data to the second application layer 123 / 133 in the remote node.
[0080] Thus, the multi-core virtual Ethernet data interaction method provided by the present invention realizes multi-core cross-core data interaction through virtual Ethernet, thereby reducing the Ethernet driver hardware resource cost of the multi-core chip 100, and effectively improving the data interaction rate and communication quality. Since virtual Ethernet is implemented by pure software, it is reusable, portable and highly compatible, and is adapted to MCU (Micro Controller Unit, microcontroller unit) core and MPU (Micro Processor Unit, microprocessor) core, reducing the cost of code duplication development. At the same time, since the implementation of virtual Ethernet does not need to rely on hardware Ethernet network card resources, the Ethernet driver hardware resource cost and dependence degree of the multi-core chip 100 (such as SOC chip) can be reduced. In addition, since shared memory is an efficient inter-core communication method, multiple cores can access the same physical memory area (i.e., shared memory space) at the same time, and data interaction is performed by reading and writing the shared memory space, so that data can be directly transmitted in the memory, and the transmission speed is faster.
[0081] In some exemplary implementations, the multi-core virtual Ethernet data interaction method provided in this embodiment further includes:
[0082] The UDMA driver module 1113 in the core node receives Ethernet data from an external Ethernet node or an external diagnostic device uploaded sequentially through the external switch 200 and the internal switch 150;
[0083] The core node processes the Ethernet data in sequence through the first virtual Ethernet driver module 1111 and the first Ethernet protocol stack 112 to obtain the first Ethernet data.
[0084] Specifically, please refer to Figure 6, which is a control flow chart of Ethernet data in a core node provided by an embodiment of the present invention. Figure 6 As shown, Ethernet data from the outside of the multi-core chip 100 (for example, a multi-core SOC chip) arrives at the host port through the EMAC ports of the external switch 200 and the built-in switch 150, and the subsequent control flow is as follows: 1) The UDMA driver module 1113 in the core node reads the Ethernet data from the outside of the multi-core chip 100 (for example, a multi-core SOC chip) from the host port; 2) It is determined whether the receiving queue of the UDMA driver module 1113 (the receiving queue can be used cyclically) has available cache space. If there is available cache space, the received Ethernet data is uploaded to the virtual Ethernet interface module through the first virtual Ethernet driver module 1111 for processing, and the received Ethernet data is copied to the available cache space, otherwise continue to wait for the release of the receive queue cache space; 3) the first Ethernet protocol stack 112 receives and processes the Ethernet data from the virtual Ethernet interface module, stores the processed Ethernet data in the allocated cache space, and notifies the receiving process in the first application layer 113; 4) calls the first inter-core interaction driver module 1112 to receive the Ethernet data; 5) determines whether there is available space in the shared memory space of the corresponding remote node, if so, allocates the shared memory data area of the corresponding remote node in the shared memory space, if not, waits for the release of the shared memory space; 6) copies the received Ethernet data to the allocated shared memory data area through the first inter-core interaction driver module 1112, and notifies the remote node to receive the processing.
[0085] Please continue to refer to Figure 7 , which is a control flow chart of Ethernet data in a remote node provided by an embodiment of the present invention. Figure 7 As shown, if the remote node is the second MCU core 120, taking data uplink as an example, the Ethernet data control process in the remote node is as follows: 1) The second inter-core interaction driver module 1212 in the remote node reads Ethernet data from the shared memory data area that copies data from the core node; 2) The shared memory transmission module 140 allocates cache space in the shared memory space; 3) The second inter-core interaction driver module 1212 copies the read Ethernet data to the allocated cache space and releases the shared memory data area; 4) The second inter-core interaction driver module 1212 uploads the read Ethernet data to the Ethernet second virtual Ethernet interface module 124 through the second virtual Ethernet driver module 1211 for processing, and the Ethernet second virtual Ethernet interface module 124 uploads the processed Ethernet data to the second Ethernet protocol stack 122; 5) The second Ethernet protocol stack 122 transmits the received Ethernet data to the second application layer 123 after processing.
[0086] In some exemplary implementations, the multi-core virtual Ethernet data interaction method provided in this embodiment further includes:
[0087] The second inter-core interaction driver module 1212 / 1312 in the remote node writes the second Ethernet data issued sequentially through the second application layer 123 / 133, the second Ethernet protocol stack 122 / 132 and the second virtual Ethernet driver module 1211 / 1311 into the shared memory space;
[0088] The first inter-core interaction driving module 1112 in the core node reads the second Ethernet data from the shared memory space;
[0089] The UDMA driver module 1113 in the core node sends the second Ethernet data to the built-in switch 150 , and transmits the second Ethernet data to the corresponding external Ethernet node or external diagnostic device through the external switch 200 .
[0090] Based on the same inventive concept, the present invention also provides another multi-core virtual Ethernet data interaction method, which is applied to the multi-core virtual Ethernet data interaction system described above. Figure 8 , which is a flow chart of a multi-core virtual Ethernet data interaction method provided by another embodiment of the present invention, such as Figure 8 As shown, the multi-core virtual Ethernet data interaction method provided in this embodiment includes the following steps:
[0091] Step S210, the first inter-core interaction driver module 1112 in the core node reads the fourth Ethernet data from the first shared memory space, and copies the fourth Ethernet data to the second shared memory space, wherein the first shared memory space is a shared memory space for data interaction between the core node and the first remote node, the second shared memory space is a shared memory space for data interaction between the core node and the second remote node, and the fourth Ethernet data is written into the first shared memory space by the second inter-core interaction driver module 1212 / 1312 in the first remote node.
[0092] Step S220: The second inter-core interaction driver module 1312 / 1212 in the second remote node reads the fourth Ethernet data from the second shared memory space.
[0093] Step S230: The second virtual Ethernet driver module 1311 / 1211 in the second remote node transmits the fourth Ethernet data to the second Ethernet protocol stack 132 / 122 in the second remote node for processing.
[0094] Step S240: The second application layer 133 / 123 in the second remote node receives the processed fourth Ethernet data.
[0095] Thus, the multi-core virtual Ethernet data interaction method provided by the present invention realizes multi-core cross-core data interaction through virtual Ethernet, thereby reducing the Ethernet driver hardware resource cost of the multi-core chip 100, and effectively improving the data interaction rate and communication quality. Since virtual Ethernet is implemented by pure software, it is reusable, portable and highly compatible, and is adapted to MCU (Micro Controller Unit, microcontroller unit) core and MPU (Micro Processor Unit, microprocessor) core, reducing the cost of code duplication development. At the same time, since the implementation of virtual Ethernet does not need to rely on hardware Ethernet network card resources, the Ethernet driver hardware resource cost and dependence degree of the multi-core chip 100 (such as SOC chip) can be reduced. In addition, since shared memory is an efficient inter-core communication method, multiple cores can access the same physical memory area (i.e., shared memory space) at the same time, and data interaction is performed by reading and writing the shared memory space, so that data can be directly transmitted in the memory, and the transmission speed is faster.
[0096] Based on the same inventive concept, the present invention also provides a multi-core chip 100, please refer to Figure 1 ,like Figure 1 As shown, the multi-core chip 100 provided by the present invention includes a shared memory transmission module 140 and at least two cores, one of which is configured as a core node of a virtual Ethernet interactive system, and the remaining cores are configured as remote nodes of the virtual Ethernet interactive system; the shared memory transmission module 140 is configured to allocate corresponding shared memory space to each pair of the remote node and the core node for data interaction, and manage the shared memory space; the core node includes a first driver layer 111, a first Ethernet protocol stack 112 and a first application layer 113; the remote node includes a second driver layer 121 / 131, a second Ethernet protocol stack 122 / 132 and a second application layer 123 / 133. 133; The first driver layer 111 includes a first virtual Ethernet driver module 1111 and a first inter-core interaction driver module 1112, the second driver layer 121 / 131 includes a second virtual Ethernet driver module 1211 / 1311 and a second inter-core interaction driver module 1212 / 1312, the first virtual Ethernet driver module 1111 and the second virtual Ethernet driver module 1211 / 1311 are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, the first inter-core interaction driver module 1112 and the second inter-core interaction driver module 1212 / 1312 are configured to read or write Ethernet data in the corresponding shared memory space.
[0097] Thus, the multi-core chip 100 provided by the present invention can realize multi-core cross-core data interaction through virtual Ethernet, thereby reducing the Ethernet driver hardware resource cost of the multi-core chip 100, and effectively improving the data interaction rate and communication quality. Since virtual Ethernet is implemented by pure software, it is reusable, portable and highly compatible, and is adapted to MCU (Micro Controller Unit, microcontroller unit) core and MPU (Micro Processor Unit, microprocessor) core, reducing the cost of code duplication development. At the same time, since the implementation of virtual Ethernet does not need to rely on hardware Ethernet network card resources, the Ethernet driver hardware resource cost and dependence degree of the multi-core chip 100 (such as SOC chip) can be reduced. In addition, since shared memory is an efficient inter-core communication method, multiple cores can access the same physical memory area (i.e., shared memory space) at the same time, and data interaction is performed by reading and writing the shared memory space, so that data can be directly transmitted in the memory, and the transmission speed is faster.
[0098] Please continue to refer to Figure 1 ,like Figure 1 As shown, in some exemplary embodiments, the multi-core chip 100 provided by the present invention also includes a built-in switch 150, and the first driver layer 111 also includes a UDMA driver module 1113. The built-in switch 150 is configured to be connected to the external switch 200, and receive Ethernet data from an external Ethernet node or an external diagnostic device transmitted by the external switch 200, or transmit the Ethernet data to the corresponding external Ethernet node or external diagnostic device through the external switch 200; the UDMA driver module 1113 is configured to read Ethernet data from the built-in switch 150, or transmit Ethernet data to the built-in switch 150.
[0099] In summary, compared with the prior art, the multi-core virtual Ethernet data interaction system, data interaction method and multi-core chip 100 provided by the present invention have the following beneficial effects:
[0100] The present invention sets a virtual Ethernet driver module and an inter-core interaction driver module in the driver layer of each kernel of the multi-core chip 100, and allocates a shared memory space that both nodes can access to each pair of remote nodes and core nodes for data interaction through a shared memory transmission module 140, so that multi-core cross-core inter-core data interaction can be realized through virtual Ethernet, thereby reducing the Ethernet driver hardware resource cost of the multi-core chip 100, and effectively improving the data interaction rate and communication quality. Since the virtual Ethernet is implemented by pure software, it is reusable, portable and highly compatible, and is suitable for MCU (Micro Controller Unit, microcontroller unit) core and MPU (Micro Processor Unit, microprocessor) core, reducing the cost of code duplication development. At the same time, since the implementation of virtual Ethernet does not need to rely on hardware Ethernet network card resources, the Ethernet driver hardware resource cost and dependence degree of the multi-core chip 100 (such as SOC chip) can be reduced. In addition, since shared memory is an efficient way of inter-core communication, multiple cores can access the same physical memory area (i.e., shared memory space) at the same time, and interact with data by reading and writing the shared memory space, so that data can be transmitted directly in the memory at a faster speed.
[0101] It should be noted that the devices and methods disclosed in the embodiments of this article can also be implemented in other ways. The device implementation described above is only schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of this article. In this regard, each box in the flowchart or block diagram can represent a part of a module, program or code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system for performing a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, the functional modules in the various embodiments of this document may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0102] It should also be noted that the above description is only a description of the preferred embodiment of the present invention, and is not any limitation on the scope of the present invention. Any changes and modifications made by a person skilled in the art in the field of the present invention based on the above disclosure are within the scope of protection of the present invention. Obviously, a person skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations fall within the scope of the present invention and its equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A multi-core virtual Ethernet data interaction system, characterized in that: including a shared memory transport module and at least two cores; One of the cores is configured as a core node of a virtual Ethernet interactive system, and the remaining cores are configured as remote nodes of the virtual Ethernet interactive system; The shared memory transmission module is configured to allocate a corresponding shared memory space to each pair of the remote node and the core node for data interaction, and manage the shared memory space; The core node includes a first driver layer, a first Ethernet protocol stack and a first application layer; The remote node includes a second driver layer, a second Ethernet protocol stack and a second application layer; The first driver layer includes a first virtual Ethernet driver module and a first inter-core interaction driver module, the second driver layer includes a second virtual Ethernet driver module and a second inter-core interaction driver module, the first virtual Ethernet driver module and the second virtual Ethernet driver module are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, and the first inter-core interaction driver module and the second inter-core interaction driver module are configured to read or write Ethernet data in the corresponding shared memory space.
2. The multi-core virtual Ethernet data interaction system according to claim 1, characterized in that: The virtual Ethernet interactive system also includes a built-in switch and an external switch, and the first driver layer also includes a UDMA driver module. The built-in switch is connected to the external switch, and the external switch is configured to receive Ethernet data from an external Ethernet node or an external diagnostic device and transmit it to the built-in switch, or transmit the Ethernet data to the corresponding external Ethernet node or external diagnostic device; the UDMA driver module is configured to read Ethernet data from the built-in switch, or transmit Ethernet data to the built-in switch.
3. The multi-core virtual Ethernet data interaction system according to claim 1, characterized in that: The core node also includes a first virtual Ethernet interface module disposed between the first driver layer and the first Ethernet protocol stack, and the first virtual Ethernet interface module is configured to provide a unified Ethernet network interface.
4. The multi-core virtual Ethernet data interaction system according to claim 1, characterized in that: The remote node also includes a second virtual Ethernet interface module disposed between the second driver layer and the second Ethernet protocol stack, and the second virtual Ethernet interface module is configured to provide a unified Ethernet network interface.
5. A multi-core virtual Ethernet data interaction method, characterized in that: The data interaction method comprises: The first inter-core interaction driving module in the core node writes the first Ethernet data into the corresponding shared memory space; The second inter-core interaction driving module in the remote node reads the first Ethernet data from the shared memory space; The second virtual Ethernet driver module in the remote node transmits the first Ethernet data to the second Ethernet protocol stack in the remote node for processing; The second Ethernet protocol stack in the remote node transmits the processed first Ethernet data to the second application layer in the remote node.
6. The multi-core virtual Ethernet data interaction method according to claim 5, characterized in that: The data interaction method further includes: The second inter-core interaction driver module in the remote node writes the second Ethernet data sent sequentially through the second application layer, the second Ethernet protocol stack and the second virtual Ethernet driver module into the shared memory space; The first inter-core interaction driving module in the core node reads the second Ethernet data from the shared memory space; The UDMA driver module in the core node sends the second Ethernet data to the built-in switch, and transmits the second Ethernet data to the corresponding external Ethernet node or external diagnostic device through the external switch.
7. The multi-core virtual Ethernet data interaction method according to claim 5, characterized in that: The data interaction method further includes: The UDMA driver module in the core node receives third Ethernet data uploaded from an external Ethernet node or an external diagnostic device through an external switch and a built-in switch in sequence; The first virtual Ethernet driver module in the core node transmits the third Ethernet data to the first virtual Ethernet interface module and the first Ethernet protocol stack in the core node in sequence for processing to obtain the first Ethernet data.
8. A multi-core virtual Ethernet data interaction method, characterized in that: The data interaction method comprises: The first inter-core interaction driver module in the core node reads the fourth Ethernet data from the first shared memory space, and copies the fourth Ethernet data to the second shared memory space, wherein the first shared memory space is a shared memory space for data interaction between the core node and the first remote node, the second shared memory space is a shared memory space for data interaction between the core node and the second remote node, and the fourth Ethernet data is written into the first shared memory space by the second inter-core interaction driver module in the first remote node; The second inter-core interaction driving module in the second remote node reads the fourth Ethernet data from the second shared memory space; The second virtual Ethernet driver module in the second remote node transmits the fourth Ethernet data to the second Ethernet protocol stack in the second remote node for processing; The second application layer in the second remote node receives the processed fourth Ethernet data.
9. A multi-core chip, characterized in that: The multi-core chip includes a shared memory transmission module and at least two cores, one of which is configured as a core node of a virtual Ethernet interactive system, and the remaining cores are configured as remote nodes of the virtual Ethernet interactive system; The shared memory transmission module is configured to allocate a corresponding shared memory space to each pair of the remote node and the core node for data interaction, and manage the shared memory space; The core node includes a first driver layer, a first Ethernet protocol stack and a first application layer; The remote node includes a second driver layer, a second Ethernet protocol stack and a second application layer; The first driver layer includes a first virtual Ethernet driver module and a first inter-core interaction driver module, the second driver layer includes a second virtual Ethernet driver module and a second inter-core interaction driver module, the first virtual Ethernet driver module and the second virtual Ethernet driver module are configured to provide a standard Ethernet protocol stack virtual network interface or create a virtual Ethernet network card, and the first inter-core interaction driver module and the second inter-core interaction driver module are configured to read or write Ethernet data in the corresponding shared memory space.
10. The multi-core chip according to claim 9, characterized in that: The multi-core chip also includes a built-in switch, and the first driver layer also includes a UDMA driver module. The built-in switch is configured to be connected to an external switch and receive Ethernet data from an external Ethernet node or an external diagnostic device transmitted by the external switch, or transmit the Ethernet data to the corresponding external Ethernet node or external diagnostic device through the external switch; the UDMA driver module is configured to read Ethernet data from the built-in switch, or transmit Ethernet data to the built-in switch.
Citation Information
Patent Citations
Method and system based on real-time communication among hybrid multi-system cores
CN109976925A
Vehicle body electrical network architecture based on remote virtual shared memory mechanism
CN113360293A
Data transmission method and device under virtualization management, equipment and medium
CN116248772A
Heterogeneous multi-core chip and Ethernet message acquisition and storage method and device
CN117201431A
Multi-core system and dynamic module loading method thereof, medium and processor chip
CN117234607A
