CN112433826B - Hybrid heterogeneous virtualization communication method and chip - Google Patents

Hybrid heterogeneous virtualization communication method and chip Download PDF

Info

Publication number
CN112433826B
CN112433826B CN202110107948.7A CN202110107948A CN112433826B CN 112433826 B CN112433826 B CN 112433826B CN 202110107948 A CN202110107948 A CN 202110107948A CN 112433826 B CN112433826 B CN 112433826B
Authority
CN
China
Prior art keywords
application
data packet
network card
domain
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110107948.7A
Other languages
Chinese (zh)
Other versions
CN112433826A (en
Inventor
刘烨
刘亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Semidrive Technology Co Ltd
Original Assignee
Nanjing Semidrive Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Semidrive Technology Co Ltd filed Critical Nanjing Semidrive Technology Co Ltd
Priority to CN202110107948.7A priority Critical patent/CN112433826B/en
Publication of CN112433826A publication Critical patent/CN112433826A/en
Application granted granted Critical
Publication of CN112433826B publication Critical patent/CN112433826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances

Abstract

The application discloses a hybrid heterogeneous virtualization communication method and a chip, and belongs to the technical field of embedded chips on chips. The method comprises the following steps: each operating system in the chip is allocated with a virtual network card and a corresponding IP address is set, so that the application program can realize cross-operating system interconnection and intercommunication in a uniform mode (socket) through the routing process of the virtual and real gateway. Because the application program can be interconnected and intercommunicated between the physical cores and the virtual machine, the chip is changed into a logically network communication-based on-chip distributed system from the original heterogeneous multi-core processor model. Moreover, the method disclosed by the application can be conveniently expanded to a system on chip with more physical cores and virtual machines.

Description

Hybrid heterogeneous virtualization communication method and chip
Technical Field
The embodiment of the application relates to the technical field of embedded chips on chips, in particular to a hybrid heterogeneous virtualization communication method and a chip.
Background
Under the development trend of networking and intellectualization of automobiles, the chip needs to take account of both the computing capacity and the functional safety. The main point is that multiple processors are usually configured in a chip, which requires that the processors should be isolated from each other and maintain necessary communication. When the processors communicate with each other, some hardware states need to be shared, data transmission is carried out across networks, and the like, so that the independence and the safety of the respective functions of the processors are kept, and the integrity and the completeness of the system on chip are reflected.
In addition to physically isolating different functional domains in a chip, virtualization technology is another solution. That is, running hypervisor (virtual machine monitor) on the same set of processors, running operating systems independent of each other and having different access rights through the running level provided by the processors, and accessing some hardware resources by means of an authorized white list.
The system on chip is operated with heterogeneous systems composed of different processors, such as a main application processor, a processor mainly responsible for a Safety domain (Security) and a processor responsible for a Security domain (Security), and the like. Multiple virtual processors are logically built on top of a Multi-core SMP (symmetric Multi-Processing) of a host application processor through virtualization technology, and run multiple operating systems thereon. In the vehicle-mounted field, these operating systems include an operating system for processing infotainment, an operating system for processing instrument displays, an operating system for processing control panels, and the like, and thus constitute a complex set of operating systems. To ensure the coordination of the operating systems, it becomes necessary to introduce a set of message communication buses in multiple operating systems. The set of message communication buses needs to handle data interaction between the physical processors, support data interaction between the virtual processors, and support data interaction between the physical processors and the virtual processors.
Disclosure of Invention
The embodiment of the application provides a hybrid heterogeneous virtualization communication method and a chip, which are used for solving the problem of rapid data interaction between a physical processor and a virtual processor. The technical scheme is as follows:
in one aspect, a hybrid heterogeneous virtualization communication method is provided, and is applied to a chip, where the chip includes: the system comprises a physical domain, a virtual network card and communication equipment, wherein the physical domain comprises a physical processor, an operating system and an application run on the physical processor, the virtual domain comprises a virtual processor, and the operating system and the application run on the virtual processor; the method comprises the following steps:
when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application determines a destination Internet Protocol (IP) address of the second operating system and a destination port number of the second application;
the first application generates a data packet according to the data, the destination IP address and the destination port number and sends the data packet to the first operating system;
the first operating system sends the data packet to a first virtual network card, and the first virtual network card corresponds to the first operating system;
the first virtual network card determines communication equipment according to the destination IP address and sends the data packet to the communication equipment;
the communication equipment sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the second virtual network card corresponds to the second operating system;
the second virtual network card sends the data packet to a second operating system;
and the second operating system sends the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet.
In a possible implementation manner, the generating, by the first application, a data packet according to the data, the destination IP address, and the destination port number includes: the first application generates a data packet containing the data, the destination IP address and the destination port number by using a first socket interface;
when the first operating system includes a first protocol stack, the sending the data packet to the first operating system includes: the first socket interface sends the data packet to the first protocol stack;
the first operating system sends the data packet to a first virtual network card, and the method comprises the following steps: and the first protocol stack sends the data packet to the first virtual network card.
In a possible implementation manner, when the second operating system includes a second protocol stack, the sending, by the second virtual network card, the data packet to the second operating system includes: the second virtual network card sends the data packet to the second protocol stack;
the second operating system sends the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet, and the sending includes: and the second protocol stack sends the data in the data packet to a second socket interface according to the destination IP address and the destination port number in the data packet, and the second socket interface sends the data to the second application.
In one possible implementation, when the first application and the second application are both located in the physical domain, the communication device is an inter-core communication device;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the physical domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the inter-core communication equipment;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: and when the inter-core communication equipment determines that the second application is located in the physical domain according to the domain number, the inter-core communication equipment sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
In one possible implementation, when the first application and the second application are both located in the virtual domain, the communication device is a virtual bus;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the virtual domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the virtual bus;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: and when the virtual bus determines that the second application is positioned in the virtual domain according to the domain number, the virtual bus sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
In one possible implementation, when the first application is located in the physical domain and the second application is located in the virtual domain, the system further includes a domain gateway, and the communication device includes an inter-core communication device and a virtual bus;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the virtual domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the inter-core communication equipment;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: when the inter-core communication equipment determines that the second application is located in the virtual domain according to the domain number, the inter-core communication equipment sends the data packet to a third virtual network card in the domain gateway; the third virtual network card sends the data packet to a fourth virtual network card in the domain gateway according to the destination IP address; and the fourth virtual network card sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
In a possible implementation manner, the sending, by the third virtual network card, the data packet to a fourth virtual network card in the domain gateway according to the destination IP address includes:
the third virtual network card caches the data packet into a corresponding first buffer area queue; the virtual processor in the domain gateway copies the data packet in the first buffer area queue to a second buffer area queue according to the destination IP address, wherein the second buffer area queue corresponds to the fourth virtual network card; alternatively, the first and second electrodes may be,
the third virtual network card caches the data packet in a third buffer area queue and sends the cache address of the data packet to a virtual processor in the domain gateway; and the virtual processor in the domain gateway sends the cache address to the fourth virtual network card according to the destination IP address.
In one possible implementation, when the first application is located in the virtual domain and the second application is located in the physical domain, the system further includes a domain gateway, and the communication device includes an inter-core communication device and a virtual bus;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the physical domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the virtual bus;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: when the virtual bus determines that the second application is located in the physical domain according to the domain number, the virtual bus sends the data packet to a fourth virtual network card in the domain gateway; the fourth virtual network card sends the data packet to a third virtual network card in the domain gateway according to the destination IP address; and the third virtual network card sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
In a possible implementation manner, the sending, by the fourth virtual network card, the data packet to the third virtual network card in the domain gateway according to the destination IP address includes:
the fourth virtual network card caches the data packet into a corresponding second buffer area queue; the virtual processor in the domain gateway copies the data packets in the second buffer area queue to a first buffer area queue according to the destination IP address, wherein the first buffer area queue corresponds to the third virtual network card; alternatively, the first and second electrodes may be,
the fourth virtual network card caches the data packet in a third buffer area queue and sends the cache address of the data packet to a virtual processor in the domain gateway; and the virtual processor in the domain gateway sends the cache address to the third virtual network card according to the destination IP address.
In one aspect, a chip is provided, the chip comprising: the system comprises a physical domain, a virtual network card and communication equipment, wherein the physical domain comprises a physical processor, an operating system and application, and the virtual domain comprises a virtual processor, an operating system and application;
when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application is used for determining a destination Internet Protocol (IP) address of the second operating system and a destination port number of the second application;
the first application is further configured to generate a data packet according to the data, the destination IP address, and the destination port number, and send the data packet to the first operating system;
the first operating system is used for sending the data packet to a first virtual network card, and the first virtual network card corresponds to the first operating system;
the first virtual network card is used for determining communication equipment according to the destination IP address and sending the data packet to the communication equipment;
the communication device is configured to send the data packet to a second virtual network card according to the destination IP address and the destination port number, where the second virtual network card corresponds to the second operating system;
the second virtual network card is used for sending the data packet to a second operating system;
and the second operating system is used for sending the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application can generate a data packet according to the data, a destination IP address of the second operating system and a destination port number of the second application, and send the data packet to a first virtual network card through the first operating system; the first virtual network card determines communication equipment according to the destination IP address and sends the data packet to the communication equipment; the communication equipment sends the data packet to a second virtual network card according to the destination IP address and the destination port number; and the second virtual network card sends the data in the data packet to the second application through the second operating system. Thus, when the first application and the second application are both located in the physical domain, communication between the physical processors in the chip can be unified through the IP network model; when the first application and the second application are both located in the virtual domain, communication between the virtual processors in the chip can be unified through the IP network model; when one of the first application and the second application is located in a physical domain and the other is located in a virtual domain, communication between a physical processor and a virtual processor in a chip can be unified through an IP network model, so that the chip can simultaneously support a system architecture of a virtual machine and heterogeneous multi-cores.
When the first application is located in the virtual domain and the second application is located in the physical domain, or when the first application is located in the physical domain and the second application is located in the virtual domain, the virtual processor and the physical processor can be opened through a virtual network card in the domain gateway, and communication between the physical processor and the virtual processor is achieved. Therefore, the processing complexity can be concentrated in the domain gateway, so that the chip has high cohesiveness and the performance of the chip is improved conveniently in an algorithm optimization mode.
And a buffer queue and a shared memory can be adopted between the third virtual network card and the fourth virtual network card to reduce the data copying, so that the overhead can be reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a chip configuration according to some exemplary embodiments;
fig. 2 is a flowchart of a method of hybrid heterogeneous virtualized communication provided by an embodiment of the present application;
fig. 3 is a schematic structural diagram of a chip according to another embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
The structure of the chip according to the present embodiment will be described first.
The chip in this embodiment has a heterogeneous multiprocessor architecture, and each physical processor and the operating system and applications running thereon may be referred to as a physical domain. In addition, isolated multiple virtual processor execution environments can also be created through virtualization technology, and each virtual processor and the operating system and applications running thereon can be referred to as a virtual domain.
At least one physical domain and at least one virtual domain may be included in the chip. Each physical domain corresponds to a virtual network card, each virtual domain corresponds to a virtual network card, the virtual network card is a virtual device with network behavior simulated by software, and a static IP (Internet Protocol) address can be allocated to each virtual network card. In this way, each physical or virtual domain may communicate with other domains via a virtual network card.
The chip also comprises a virtual bus and an inter-core communication device. The virtual bus is a memory and event based communication infrastructure provided by hypervisor, and the inter-core communication device is a device which puts mailbox into a physical processor and shares memory.
A physical-virtual domain gateway (hereinafter referred to as a domain gateway) may also be included in the chip, which runs in a hypervisor or privileged domain and has both the right to access the physical domain and the right to access the virtual domain. In an optional implementation manner, a plurality of groups of virtual network cards are arranged in the domain gateway, one virtual network card in each group of virtual network cards can access the physical domain, and the other virtual network card can access the virtual domain, so that the physical domain and the virtual domain can be bridged.
For the convenience of understanding, the structure of the chip is illustrated below by taking an example in which the chip includes a physical domain, a virtual domain, and a domain gateway, and please refer to fig. 1. The physical domain in fig. 1 includes a physical processor and an operating system 1, the domain gateway includes a virtual processor and an operating system 2, the virtual domain includes a virtual processor and an operating system 3, the physical domain corresponds to a first virtual network card, the domain gateway corresponds to a third virtual network card and a fourth virtual network card, the virtual domain corresponds to a second virtual network card, the first virtual network card and the third virtual network card communicate with each other through an inter-core communication device, and the fourth virtual network card and the second virtual network card communicate with each other through a virtual bus.
Referring to fig. 2, a flowchart of a hybrid heterogeneous virtualization communication method provided in an embodiment of the present application is shown, where the hybrid heterogeneous virtualization communication method can be applied to a chip. The hybrid heterogeneous virtualization communication method may include:
step 201, when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application determines a destination IP address of the second operating system and a destination port number of the second application.
The chip is preset with the relationship between different operating systems and different IP addresses, and the first application can query the IP address corresponding to the second operating system according to the corresponding relationship and determine the IP address as the destination IP address. The chip can also query the port number corresponding to the second application, and determine the port number as the destination port number.
Step 202, the first application generates a data packet according to the data, the destination IP address and the destination port number, and sends the data packet to the first operating system.
Specifically, the generating, by the first application, the data packet according to the data, the destination IP address, and the destination port number may include: the first application generates a data packet containing data, a destination IP address, and a destination port number using the first socket interface.
After generating the data packet, the first application may send the data packet to the first operating system, specifically, when the first operating system includes the first protocol stack, the sending the data packet to the first operating system includes: the first socket interface sends the data packet to the first protocol stack. The first Protocol stack may be a TCP (Transmission Control Protocol)/IP Protocol stack.
Step 203, the first operating system sends the data packet to a first virtual network card, and the first virtual network card corresponds to the first operating system.
Specifically, the sending, by the first operating system, the data packet to the first virtual network card may include: and the first protocol stack sends the data packet to the first virtual network card.
And step 204, the first virtual network card determines the communication equipment according to the destination IP address and sends the data packet to the communication equipment.
The first application and the second application are located in different domains, and the intra-application scenes are divided according to the domains where the first application and the second application are located, so as to describe the execution flow of step 204 in different application scenes.
In a first application scenario, where the first application and the second application are both located in a physical domain, and the communication device at this time is an inter-core communication device, the first virtual network card determines the communication device according to the destination IP address, and sends the data packet to the communication device, where the method may include: and the first virtual network card determines the domain number of the physical domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the inter-core communication equipment.
In a second application scene, the first application and the second application are both located in a virtual domain, and at the moment, the communication device is a virtual bus; the determining, by the first virtual network card, the communication device according to the destination IP address, and sending the data packet to the communication device may include: and the first virtual network card determines the domain number of the virtual domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the virtual bus.
In a third application scenario, the first application is located in a physical domain, the second application is located in a virtual domain, and at this time, the communication device includes an inter-core communication device and a virtual bus; the first virtual network card determines the communication device according to the destination IP address, and sends the data packet to the communication device, including: and the first virtual network card determines the domain number of the virtual domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the inter-core communication equipment.
In a fourth application scenario, the first application is located in a virtual domain, the second application is located in a physical domain, and at this time, the communication device includes an inter-core communication device and a virtual bus; the determining, by the first virtual network card, the communication device according to the destination IP address, and sending the data packet to the communication device may include: and the first virtual network card determines the domain number of the physical domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the virtual bus.
It should be noted that, in the first and third application scenarios, the first virtual network card needs to perform format conversion on the data packet first, and then send the converted data packet to the inter-core communication device.
Step 205, the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, where the second virtual network card corresponds to a second operating system.
In a first application scenario, the sending, by the communication device, the data packet to the second virtual network card according to the destination IP address and the destination port number may include: and when the inter-core communication equipment determines that the second application is positioned in the physical domain according to the domain number, the inter-core communication equipment sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
It should be noted that the second virtual network card needs to perform format conversion on the data packet, so that the data packet is restored to the format before being sent to the inter-core communication device.
In a second application scenario, the sending, by the communication device, the data packet to the second virtual network card according to the destination IP address and the destination port number may include: and when the virtual bus determines that the second application is positioned in the virtual domain according to the domain number, the virtual bus sends the data packet to a second virtual network card according to the destination IP address and the destination port number.
In a third application scenario, the sending, by the communication device, the data packet to the second virtual network card according to the destination IP address and the destination port number may include: when the inter-core communication equipment determines that the second application is located in the virtual domain according to the domain number, the inter-core communication equipment sends the data packet to a third virtual network card in the domain gateway; the third virtual network card sends the data packet to a fourth virtual network card in the domain gateway according to the destination IP address; and the fourth virtual network card sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
The domain gateway is provided with a plurality of groups of virtual network cards, one virtual network card in each group of virtual network cards corresponds to one physical domain, and the other virtual network card corresponds to one virtual domain.
It should be noted that the third virtual network card needs to perform format conversion on the data packet, so that the data packet is restored to the format before being sent to the inter-core communication device.
The sending, by the third virtual network card, the data packet to the fourth virtual network card in the domain gateway according to the destination IP address may include: the third virtual network card caches the data packet into the corresponding first buffer area queue; the virtual processor in the domain gateway copies the data packets in the first buffer area queue to a second buffer area queue according to the destination IP address, and the second buffer area queue corresponds to a fourth virtual network card; or, the third virtual network card buffers the data packet into a third buffer queue, and sends the buffer address of the data packet to the virtual processor in the domain gateway; and the virtual processor in the domain gateway sends the cache address to the fourth virtual network card according to the destination IP address.
In a fourth application scenario, the sending, by the communication device, the data packet to the second virtual network card according to the destination IP address and the destination port number includes: when the virtual bus determines that the second application is located in the physical domain according to the domain number, the virtual bus sends the data packet to a fourth virtual network card in the domain gateway; the fourth virtual network card sends the data packet to a third virtual network card in the domain gateway according to the destination IP address; and the third virtual network card sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
The sending, by the fourth virtual network card, the data packet to the third virtual network card in the domain gateway according to the destination IP address may include: the fourth virtual network card caches the data packet into the corresponding second buffer area queue; the virtual processor in the domain gateway copies the data packets in the second buffer area queue to the first buffer area queue according to the destination IP address, and the first buffer area queue corresponds to the third virtual network card; or, the fourth virtual network card buffers the data packet into the third buffer queue, and sends the buffer address of the data packet to the virtual processor in the domain gateway; and the virtual processor in the domain gateway sends the cache address to the third virtual network card according to the destination IP address.
And a buffer queue and a shared memory can be adopted between the third virtual gateway and the fourth virtual gateway to reduce the data copying, so that the overhead can be reduced.
Optionally, a data validity check policy may be set in the domain gateway, so that the virtual processor in the domain gateway may detect the validity of the data according to the data validity check policy, thereby implementing a data filtering function.
In step 206, the second virtual network card sends the data packet to the second operating system.
Specifically, when the second operating system includes the second protocol stack, the sending, by the second virtual network card, the data packet to the second operating system may include: and the second virtual network card sends the data packet to a second protocol stack.
And step 207, the second operating system sends the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet.
Specifically, the sending, by the second operating system, the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet may include: and the second protocol stack sends the data in the data packet to a second socket interface according to the destination IP address and the destination port number in the data packet, and the second socket interface sends the data to a second application. Wherein the second protocol stack may be a TCP/IP protocol stack.
It should be noted that, when the chip is provided with a physical ethernet card or 4G (4)thGenerations, fourth generation mobile communication technology), an external network can be communicated with the inside of a chip through a network security bridging technology, so that an integrated IP network is realized. At this time, a firewall policy may be set in the domain gateway, and the virtual processor in the domain gateway may implement security isolation according to the firewall policy, thereby ensuring the security of the chip.
To sum up, in the hybrid heterogeneous virtualization communication method provided in this embodiment of the present application, when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application may generate a data packet according to the data, a destination IP address of the second operating system, and a destination port number of the second application, and send the data packet to a first virtual network card through the first operating system; the first virtual network card determines communication equipment according to the destination IP address and sends the data packet to the communication equipment; the communication equipment sends the data packet to a second virtual network card according to the destination IP address and the destination port number; and the second virtual network card sends the data in the data packet to the second application through the second operating system. Thus, when the first application and the second application are both located in the physical domain, communication between the physical processors in the chip can be unified through the IP network model; when the first application and the second application are both located in the virtual domain, communication between the virtual processors in the chip can be unified through the IP network model; when one of the first application and the second application is located in a physical domain and the other is located in a virtual domain, communication between a physical processor and a virtual processor in a chip can be unified through an IP network model, so that the chip can simultaneously support a system architecture of a virtual machine and heterogeneous multi-cores.
When the first application is located in the virtual domain and the second application is located in the physical domain, or when the first application is located in the physical domain and the second application is located in the virtual domain, the virtual processor and the physical processor can be opened through a virtual network card in the domain gateway, and communication between the physical processor and the virtual processor is achieved. Therefore, the processing complexity can be concentrated in the domain gateway, so that the chip has high cohesiveness and the performance of the chip is improved conveniently in an algorithm optimization mode.
And a buffer queue and a shared memory can be adopted between the third virtual network card and the fourth virtual network card to reduce the data copying, so that the overhead can be reduced.
Referring to fig. 3, a block diagram of a chip according to an embodiment of the present application is shown. The chip may include: the system comprises a physical domain, a virtual network card and communication equipment, wherein the physical domain comprises a physical processor, an operating system and application, and the virtual domain comprises a virtual processor, an operating system and application;
when the first application 320 on the first operating system 310 needs to send data to the second application 340 on the second operating system 330, and the first application 320 and the second application 340 are located in different domains, the first application 320 is configured to determine a destination Internet Protocol (IP) address of the second operating system 330 and a destination port number of the second application 340;
the first application 320 is further configured to generate a data packet according to the data, the destination IP address, and the destination port number, and send the data packet to the first operating system 310;
the first operating system 310 is configured to send the data packet to the first virtual network card 350, where the first virtual network card 350 corresponds to the first operating system 310;
the first virtual network card 350 is used for determining the communication equipment 360 according to the destination IP address and sending the data packet to the communication equipment 360;
the communication device 360 is configured to send the data packet to the second virtual network card 370 according to the destination IP address and the destination port number, where the second virtual network card 370 corresponds to the second operating system 330;
a second virtual network card 370, configured to send the data packet to the second operating system 330;
and the second operating system 330 is configured to send the data in the data packet to the second application 340 according to the destination IP address and the destination port number in the data packet.
In an alternative embodiment, the first application 320 is further configured to generate a data packet including data, a destination IP address, and a destination port number using the first socket interface;
when the first operating system 310 includes the first protocol stack, the first socket interface is configured to send the data packet to the first protocol stack;
the first protocol stack is configured to send the data packet to the first virtual network card 350.
In an alternative embodiment, when the second operating system 330 includes a second protocol stack, the second virtual network card 370 is further configured to send the data packet to the second protocol stack;
the second protocol stack is used for sending the data in the data packet to the second socket interface according to the destination IP address and the destination port number in the data packet;
a second socket interface for sending data to the second application 340.
In an alternative embodiment, the communication device 360 is an inter-core communication device when the first application 320 and the second application 340 are both located in the physical domain;
the first virtual network card 350 is further configured to determine, according to the destination IP address, a domain number of a physical domain where the second application 340 is located, and send the data packet and the domain number to the inter-core communication device;
the inter-core communication device is further configured to send the data packet to the second virtual network card 370 according to the destination IP address and the destination port number when it is determined that the second application is located in the physical domain according to the domain number.
In an alternative embodiment, when both the first application 320 and the second application 340 are located in a virtual domain, the communication device 360 is a virtual bus;
the first virtual network card 350 is further configured to determine, according to the destination IP address, a domain number of a virtual domain where the second application 340 is located, and send the data packet and the domain number to the virtual bus;
the virtual bus is further configured to send the data packet to the second virtual network card 370 according to the destination IP address and the destination port number when it is determined that the second application is located in the virtual domain according to the domain number.
In an alternative embodiment, when the first application 320 is located in the physical domain and the second application 340 is located in the virtual domain, the system further comprises a domain gateway, and the communication device 360 comprises an inter-core communication device and a virtual bus;
the first virtual network card 350 is further configured to determine, according to the destination IP address, a domain number of a virtual domain where the second application 340 is located, and send the data packet and the domain number to the inter-core communication device;
the inter-core communication equipment is further used for sending the data packet to a third virtual network card in the domain gateway when the second application is determined to be located in the virtual domain according to the domain number; the third virtual network card is used for sending the data packet to a fourth virtual network card in the domain gateway according to the destination IP address; and a fourth virtual network card for sending the data packet to the second virtual network card 370 according to the destination IP address and the destination port number.
In an optional embodiment, the third virtual network card is further configured to buffer the data packet into the corresponding first buffer queue; the virtual processor in the domain gateway is used for copying the data packets in the first buffer area queue to a second buffer area queue according to the destination IP address, and the second buffer area queue corresponds to the fourth virtual network card; alternatively, the first and second electrodes may be,
the third virtual network card is also used for caching the data packet into a third buffer area queue and sending the cache address of the data packet to the virtual processor in the domain gateway; and the virtual processor in the domain gateway is used for sending the cache address to the fourth virtual network card according to the destination IP address.
In an alternative embodiment, when the first application 320 is located in the virtual domain and the second application 340 is located in the physical domain, the system further comprises a domain gateway, and the communication device 360 comprises an inter-core communication device and a virtual bus;
the first virtual network card 350 is further configured to determine, according to the destination IP address, a domain number of a physical domain where the second application 340 is located, and send the data packet and the domain number to the virtual bus;
the virtual bus is further used for sending the data packet to a fourth virtual network card in the domain gateway when the second application is determined to be located in the physical domain according to the domain number; the fourth virtual network card is used for sending the data packet to the third virtual network card in the domain gateway according to the destination IP address; and a third virtual network card for transmitting the data packet to the second virtual network card 370 according to the destination IP address and the destination port number.
In an optional embodiment, the fourth virtual network card is further configured to buffer the data packet into the corresponding second buffer queue; the virtual processor in the domain gateway is used for copying the data packets in the second buffer area queue to the first buffer area queue according to the destination IP address, and the first buffer area queue corresponds to the third virtual network card; alternatively, the first and second electrodes may be,
the fourth virtual network card is also used for caching the data packet into the third buffer area queue and sending the cache address of the data packet to the virtual processor in the domain gateway; and the virtual processor in the domain gateway is used for sending the cache address to the third virtual network card according to the destination IP address.
To sum up, with the chip provided in the embodiment of the present application, when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application may generate a data packet according to the data, a destination IP address of the second operating system, and a destination port number of the second application, and send the data packet to a first virtual network card through the first operating system; the first virtual network card determines communication equipment according to the destination IP address and sends the data packet to the communication equipment; the communication equipment sends the data packet to a second virtual network card according to the destination IP address and the destination port number; and the second virtual network card sends the data in the data packet to the second application through the second operating system. Thus, when the first application and the second application are both located in the physical domain, communication between the physical processors in the chip can be unified through the IP network model; when the first application and the second application are both located in the virtual domain, communication between the virtual processors in the chip can be unified through the IP network model; when one of the first application and the second application is located in a physical domain and the other is located in a virtual domain, communication between a physical processor and a virtual processor in a chip can be unified through an IP network model, so that the chip can simultaneously support a system architecture of a virtual machine and heterogeneous multi-cores.
When the first application is located in the virtual domain and the second application is located in the physical domain, or when the first application is located in the physical domain and the second application is located in the virtual domain, the virtual processor and the physical processor can be opened through a virtual network card in the domain gateway, and communication between the physical processor and the virtual processor is achieved. Therefore, the processing complexity can be concentrated in the domain gateway, so that the chip has high cohesiveness and the performance of the chip is improved conveniently in an algorithm optimization mode.
And a buffer queue and a shared memory can be adopted between the third virtual network card and the fourth virtual network card to reduce the data copying, so that the overhead can be reduced.
It should be noted that: in the chip provided in the above embodiment, when performing communication, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the chip is divided into different functional modules to complete all or part of the functions described above. In addition, the chip provided by the above embodiment and the hybrid heterogeneous virtualization communication method embodiment belong to the same concept, and specific implementation processes thereof are described in the method embodiment and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description should not be taken as limiting the embodiments of the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the embodiments of the present application.

Claims (10)

1. A hybrid heterogeneous virtualization communication method is applied to a chip, and the chip comprises: the system comprises a physical domain, a virtual network card and communication equipment, wherein the physical domain comprises a physical processor, an operating system and an application run on the physical processor, the virtual domain comprises a virtual processor, and the operating system and the application run on the virtual processor; the method comprises the following steps:
when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application determines a destination IP address of the second operating system and a destination port number of the second application;
the first application generates a data packet according to the data, the destination IP address and the destination port number and sends the data packet to the first operating system;
the first operating system sends the data packet to a first virtual network card, and the first virtual network card corresponds to the first operating system;
the first virtual network card determines communication equipment according to the destination IP address and sends the data packet to the communication equipment;
the communication equipment sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the second virtual network card corresponds to the second operating system;
the second virtual network card sends the data packet to a second operating system;
the second operating system sends the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet;
wherein when the first application and the second application are both located in the physical domain, the communication device is an inter-core communication device; when the first application and the second application are both located in the virtual domain, the communication device is a virtual bus; when the first application is located in the physical domain and the second application is located in the virtual domain, or when the first application is located in the virtual domain and the second application is located in the physical domain, the system further includes a domain gateway, and the communication device includes an inter-core communication device and a virtual bus.
2. The method of claim 1,
the first application generates a data packet according to the data, the destination IP address and the destination port number, including: the first application generates a data packet containing the data, the destination IP address and the destination port number by using a first socket interface;
when the first operating system includes a first protocol stack, the sending the data packet to the first operating system includes: the first socket interface sends the data packet to the first protocol stack;
the first operating system sends the data packet to a first virtual network card, and the method comprises the following steps: and the first protocol stack sends the data packet to the first virtual network card.
3. The method of claim 1, wherein when a second protocol stack is included in the second operating system, the second virtual network card sending the data packet to the second operating system, comprising: the second virtual network card sends the data packet to the second protocol stack;
the second operating system sends the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet, and the sending includes: and the second protocol stack sends the data in the data packet to a second socket interface according to the destination IP address and the destination port number in the data packet, and the second socket interface sends the data to the second application.
4. The method of any of claims 1-3, wherein when the first application and the second application are both located in the physical domain, the communication device is an inter-core communication device;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the physical domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the inter-core communication equipment;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: and when the inter-core communication equipment determines that the second application is located in the physical domain according to the domain number, the inter-core communication equipment sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
5. The method of any of claims 1-3, wherein when the first application and the second application are both located in the virtual domain, the communication device is a virtual bus;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the virtual domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the virtual bus;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: and when the virtual bus determines that the second application is positioned in the virtual domain according to the domain number, the virtual bus sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
6. The method of any of claims 1 to 3, wherein when the first application is located in the physical domain and the second application is located in the virtual domain, the system further comprises a domain gateway and the communication devices comprise inter-core communication devices and a virtual bus;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the virtual domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the inter-core communication equipment;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: when the inter-core communication equipment determines that the second application is located in the virtual domain according to the domain number, the inter-core communication equipment sends the data packet to a third virtual network card in the domain gateway; the third virtual network card sends the data packet to a fourth virtual network card in the domain gateway according to the destination IP address; and the fourth virtual network card sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
7. The method according to claim 6, wherein the third virtual network card sending the data packet to a fourth virtual network card in the domain gateway according to the destination IP address comprises:
the third virtual network card caches the data packet into a corresponding first buffer area queue; the virtual processor in the domain gateway copies the data packet in the first buffer area queue to a second buffer area queue according to the destination IP address, wherein the second buffer area queue corresponds to the fourth virtual network card; alternatively, the first and second electrodes may be,
the third virtual network card caches the data packet in a third buffer area queue and sends the cache address of the data packet to a virtual processor in the domain gateway; and the virtual processor in the domain gateway sends the cache address to the fourth virtual network card according to the destination IP address.
8. The method of any of claims 1 to 3, wherein when the first application is located in the virtual domain and the second application is located in the physical domain, the system further comprises a domain gateway and the communication devices comprise inter-core communication devices and a virtual bus;
the first virtual network card determines communication equipment according to the destination IP address, and sends the data packet to the communication equipment, and the method comprises the following steps: the first virtual network card determines the domain number of the physical domain where the second application is located according to the destination IP address, and sends the data packet and the domain number to the virtual bus;
the communication device sends the data packet to a second virtual network card according to the destination IP address and the destination port number, and the method includes: when the virtual bus determines that the second application is located in the physical domain according to the domain number, the virtual bus sends the data packet to a fourth virtual network card in the domain gateway; the fourth virtual network card sends the data packet to a third virtual network card in the domain gateway according to the destination IP address; and the third virtual network card sends the data packet to the second virtual network card according to the destination IP address and the destination port number.
9. The method according to claim 8, wherein the fourth virtual network card sending the data packet to a third virtual network card in the domain gateway according to the destination IP address comprises:
the fourth virtual network card caches the data packet into a corresponding second buffer area queue; the virtual processor in the domain gateway copies the data packets in the second buffer area queue to a first buffer area queue according to the destination IP address, wherein the first buffer area queue corresponds to the third virtual network card; alternatively, the first and second electrodes may be,
the fourth virtual network card caches the data packet in a third buffer area queue and sends the cache address of the data packet to a virtual processor in the domain gateway; and the virtual processor in the domain gateway sends the cache address to the third virtual network card according to the destination IP address.
10. A chip, wherein the chip comprises: the system comprises a physical domain, a virtual network card and communication equipment, wherein the physical domain comprises a physical processor, an operating system and application, and the virtual domain comprises a virtual processor, an operating system and application;
when a first application on a first operating system needs to send data to a second application on a second operating system, and the first application and the second application are located in different domains, the first application is used for determining a destination IP address of the second operating system and a destination port number of the second application;
the first application is further configured to generate a data packet according to the data, the destination IP address, and the destination port number, and send the data packet to the first operating system;
the first operating system is used for sending the data packet to a first virtual network card, and the first virtual network card corresponds to the first operating system;
the first virtual network card is used for determining communication equipment according to the destination IP address and sending the data packet to the communication equipment;
the communication device is configured to send the data packet to a second virtual network card according to the destination IP address and the destination port number, where the second virtual network card corresponds to the second operating system;
the second virtual network card is used for sending the data packet to a second operating system;
the second operating system is configured to send the data in the data packet to the second application according to the destination IP address and the destination port number in the data packet;
wherein when the first application and the second application are both located in the physical domain, the communication device is an inter-core communication device; when the first application and the second application are both located in the virtual domain, the communication device is a virtual bus; when the first application is located in the physical domain and the second application is located in the virtual domain, or when the first application is located in the virtual domain and the second application is located in the physical domain, the system further includes a domain gateway, and the communication device includes an inter-core communication device and a virtual bus.
CN202110107948.7A 2021-01-27 2021-01-27 Hybrid heterogeneous virtualization communication method and chip Active CN112433826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110107948.7A CN112433826B (en) 2021-01-27 2021-01-27 Hybrid heterogeneous virtualization communication method and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110107948.7A CN112433826B (en) 2021-01-27 2021-01-27 Hybrid heterogeneous virtualization communication method and chip

Publications (2)

Publication Number Publication Date
CN112433826A CN112433826A (en) 2021-03-02
CN112433826B true CN112433826B (en) 2021-04-20

Family

ID=74697312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110107948.7A Active CN112433826B (en) 2021-01-27 2021-01-27 Hybrid heterogeneous virtualization communication method and chip

Country Status (1)

Country Link
CN (1) CN112433826B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115145645B (en) * 2022-09-01 2022-11-25 南京芯驰半导体科技有限公司 Touch screen control method, system and chip supporting multiple operating systems
CN116052617B (en) * 2023-03-29 2023-06-27 南京芯驰半导体科技有限公司 Screen brightness control system, method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077138B (en) * 2014-06-27 2017-08-29 中国科学院计算技术研究所 The multiple-core processor systems and its integrated approach and implementation method of a kind of integrated network router
CN105528253A (en) * 2015-11-24 2016-04-27 无锡江南计算技术研究所 A running water form communication parallel method for a heterogeneous many-core system
US11323335B2 (en) * 2016-10-18 2022-05-03 Telefonaktiebolaget Lm Ericsson (Publ) SLA handling in network slices
DE112018003399T5 (en) * 2017-07-01 2020-03-12 Intel Corporation METHOD AND DEVICES FOR VEHICLE RADIO COMMUNICATIONS
CN111480150A (en) * 2017-11-02 2020-07-31 芯力能简易股份公司 Software environment for control engine debugging, testing, calibration and tuning

Also Published As

Publication number Publication date
CN112433826A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
US11934341B2 (en) Virtual RDMA switching for containerized
US10698717B2 (en) Accelerator virtualization method and apparatus, and centralized resource manager
KR102103596B1 (en) A computer cluster arragement for processing a computation task and method for operation thereof
US8156503B2 (en) System, method and computer program product for accessing a memory space allocated to a virtual machine
US7996569B2 (en) Method and system for zero copy in a virtualized network environment
US8806025B2 (en) Systems and methods for input/output virtualization
US9154451B2 (en) Systems and methods for sharing devices in a virtualization environment
WO2022095348A1 (en) Remote mapping method and apparatus for computing resources, device and storage medium
US20080263544A1 (en) Computer system and communication control method
US8417848B2 (en) Method and apparatus for implementing multiple service processing functions
CN112433826B (en) Hybrid heterogeneous virtualization communication method and chip
CN103346981A (en) Virtual exchange method, related device and computer system
JP2016509700A (en) Method, apparatus, and program product for performing communication channel failover in a clustered computer system (communication channel failover in high performance computing (HPC) networks)
CN113614722A (en) Process-to-process secure data movement in a network function virtualization infrastructure
CN107133109B (en) Method and device for communication between modules and computing equipment
US9069592B2 (en) Generic transport layer mechanism for firmware communication
Huang et al. Nomad: migrating OS-bypass networks in virtual machines
US10649915B1 (en) Disaggregated computing architecture using device pass-through wherein independent physical address spaces between systems nodes are implemented in a single execution environment
CN112003794B (en) Floating IP current limiting method, system, terminal and storage medium
CN106790162B (en) Virtual network optimization method and system
CN111290829A (en) Access control module, virtual machine monitor and access control method
CN115269174A (en) Data transmission method, data processing method and related products
CN113722110B (en) Computer system, memory access method and device
CN117519908B (en) Virtual machine thermomigration method, computer equipment and medium
KR20140098430A (en) Device and method for fowarding network frame in virtual execution environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant