Data caching method, data processing method, computer device and storage medium

文档序号:1694450 发布日期:2019-12-10 浏览:17次 中文

阅读说明:本技术 数据缓存方法、数据处理方法、计算机设备、存储介质 (Data caching method, data processing method, computer device and storage medium ) 是由 陈静 于 2018-05-30 设计创作,主要内容包括:本申请实施例公开了一种数据缓存方法和装置。所述方法包括:获取虚拟网络接口组件的虚拟数据缓冲区的虚拟位置信息,将实体网络接口组件的实体数据缓冲区的实体位置信息指定为所述虚拟位置信息,在将数据存入所述实体数据缓冲区时,根据所述虚拟位置信息进行存储,由于实体网络接口组件的实体数据缓冲区的实体位置信息指定为虚拟位置信息,而不是通过物理设备分配来确定,所以实体网络接口组件接收到数据后,可以直接将接收到的数据存到虚拟网络接口组件指定的数据缓冲区,避免了将数据从实体网络接口组件指定的数据缓冲区拷贝到虚拟网络接口组件指定的数据缓冲区的处理,继而减少了接收数据的耗时,提高了数据接收的网络性能,降低了网络延迟。(the embodiment of the application discloses a data caching method and device. The method comprises the following steps: the method comprises the steps of acquiring virtual position information of a virtual data buffer area of a virtual network interface component, designating the entity position information of an entity data buffer area of the entity network interface component as the virtual position information, storing data into the entity data buffer area according to the virtual position information, and directly storing the received data into the data buffer area designated by the virtual network interface component after the entity network interface component receives the data because the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information instead of being determined by physical equipment allocation, thereby avoiding the process of copying the data from the data buffer area designated by the entity network interface component to the data buffer area designated by the virtual network interface component, further reducing the time consumption of receiving the data and improving the network performance of data receiving, network latency is reduced.)

1. A method for caching data, comprising:

Acquiring virtual position information of a virtual data buffer area of a virtual network interface component;

Designating entity location information of an entity data buffer of an entity network interface component as the virtual location information;

And when the data is stored in the entity data buffer area, storing according to the virtual position information.

2. The method of claim 1, wherein prior to said obtaining virtual location information for a virtual data buffer of a virtual network interface component, the method further comprises:

allocating a virtual storage space for the virtual network interface component;

determining virtual location information for a plurality of virtual data buffers in the virtual storage space.

3. the method of claim 2, wherein determining the virtual location information for the plurality of virtual data buffers in the virtual storage space comprises:

creating a virtual receive queue for the virtual network interface component, the virtual receive queue comprising virtual buffer control information;

Acquiring the virtual position information from the virtual storage space;

Adding the virtual location information to the virtual buffer control information.

4. The method of claim 3, wherein obtaining the virtual location information of the data buffer of the virtual network interface component comprises:

And detecting virtual position information in the virtual receiving queue.

5. the method of claim 4, wherein prior to said detecting the virtual location information in the virtual receive queue, the method further comprises:

Receiving a notification that initialization of the virtual network interface component is complete.

6. The method of claim 1, wherein designating entity location information of an entity data buffer of a physical network interface component as the virtual location information comprises:

Converting the virtual location information to an entity physical address;

And determining the entity position information of the entity data buffer area according to the entity physical address.

7. The method of claim 6, wherein the determining entity location information of the entity data buffer according to the entity physical address comprises:

Adding the entity physical address to entity buffer control information of the entity data buffer.

8. The method of claim 7, wherein prior to said designating entity location information of an entity data buffer of a physical network interface component as said virtual location information, the method further comprises:

creating an information queue consisting of the entity buffer control information and an empty entity storage space;

the adding the entity physical address to the entity buffer control information of the entity data buffer comprises:

Acquiring entity buffer control information in the information queue;

Adding the entity physical addresses to the obtained entity buffer control information in sequence;

and storing the entity buffer control information into the entity storage space.

9. The method of claim 8, wherein before storing the data in the physical data buffer according to the virtual location information, the method further comprises:

acquiring entity buffer control information in the entity storage space;

creating an entity receive queue for the entity network interface component;

adding the entity buffer control information to the entity receive queue.

10. The method of claim 1, wherein the virtual network interface component is mapped one-to-one with an entity receive queue of an entity network interface component, the entity receive queue is mapped one-to-one with an entity data buffer, and wherein storing data in the entity data buffer according to the virtual location information comprises:

Determining a virtual network interface component to be sent according to the data;

receiving a queue from an entity corresponding to the virtual network interface component, and acquiring entity position information of a corresponding entity data buffer area;

and storing the data according to the entity position information.

11. The method of claim 10, wherein the obtaining entity location information of the corresponding entity data buffer from the entity receive queue corresponding to the virtual network interface component comprises:

Acquiring entity buffer control information in the entity receiving queue, wherein the entity buffer control information comprises entity position information;

after the storing the data according to the entity location information, the method further comprises:

in the entity buffer control information, received data is marked so that a physical machine detects the received data.

12. The method of claim 11, further comprising:

according to the entity buffering control information, marking the received data in the virtual buffering control information in the virtual receiving queue of the virtual network interface component, so that the virtual network interface component detects the received data.

13. The method of claim 11, further comprising:

and notifying the virtual network interface component of receiving data according to the entity cache control information.

14. A data processing method, comprising:

receiving a data storage instruction, wherein the data storage instruction is used for storing data into an entity position of an entity data buffer of an entity network interface component;

acquiring a virtual position of a virtual data buffer area of a virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component;

Storing the data in the virtual location.

15. a computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to one or more of claims 1-14 when executing the computer program.

16. a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to one or more of claims 1-14.

Technical Field

The present application relates to the field of data processing technologies, and in particular, to a data caching method, a data processing method, a computer device, and a computer-readable storage medium.

background

In a virtual network, a Virtual Machine (VM) simulated on a physical machine (the physical machine may also be referred to as a physical computer, a computer device, or a host device) provides network services such as a virtual switch (vSwitch) and a Tunnel End (TEP). vSwitch is a pure software implementation and also provides good network throughput performance, but has a major problem that it needs to occupy a part of CPU and memory resources on a physical machine, which is not beneficial to the resource utilization of the physical machine.

In the above background, the smart network card solution is generated, and the main point is to sink the vSwitch function into the smart network card, release more physical machine resources to the client, and expect to provide better network throughput capability.

the applicant finds, through research, that, in the process of receiving a message, after a network card of a physical machine receives the message sent to a virtual machine, the message must be stored in a data buffer area specified by a network card driver, and then the data is copied into the data buffer area specified by the virtual network card of the virtual machine, so that the problem that the data needs to be copied in the process of receiving the data is caused.

Disclosure of Invention

in view of the above, the present application is proposed to provide a data caching method, a data processing method, and a computer device, a computer readable storage medium that overcome or at least partially solve the above problems.

According to an aspect of the present application, there is provided a data caching method, including:

Acquiring virtual position information of a virtual data buffer area of a virtual network interface component;

designating entity location information of an entity data buffer of an entity network interface component as the virtual location information;

And when the data is stored in the entity data buffer area, storing according to the virtual position information.

Optionally, before the obtaining the virtual location information of the virtual data buffer of the virtual network interface component, the method further includes:

Allocating a virtual storage space for the virtual network interface component;

determining virtual location information for a plurality of virtual data buffers in the virtual storage space.

optionally, the determining the virtual location information of the plurality of virtual data buffers in the virtual storage space includes:

creating a virtual receive queue for the virtual network interface component, the virtual receive queue comprising virtual buffer control information;

acquiring the virtual position information from the virtual storage space;

Adding the virtual location information to the virtual buffer control information.

Optionally, the obtaining the virtual location information of the data buffer of the virtual network interface component includes:

and detecting virtual position information in the virtual receiving queue.

optionally, before the detecting the virtual location information in the virtual receive queue, the method further includes:

Receiving a notification that initialization of the virtual network interface component is complete.

optionally, the designating the entity location information of the entity data buffer of the entity network interface component as the virtual location information includes:

Converting the virtual location information to an entity physical address;

and determining the entity position information of the entity data buffer area according to the entity physical address.

Optionally, the determining, according to the entity physical address, the entity location information of the entity data buffer includes:

adding the entity physical address to entity buffer control information of the entity data buffer.

optionally, before the designating the entity location information of the entity data buffer of the entity network interface component as the virtual location information, the method further comprises:

Creating an information queue consisting of the entity buffer control information and an empty entity storage space;

the adding the entity physical address to the entity buffer control information of the entity data buffer comprises:

Acquiring entity buffer control information in the information queue;

adding the entity physical addresses to the obtained entity buffer control information in sequence;

And storing the entity buffer control information into the entity storage space.

Optionally, before the storing the data into the entity data buffer according to the virtual location information, the method further includes:

Acquiring entity buffer control information in the entity storage space;

Creating an entity receive queue for the entity network interface component;

Adding the entity buffer control information to the entity receive queue.

Optionally, the virtual network interface component and the entity receiving queue of the entity network interface component are mapped one to one, the entity receiving queue and the entity data buffer are mapped one to one, and when storing data in the entity data buffer, storing according to the virtual location information includes:

determining a virtual network interface component to be sent according to the data;

receiving a queue from an entity corresponding to the virtual network interface component, and acquiring entity position information of a corresponding entity data buffer area;

and storing the data according to the entity position information.

Optionally, the receiving the queue from the entity corresponding to the virtual network interface component, and acquiring the entity location information of the corresponding entity data buffer includes:

Acquiring entity buffer control information in the entity receiving queue, wherein the entity buffer control information comprises entity position information;

after the storing the data according to the entity location information, the method further comprises:

In the entity buffer control information, received data is marked so that a physical machine detects the received data.

optionally, the method further comprises:

According to the entity buffering control information, marking the received data in the virtual buffering control information in the virtual receiving queue of the virtual network interface component, so that the virtual network interface component detects the received data.

optionally, the method further comprises:

And notifying the virtual network interface component of receiving data according to the entity cache control information.

correspondingly, according to another aspect of the present application, there is also provided a data processing method, including:

receiving a data storage instruction, wherein the data storage instruction is used for storing data into an entity position of an entity data buffer of an entity network interface component;

acquiring a virtual position of a virtual data buffer area of a virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component;

storing the data in the virtual location.

Accordingly, according to another aspect of the present application, there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to one or more of the above when executing the computer program.

accordingly, according to another aspect of the present application, there is also provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as one or more of the above.

According to the embodiment of the application, the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information by acquiring the virtual position information of the virtual data buffer area of the virtual network interface component, and the data is stored in the entity data buffer area according to the virtual position information, so that the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information instead of being determined by physical equipment allocation, the received data can be directly stored in the data buffer area designated by the virtual network interface component after the entity network interface component receives the data, the processing of copying the data from the data buffer area designated by the entity network interface component to the data buffer area designated by the virtual network interface component is avoided, and the time consumption of receiving the data is reduced, the network performance of data receiving is improved, and the network delay is reduced.

the foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.

Drawings

Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:

FIG. 1 shows a schematic diagram of deploying a virtual machine;

FIG. 2 shows a schematic diagram of a data caching process;

FIG. 3 is a flowchart illustrating an embodiment of a data caching method according to a first embodiment of the present application;

FIG. 4 is a flowchart illustrating an embodiment of a data caching method according to a second embodiment of the present application;

FIG. 5 is a flow chart of an embodiment of a data processing method according to the third embodiment of the present application;

FIG. 6 is a schematic diagram illustrating a data caching process without optimization;

FIG. 7 is a schematic diagram illustrating an optimized data caching process;

Fig. 8 is a block diagram illustrating a structure of a fourth embodiment of a data caching apparatus according to the present application;

FIG. 9 is a block diagram of an embodiment of a data processing apparatus according to the fifth embodiment of the present application;

Fig. 10 illustrates an exemplary system that can be used to implement various embodiments described in this disclosure.

Detailed Description

Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

To enable those skilled in the art to better understand the present application, the following description is made of the concepts related to the present application:

the virtual network interface component includes an interface for connecting a virtual machine and a transmission medium in a virtual network, may receive data from the network for the virtual machine to use, and may specifically include any suitable virtual network interface component, which is not limited in this embodiment of the present application. For example, as shown in the schematic diagram of deploying virtual machines in fig. 1, an intelligent network card with a vSwitch function is used on a physical machine, and each virtual machine on the physical machine uses a virtual-net as a virtual network card interface (i.e., a virtual network interface component).

The virtual network interface component pre-specifies a virtual data buffer area for storing data and processing data, for example, the memory area of the designated location driven by the virtual-net interface may specifically include any applicable virtual data buffer area, which is not limited in this embodiment of the present application.

Correspondingly, the virtual location information is used to specify the location of the virtual data buffer, for example, the virtio-net interface drives the memory addresses of the multiple virtual data buffers specified in the memory pool, and may specifically include any applicable virtual location information, which is not limited in this embodiment of the present application.

The entity network interface component includes an interface for connecting a physical machine and a transmission medium in a network, and may receive data from the network for the physical machine to use, and specifically may include any applicable entity network interface component, which is not limited in this embodiment of the present application. For example, as shown in fig. 1, the physical machine employs an intelligent network card with vSwitch function, i.e., a physical network interface component. It should be noted that, because the industry generally adopts a standard virtual network interface, and the current intelligent network card does not support a veriio-net virtual network interface, the traffic on the network cannot be directly sent to the virtual machine, but only to the VF device (a function associated with the physical function) of the SRIOV (a hardware-based virtualization solution), the VF device of each SRIOV on the physical machine has a one-to-one mapping relationship with the virtual-net interface of the virtual machine, and the conversion from the VF device to the virtual-net interface is completed through a simple forwarding program on the physical machine, so as to connect the virtual machine network with the physical network card.

The entity network interface component pre-designates an entity data buffer area for storing data and processing data, for example, the memory area at the designated position driven by the intelligent network card may specifically include any applicable entity data buffer area, which is not limited in this embodiment of the present application.

correspondingly, the entity location information is used to specify the location of the entity data buffer, for example, the memory addresses of the entity data buffers specified in the memory pool driven by the intelligent network card may specifically include any applicable entity location information, which is not limited in this embodiment of the present application.

In an optional embodiment of the present APPlication, a kernel of the virtual machine or an APP (APPlication) running on the virtual machine may allocate a virtual storage space to the virtual network interface component, and provide the virtual network interface component as a storage area of data, where the virtual storage space may include a plurality of virtual data buffers. For example, the kernel or APP of the virtual machine initializes a mem pool, i.e., a virtual storage space, and provides the memory area as a message to the virtio-net interface driver.

in an alternative embodiment of the present application, a virtual receive queue needs to be created for the virtual network interface component, which is used for software driver and hardware to communicate, and mainly stores control information for receiving message data from the network. Each element of the virtual receive queue is referred to as virtual buffer control information, which is used to describe characteristics and states of the virtual data buffer, such as packet length, data buffer length, and the like. The formats and sizes of the virtual buffer control information defined by different network devices are different, but at least include the address of the virtual data buffer, which is not limited in the embodiments of the present application.

For example, a driver of the vertio-net interface performs device initialization, and finally rxq (receive queue) is initialized, rxq is essentially a queue for the software driver and the hardware to communicate, each element of the queue is called a descriptor (i.e., virtual cache control information), the descriptor is a data format defined by a network card and used for receiving and transmitting a message queue and software communication, and each network device defines that the descriptor at least includes an address of a data buffer (data buffer).

in an optional embodiment of the present application, the virtual location information is defined by the virtual machine, and is not a physical address (i.e., a physical address) on a hardware storage device of the physical machine, and includes a memory address or a hard disk address on the physical machine, or any other applicable physical address, which is not limited in this embodiment of the present application. The virtual location information of the virtual machine may be translated to a physical address.

In an optional embodiment of the present application, the entity buffer control information is used to describe characteristics and states of an entity data buffer, such as a packet length, a data buffer length, and the like, and formats and sizes of the entity buffer control information defined by different network devices are different, but at least include an address of the entity data buffer, or any other suitable information, which is not limited in this embodiment of the present application.

For example, each element of the memory pool is not only a data buffer, but each data buffer should include a control structure, i.e. a data set composed of data of the same type or different types, which is referred to as entity cache control information in this application, and it is assumed that mem pool of the physical machine defines a control structure named bctl:

typedef struct buf ctrl{

void*addr

……

}bctl。

In an alternative embodiment of the present application, the information queue is used for storing entity buffer control information, that is, each element of the queue is entity buffer control information. And the physical storage space is distributed on the physical machine and used as a storage area of the data.

in an alternative embodiment of the present application, an entity receive queue needs to be created for the entity network interface component, which is used for software driver and hardware to communicate, and mainly stores control information for receiving message data from the network. Each element of the entity receive queue is referred to as entity buffer control information.

In an optional embodiment of the present application, since the intelligent network card with a vSwitch function is used on the physical machine, after the intelligent network card receives data, the data for different virtual machines can be distributed to corresponding VF devices, and the VF devices are used as outlets of the intelligent network card and need to have entity receiving queues corresponding to the physical machine. And the entity receiving queues and the entity data buffers are also mapped one by one, so that data sent to different virtual machines can be buffered to different entity data buffers through different entity receiving queues.

according to an embodiment of the application, in a process of receiving a message, after a network card of a physical machine receives the message sent to a virtual machine, the message must be stored in a data buffer area specified by a network card driver, and then data is copied to the data buffer area specified by the virtual network card of the virtual machine, so that the problem that the data needs to be copied in the process of receiving the data is caused. As shown in the schematic diagram of the data caching process shown in fig. 2, the present application provides a data caching mechanism, by acquiring the virtual location information of the virtual data buffer of the virtual network interface component, designating the entity location information of the entity data buffer of the entity network interface component as the virtual location information, and storing data in the entity data buffer according to the virtual location information, since the entity location information of the entity data buffer of the entity network interface component is designated as the virtual location information instead of being determined by physical device allocation, after the entity network interface component receives the data, the received data can be directly stored in the data buffer designated by the virtual network interface component, thereby avoiding the process of copying the data from the data buffer designated by the entity network interface component to the data buffer designated by the virtual network interface component, and the time consumption for receiving data is reduced, the network performance for receiving the data is improved, and the network delay is reduced. The present application is applicable to, but not limited to, the above application scenarios.

Referring to fig. 3, a flowchart of an embodiment of a data caching method according to an embodiment of the present application is shown, where the method specifically includes the following steps:

Step 101, obtaining virtual location information of a virtual data buffer of a virtual network interface component.

in the embodiment of the present application, after the virtual network interface component is initialized, the virtual location information of the virtual data buffer can be obtained. For example, the rxq queue of the virtio-net interface is scanned to obtain information of all data buffer (i.e., virtual data buffer) pointers. The method may specifically include acquiring the virtual location information in any suitable manner, which is not limited in this embodiment of the present application.

step 102, appointing entity position information of an entity data buffer area of an entity network interface component as the virtual position information;

in the embodiment of the present application, in the initialization process of the physical network interface component, the physical machine originally specifies the physical location information, which results in that the locations of the physical data buffer and the virtual data buffer are different. In order to avoid copying the received data from the entity data buffer to the virtual data buffer, the entity location information of the entity data buffer is directly specified as the acquired virtual location information. There are various ways to designate the entity location information as the virtual location information, which is not limited in this embodiment of the present application.

for example, a forwarder on a physical machine creates a queue, the elements of each queue being the control structure of the previously defined bctl. The physical machine creates an empty memory pool without any data buffer or control structure inside. And the forwarding program of the physical machine receives the notification of the initialization completion of the virtio-net interface, scans rxq virtual receiving queues of the virtio-net interface and obtains the information of all data buffer pointers. Converting the virtual position information of the data buffer into a physical address of the physical machine, then obtaining a control structure body bctl without the data buffer from the queue, assigning the entity position information in the bctl into the physical address converted by the virtual position information through assignment, and finally queuing the control structure body bctl into a memory pool, wherein the data buffer of the memory pool of the physical machine is essentially the address allocated by the virtual machine. Then, when the forwarder initializes the rxq entity receiving queue of the physical network interface component, the entity location information is obtained from the memory pool dequeuing, which is actually the virtual location information allocated by the virtual machine.

And 103, storing the data according to the virtual position information when the data is stored in the entity data buffer area.

after the entity network interface component receives data from the network, the data is firstly cached in a memory on the entity network interface component, and then the vSwitch function determines that the data should be sent to a certain virtual machine according to the data. Before being sent to the virtual machine, the data needs to be stored in an entity data buffer on the physical machine, and then the data is sent to the virtual machine by a forwarding program.

In this embodiment, when data is stored in an entity data buffer, an entity receiving queue corresponding to the virtual machine is read, and information of the entity data buffer is obtained from the entity receiving queue, where the entity data buffer is filled in a previous initialization process. Next, the hardware sends the data to the designated physical machine Memory in a DMA (Direct Memory Access) manner, that is, when the data is stored in the physical data buffer, the physical location information is designated as the virtual location information, so that the data is actually stored according to the virtual location information. Only then need to set up the corresponding control information, indicate that there is already data on the network to reach the entity data buffer of the entity network interface component. The forwarding program finds that the data is delivered according to the control information, and the forwarding program correspondingly updates the control information of the virtual network interface component according to the virtual machine to which the data is delivered, or actively informs the virtual network interface component, and finally the virtual machine can be informed to access the data in the virtual data buffer area according to the virtual position information when the virtual network interface component finds that the data is delivered.

in the embodiment of the present application, since data is stored in the entity data buffer according to the virtual location information, that is, the entity data buffer and the virtual data buffer are in the same location, for a physical machine, the entity data buffer is stored, for a virtual machine, the data is already stored in the virtual data buffer, and it is not necessary to copy the data from the entity data buffer to the virtual data buffer, and as long as the virtual machine is notified of the data delivery, the data can be retrieved from the virtual data buffer.

according to the embodiment of the application, the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information by acquiring the virtual position information of the virtual data buffer area of the virtual network interface component, and the data is stored in the entity data buffer area according to the virtual position information, so that the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information instead of being determined by physical equipment allocation, the received data can be directly stored in the data buffer area designated by the virtual network interface component after the entity network interface component receives the data, the processing of copying the data from the data buffer area designated by the entity network interface component to the data buffer area designated by the virtual network interface component is avoided, and the time consumption of receiving the data is reduced, the network performance of data receiving is improved, and the network delay is reduced.

Referring to fig. 4, a flowchart of an embodiment of a data caching method according to the second embodiment of the present application is shown, where the method specifically includes the following steps:

step 201, allocating a virtual storage space for the virtual network interface component.

In the embodiment of the present application, in order to avoid copying data from the physical data buffer to the virtual data buffer, the initialization process needs to be optimized first. In the initialization process of the virtual machine, the method comprises the step of preparing the virtual storage space. That is, a virtual storage space is allocated to the virtual network interface component, and is provided for the drive of the virtual network interface component as a storage area of data. The mem pool contains a virtual data buffer for filling the message data.

for example, a kernel or APP of the virtual machine is responsible for initializing a mem pool (i.e., virtual storage space) and providing the memory area as a message to a driver of the virtio-net interface.

Step 202, determining virtual location information of a plurality of virtual data buffers in the virtual storage space.

In this embodiment of the present application, the virtual storage space includes a plurality of virtual data buffers, and the virtual network interface component needs to determine the virtual location information of the plurality of virtual data buffers first, and specifically may continuously dequeue from the virtual storage space allocated for the virtual network interface component to obtain the virtual location information of a new virtual data buffer. The method may specifically include any suitable method, and the embodiment of the present application is not limited thereto.

In an embodiment of the present application, optionally, one implementation manner of determining virtual location information of a plurality of virtual data buffers in the virtual storage space may include:

substep S1, creating a virtual receive queue of the virtual network interface component, the virtual receive queue comprising virtual buffer control information;

A substep S2 of acquiring the virtual location information from the virtual storage space;

sub-step S3, adding the virtual location information to the virtual buffer control information.

For example, the driver of the virtio-net interface performs device initialization and eventually initializes rxq the virtual receive queue. rxq is called descriptor, i.e., virtual buffer control information. The process of initializing rxq the queue includes populating each descriptor with a data buffer pointer that points to a valid virtual data buffer, referred to herein as a GPA (Guest Physical Address, Physical Address of the virtual machine). The driving is by continuously dequeuing from mem pool to obtain the virtual location information of the new virtual data buffer, and then filling into the descriptor (i.e. the virtual buffer control information).

step 203, receiving the notification of the initialization completion of the virtual network interface component.

in this embodiment of the present application, after the initialization of the virtual network interface component is completed, the virtual receive queue of the virtual network interface component may be enabled to prepare for receiving the data packet on the network. The forwarder of the physical machine receives the notification that the initialization of the virtual network interface component is completed, and then performs step 204.

Step 204, detecting the virtual position information in the virtual receiving queue.

In the embodiment of the present application, after receiving a notification that initialization of a virtual network interface component is completed, a virtual receive queue of the virtual network interface component is scanned and detected, and virtual location information of all virtual data buffers is obtained. For example, the rxq queue of the virtio-net interface is scanned to obtain information of all data buffer pointers, i.e., virtual location information.

Step 205, converting the virtual location information into an entity physical address.

In the embodiment of the present application, the virtual data buffer used by the virtual machine is also on the physical machine, but the virtual location information of the virtual machine is of the virtual data buffer used by the virtual machine, and after virtualization, the virtual location information is different from the physical address on the physical machine, but has a corresponding relationship. In order to determine the physical address of the physical machine, it is necessary to perform conversion according to the virtual location information and the corresponding relationship between the virtual location relationship and the physical address. For example, GPA of the data buffer is converted into HPA (Host Physical Address).

Step 206, determining the entity location information of the entity data buffer according to the entity physical address.

in this embodiment of the present application, after the virtual location information is converted into the physical address, the physical location information of the physical data buffer may be determined according to the physical address, and specifically, the physical location information may be equal to the physical address by assigning a value.

In an embodiment of the present application, optionally, an implementation manner of determining the entity location information of the entity data buffer according to the entity physical address may include: adding the entity physical address to entity buffer control information of the entity data buffer.

the entity buffer control information of the entity data buffer area comprises entity position information, and the other entity position information is equal to the entity physical address through assignment operation, namely the entity physical address is added to the entity buffer control information. Specifically, the physical address may be added to the physical buffer control information of the physical data buffer in any suitable manner, which is not limited in this embodiment of the present application.

In an embodiment of the present application, optionally, before specifying the entity location information of the entity data buffer of the entity network interface component as the virtual location information, the method may further include: creating an information queue consisting of the entity buffer control information and an empty entity storage space; accordingly, one implementation of the entity buffer control information for adding the entity physical address to the entity data buffer may include: acquiring entity buffer control information in the information queue; adding the entity physical addresses to the obtained entity buffer control information in sequence; and storing the entity buffer control information into the entity storage space.

For example, after the virtio-net interface is initialized, a forwarding program on the physical machine creates a queue (queue), i.e., an information queue, and each element of the queue is a control structure bctl of a defined data buffer, which may also be referred to as a descriptor, i.e., entity buffer control information. An empty mem pool is also created without any databuffer or control structure inside. After the virtual position information is converted into an entity physical address, a control structure body bctl without a data buffer is obtained from an information queue, wherein the addr is made to be GPA, and finally enqueue is sent to mem pool (namely an entity storage space), and at this time, the data buffer of the mem pool is essentially the virtual position information distributed by the virtual machine.

step 207, obtaining the entity buffer control information in the entity storage space.

In the embodiment of the present application, when an entity receive queue of an entity network interface component is initialized, entity buffer control information is obtained from an entity storage space, where the entity buffer control information includes entity location information and is essentially designated virtual location information.

for example, when the forwarding program initializes the rxq entity receiving queue of the smart network card (i.e. the physical network interface component), the data buffer pointer filled from the mem pool (i.e. the physical storage space) queue is actually the virtual location information of the virtual machine.

at step 208, an entity receive queue of the entity-network interface component is created.

In the embodiment of the present application, the entity network interface component initialization process includes initialization of an entity receive queue, that is, creating the entity receive queue. The entity receiving queue can comprise a plurality of entity receiving queues, and the entity receiving queues are correspondingly created for different virtual network interface components.

step 209, add the entity buffer control information to the entity receive queue.

In this embodiment of the application, the obtained entity buffer control information is added to an entity receiving queue, for example, an rxq entity receiving queue of the smart card, and the entity buffer control information is added to all rxq in a descriptor format, that is, a pointer of a data buffer (i.e., an entity data buffer) filled by the descriptor is actually a data buffer (i.e., a virtual data buffer) pointer of the virtual machine.

Step 210, determining a virtual network interface component to be sent according to the data.

in the embodiment of the present application, after the virtual network interface component and the physical network interface component are initialized and enabled, the virtual network interface component and the physical network interface component can start to receive the message data on the network.

In the embodiment of the present application, the virtual network interface component and the entity receiving queue of the entity network interface component are mapped one to one, and the entity receiving queue and the entity data buffer are mapped one to one. The physical network interface component has a vSwitch function, that is, the physical network interface component determines to which virtual machine the message data is to be sent, rather than sending the message data to the physical machine first, and the physical machine determines to which virtual machine the message data is to be sent. Therefore, the virtual network interface component to be sent, i.e. the virtual machine to be sent, is determined from the data.

for example, the smart network card receives a message data from the network, and buffers the message data in the memory of the network card, and then the vSwitch function determines that the message data should be sent to a virtual machine, that is, a virtual network interface component, according to the header of the message.

step 211, receiving the queue from the entity corresponding to the virtual network interface component, and obtaining the entity location information of the corresponding entity data buffer.

in the embodiment of the present application, the virtual network interface component and the entity receive queues of the entity network interface component are mapped one to one, that is, different virtual network interface components correspond to different entity receive queues. In order to allow data to be sent to a virtual network interface component to be sent, it is necessary to receive a queue from an entity corresponding to the virtual network interface component and obtain entity location information of a corresponding entity data buffer. The method may specifically include any suitable method for obtaining the entity location information, which is not limited in this embodiment of the present application.

step 212, storing the data according to the entity position information.

in the embodiment of the present application, the obtained entity location information is essentially virtual location information, and therefore, data is stored according to the entity location information, that is, the data is stored according to the virtual location information.

In an embodiment of the present application, optionally, an implementation manner of obtaining entity location information of a corresponding entity data buffer from an entity receive queue corresponding to the virtual network interface component may include:

acquiring entity buffer control information in the entity receiving queue, wherein the entity buffer control information comprises entity position information;

after the storing the data according to the entity location information, the method may further include:

in the entity buffer control information, received data is marked so that a physical machine detects the received data.

for example, on the physical machine, the descriptor (i.e., the entity buffer control information) in the corresponding entity receive queue is read, and information of an entity data buffer, which is filled in the previous initialization process and includes the entity location information, is obtained. After the data is stored, in order to enable the physical machine to find that the data is stored, a corresponding control bit in a descriptor can be set, and the received data is marked, so that the forwarding program of the physical machine can detect the received data.

In an embodiment of the present application, optionally, the method may further include: according to the entity buffering control information, marking the received data in the virtual buffering control information in the virtual receiving queue of the virtual network interface component, so that the virtual network interface component detects the received data.

in order for the virtual network interface component to detect the received data, when it is detected that the physical buffer control information marks the received data, the received data is also marked in the virtual buffer control information in the virtual receive queue of the virtual network interface component. For example, the forwarder finds rxq (i.e. the entity buffer control information) update in the entity receive queue), marks the update, marks the received message data, and determines to send to rxq (i.e. the virtual receive queue) of the virtual network interface (i.e. the virtual network interface component) after certain logic checks, such as whether the message length meets the requirement, type check of the message, etc., and the forwarder updates the descriptor (i.e. the virtual buffer control information) corresponding to the virtual network interface, and changes the state of the corresponding control bit to mark the received data.

In an embodiment of the present application, optionally, the method may further include: and notifying the virtual network interface component of receiving data according to the entity cache control information.

the received data is marked in the virtual buffer control information in the virtual receiving queue of the virtual network interface component in a passive mode, so that the virtual network interface component can detect the received data only by detecting the virtual buffer control information through the virtual network interface component. Another implementation may directly notify the virtual network interface component of the receipt of the data by way of an interrupt. And finally, the virtual network interface component finds that the message data is received, informs a virtual machine kernel or an APP to process the data, and the whole receiving process is finished.

according to the embodiment of the application, by allocating a virtual storage space for a virtual network interface component, determining virtual location information of a plurality of virtual data buffers in the virtual storage space, receiving a notification of completion of initialization of the virtual network interface component, detecting the virtual location information in a virtual receive queue, converting the virtual location information into an entity physical address, determining entity location information of the entity data buffers according to the entity physical address, obtaining entity buffer control information in the entity storage space, creating an entity receive queue of the entity network interface component, adding the entity buffer control information to the entity receive queue, determining a virtual network interface component to be transmitted according to data, obtaining entity location information of a corresponding entity data buffer from the entity receive queue corresponding to the virtual network interface component, according to the entity location information, the data is stored, and the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information instead of being determined by physical equipment allocation, so that the received data can be directly stored in the data buffer area designated by the virtual network interface component after the entity network interface component receives the data, the processing that the data is copied from the data buffer area designated by the entity network interface component to the data buffer area designated by the virtual network interface component is avoided, the time consumption of receiving the data is reduced, the network performance of data receiving is improved, and the network delay is reduced.

referring to fig. 5, a flowchart of an embodiment of a data processing method according to a third embodiment of the present application is shown, where the method specifically includes the following steps:

step 301, receiving a data storage instruction.

In an embodiment of the present application, the data storage instruction is for storing data at a physical location of a physical data buffer of the physical network interface component. The location of the physical data buffer is denoted as the physical location, and correspondingly, the location of the virtual data buffer of the virtual network interface component is denoted as the virtual location.

Step 302, obtaining the virtual position of the virtual data buffer area of the virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component.

In the embodiment of the present application, after the intelligent network card (i.e., the physical network interface component) implements the vSwitch function, when data is stored in the physical data buffer, the data needs to be stored in the corresponding physical data buffer for different virtual machines. In order to avoid copying received data from the physical data buffer to the virtual data buffer, the physical location of the physical data buffer is directly specified in advance as the virtual location of the virtual data buffer of the corresponding virtual machine. And after receiving the data storage instruction, acquiring the virtual position of the virtual data buffer area of the virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component.

one implementation may include: and storing the corresponding virtual position of the virtual machine at the entity position of the entity data buffer area of the entity network interface component, and acquiring the corresponding virtual position from the entity position when storing data in the entity position. Any suitable implementation may be specifically included, and the embodiments of the present application do not limit this.

step 303, storing the data into the virtual location.

in the embodiment of the application, after the virtual position is obtained, the data is stored in the virtual position.

According to the embodiment of the application, the virtual position of the virtual data buffer area of the virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component is obtained by receiving a data storage instruction, the data is stored in the virtual position, since the physical location of the physical data buffers of the physical network interface components are specified as virtual locations, rather than being determined by physical device allocation, therefore, after the entity network interface component receives the data, the received data can be directly stored in the data buffer area appointed by the virtual network interface component, the processing that the data is copied from the data buffer area appointed by the entity network interface component to the data buffer area appointed by the virtual network interface component is avoided, the time consumption for receiving the data is reduced, the network performance for receiving the data is improved, and the network delay is reduced.

in order to make the present application better understood by those skilled in the art, an implementation of the present application is described below by way of specific examples.

A schematic diagram of the data caching process without optimization as shown in fig. 6.

the virtual network interface component and the physical network interface component are initialized prior to receiving the data.

The virtual network interface component initializes. The initialization process includes preparing mem pool for providing data buffers (i.e., virtual data buffers). Wherein a VM (i.e., a virtual machine) includes a virtual-net RX ring (i.e., a virtual receive queue), and an element descriptor (virtual buffer control information) in the queue includes a GPA (i.e., virtual location information). The VM also comprises a Guest Memory (namely, storage available to the virtual machine), a mem pool (namely, virtual storage space) is allocated in the Guest Memory, and a data buffer in the mem pool is determined.

The physical network interface component initializes. The initialization process includes preparing mem pool for providing data buffers (i.e., physical data buffers). Wherein, the Host (i.e. physical machine) includes NIC RX ring (i.e. entity receive queue), and the element descriptor (entity buffer control information) in the queue includes Addr (i.e. entity location information). The Host also comprises a Host Memory (namely, storage available for a physical machine), a mem pool (namely, entity storage space) is allocated in the Host Memory, and data buffer in the mem pool is determined.

the process of receiving the message data is as follows:

step 1, a Smart NIC (namely an entity network interface component) receives the message and stores the message into a data buffer on the Smart NIC. vSwitch functionality is included on the Smart NIC.

and step 2, writing the data from the Smart NIC into the Host memory in a DMA mode. Reading entity buffer control information in an entity receiving queue, sending message data to a specified Host memory (namely an entity data buffer area) by hardware in a DMA mode according to entity position information in the entity buffer control information, and setting a control bit corresponding to a descriptor to indicate that network message data are sent to the entity receiving queue.

and 3, copying the data from the entity data buffer area to the virtual data buffer area. And a forwarding program on the physical machine finds that the corresponding descriptor in the virtual receiving queue of the virtio-net is updated, finds that message data is received, and decides to send the message data to a certain rxq of the virtio-net after certain logic check. And the forwarding program reads the information of the corresponding descriptor in rxq (namely the virtual receiving queue) of the virtio-net interface to acquire the address of the data buffer in the VM. The forwarder copies the data from the data buffer of the Host memory into the data buffer of the VM and updates the corresponding control bit (i.e., virtual buffer control information) of the descriptor and informs the virtio-net interface if necessary. Finally, the virtio-net interface sends and receives a message data to inform the VM of consuming the data, and the whole receiving process is finished.

A schematic diagram of the optimized data caching process shown in fig. 7.

in the initialization process:

step 1.1, the virtual network interface component is initialized, and a kernel or APP in the VM prepares a mem pool, wherein the mem pool contains a data buffer (namely a virtual data buffer) and is used for filling message data. After the virtual receive queue is initialized rxq by the virtio-net interface, the virtual receive queue is enabled rxq.

Step 1.2, scanning virtual-net RX ring (i.e. virtual receive queue) to obtain all data buffer pointers (i.e. virtual location information of virtual data buffer).

Step 1.3, the forwarding program creates a queue (queue), each element inside of which is a control structure defined as bctl.

and step 1.4, obtaining a bcll control structure body from the queue, and filling bcll.addr (namely entity position information) and enqueue into mem pool according to the data buffer pointer obtained in the step 1.2. The method specifically comprises the steps of converting GPA of the data buffer obtained in the step 1.2 into HPA, then obtaining a control structure body bctl without the data buffer from the queue, making bctl.

At step 1.5, the Smart NIC (i.e. the physical network interface component) drives the initialization rxq (i.e. the physical receive queue) to obtain the data buffer pointer (i.e. the virtual location information) of the VM from the mem pool (i.e. the physical storage space). When the forwarding program initializes rxq of the NIC network card, the entity receives the data buffer pointer filled by the descriptor in the queue from the mem pool dequeuer, which is actually the data buffer pointer prepared by the VM. The NIC network card initialization rxq is completed by the entity receiving queue, and the enabling rxq entity receiving queue can start receiving network messages.

In the process of receiving data:

And 2.1, the Smart NIC (namely the entity network interface component) receives the message and stores the message into a data buffer on the Smart NIC. vSwitch functionality is included on the Smart NIC. And the vSwitch function determines that the message is to be sent to a certain VM according to the message header.

and 2.2, storing the data into the memory of the virtual machine in a DMA mode. The descriptor (i.e. the entity buffer control information) in the entity receive queue corresponding to the VM is read to obtain the information of the entity data buffer, which is filled in the previous initialization process. Next, the hardware sends the message data to the designated Host memory in a DMA mode, and sets the control bit corresponding to the descriptor in the entity receiving queue, indicating that there is network message data sent to rxq entity receiving queue.

and 2.3, updating the descriptor (namely the virtual buffer control information) in the virtio-net RX ring. The forwarding program on Host finds rxq the descriptor update of the entity receiving queue, finds that the message data is received, and after certain logic check, decides to send to rxq (namely virtual receiving queue) of the virtio-net interface. And the forwarding program updates the descriptor in the virtio-net RX ring and informs the virtio-net interface if necessary, and finally the virtio-net interface finds that the message data is received and informs the virtual machine to consume the data, so that the whole receiving process is finished.

referring to fig. 8, a block diagram of a data caching apparatus according to a fourth embodiment of the present application is shown, which may specifically include:

An information obtaining module 401, configured to obtain virtual location information of a virtual data buffer of a virtual network interface component;

an information specifying module 402, configured to specify entity location information of an entity data buffer of an entity network interface component as the virtual location information;

A data storage module 403, configured to store data in the entity data buffer according to the virtual location information.

in an embodiment of the present application, optionally, the apparatus further includes:

the space allocation module is used for allocating a virtual storage space for the virtual network interface component before the virtual position information of the virtual data buffer area of the virtual network interface component is acquired;

And the information determining module is used for determining the virtual position information of a plurality of virtual data buffers in the virtual storage space.

In an embodiment of the application, optionally, the information determining module includes:

a virtual queue creating submodule for creating a virtual receive queue of the virtual network interface component, the virtual receive queue including virtual buffer control information;

the information acquisition submodule is used for acquiring the virtual position information from the virtual storage space;

and the information adding submodule is used for adding the virtual position information to the virtual buffering control information.

In an embodiment of the application, optionally, the information obtaining module includes:

And the information detection submodule is used for detecting the virtual position information in the virtual receiving queue.

In an embodiment of the present application, optionally, the apparatus further includes:

a notification receiving module, configured to receive a notification that initialization of the virtual network interface component is completed before the virtual location information in the virtual receive queue is detected.

in an embodiment of the application, optionally, the information specifying module includes:

the address translation submodule is used for translating the virtual position information into an entity physical address;

and the information determining submodule is used for determining the entity position information of the entity data buffer area according to the entity physical address.

In an embodiment of the application, optionally, the information determining sub-module includes:

An information adding unit, configured to add the entity physical address to the entity buffer control information of the entity data buffer.

In an embodiment of the present application, optionally, the apparatus further includes:

A space creating module, configured to create an information queue composed of the entity buffer control information and an empty entity storage space before the entity location information of the entity data buffer of the entity network interface component is specified as the virtual location information;

The information adding unit includes:

an information obtaining subunit, configured to obtain entity buffer control information in the information queue;

An address adding subunit, configured to add the entity physical address to the obtained entity buffer control information in sequence;

And the information storage subunit is used for storing the entity buffer control information into the entity storage space.

In an embodiment of the present application, optionally, the apparatus further includes:

a control information obtaining module, configured to obtain entity buffer control information in the entity storage space before storing data in the entity data buffer according to the virtual location information;

An entity queue creating module, configured to create an entity receiving queue of the entity network interface component;

and the control information adding module is used for adding the entity buffering control information to the entity receiving queue.

in an embodiment of the present application, optionally, the virtual network interface component is mapped one to an entity receive queue of the entity network interface component, and the entity receive queue and the entity data buffer are mapped one to one, and the data storage module includes:

The component determining submodule is used for determining a virtual network interface component to be sent according to the data;

The entity information acquisition submodule is used for receiving a queue from an entity corresponding to the virtual network interface component and acquiring entity position information of a corresponding entity data buffer area;

and the data storage submodule is used for storing the data according to the entity position information.

in an embodiment of the present application, optionally, the entity information obtaining sub-module includes:

An entity control information obtaining unit, configured to obtain entity buffer control information in the entity receive queue, where the entity buffer control information includes entity location information;

The device further comprises:

and the first marking module is used for marking the received data in the entity buffer control information after the data is stored according to the entity position information so as to enable the physical machine to detect the received data.

in an embodiment of the present application, optionally, the apparatus further includes:

and the second marking module is used for marking the received data in the virtual buffer control information in the virtual receiving queue of the virtual network interface component according to the entity buffer control information so as to enable the virtual network interface component to detect the received data.

in an embodiment of the present application, optionally, the apparatus further includes:

and the notification module is used for notifying the virtual network interface component of receiving data according to the entity cache control information.

According to the embodiment of the application, the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information by acquiring the virtual position information of the virtual data buffer area of the virtual network interface component, and the data is stored in the entity data buffer area according to the virtual position information, so that the entity position information of the entity data buffer area of the entity network interface component is designated as the virtual position information instead of being determined by physical equipment allocation, the received data can be directly stored in the data buffer area designated by the virtual network interface component after the entity network interface component receives the data, the processing of copying the data from the data buffer area designated by the entity network interface component to the data buffer area designated by the virtual network interface component is avoided, and the time consumption of receiving the data is reduced, the network performance of data receiving is improved, and the network delay is reduced.

Referring to fig. 9, a block diagram illustrating a structure of an embodiment of a data processing apparatus according to the fifth embodiment of the present application is shown, which may specifically include:

an instruction receiving module 501, configured to receive a data storage instruction, where the data storage instruction is used to store data in an entity location of an entity data buffer of an entity network interface component;

A position obtaining module 502, configured to obtain a virtual position of a virtual data buffer of a virtual network interface component corresponding to an entity position of an entity data buffer of the entity network interface component;

a data storage module 503, configured to store the data in the virtual location.

according to the embodiment of the application, the virtual position of the virtual data buffer area of the virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component is obtained by receiving a data storage instruction, the data is stored in the virtual position, since the physical location of the physical data buffers of the physical network interface components are specified as virtual locations, rather than being determined by physical device allocation, therefore, after the entity network interface component receives the data, the received data can be directly stored in the data buffer area appointed by the virtual network interface component, the processing that the data is copied from the data buffer area appointed by the entity network interface component to the data buffer area appointed by the virtual network interface component is avoided, the time consumption for receiving the data is reduced, the network performance for receiving the data is improved, and the network delay is reduced.

for the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.

embodiments of the disclosure may be implemented as a system using any suitable hardware, firmware, software, or any combination thereof, in a desired configuration. Fig. 10 schematically illustrates an exemplary system (or apparatus) 600 that can be used to implement various embodiments described in this disclosure.

for one embodiment, fig. 10 illustrates an exemplary system 600 having one or more processors 602, a system control module (chipset) 604 coupled to at least one of the processor(s) 602, system memory 606 coupled to the system control module 604, non-volatile memory (NVM)/storage 608 coupled to the system control module 604, one or more input/output devices 610 coupled to the system control module 604, and a network interface 612 coupled to the system control module 606.

The processor 602 may include one or more single-core or multi-core processors, and the processor 602 may include any combination of general-purpose or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, the system 600 can function as a browser as described in embodiments herein.

in some embodiments, system 600 may include one or more computer-readable media (e.g., system memory 606 or NVM/storage 608) having instructions and one or more processors 602 in combination with the one or more computer-readable media configured to execute the instructions to implement modules to perform the actions described in this disclosure.

For one embodiment, system control module 604 may include any suitable interface controllers to provide any suitable interface to at least one of the processor(s) 602 and/or any suitable device or component in communication with system control module 604.

system control module 604 may include a memory controller module to provide an interface to system memory 606. The memory controller module may be a hardware module, a software module, and/or a firmware module.

system memory 606 may be used, for example, to load and store data and/or instructions for system 600. For one embodiment, system memory 606 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, the system memory 606 may comprise double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

For one embodiment, system control module 604 may include one or more input/output controllers to provide an interface to NVM/storage 608 and input/output device(s) 610.

For example, NVM/storage 608 may be used to store data and/or instructions. NVM/storage 608 may include any suitable non-volatile memory (e.g., flash memory) and/or may include any suitable non-volatile storage device(s) (e.g., one or more Hard Disk Drives (HDDs), one or more Compact Disc (CD) drives, and/or one or more Digital Versatile Disc (DVD) drives).

NVM/storage 608 may include storage resources that are physically part of a device on which system 600 is installed or may be accessed by the device and not necessarily part of the device. For example, NVM/storage 608 may be accessible over a network via input/output device(s) 610.

input/output device(s) 610 can provide an interface for system 600 to communicate with any other suitable device, input/output devices 610 can include communication components, audio components, sensor components, and the like. Network interface 612 may provide an interface for system 600 to communicate over one or more networks, and system 600 may communicate wirelessly with one or more components of a wireless network according to any of one or more wireless network standards and/or protocols, such as to access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof.

For one embodiment, at least one of the processor(s) 602 may be packaged together with logic for one or more controller(s) (e.g., memory controller module) of the system control module 604. For one embodiment, at least one of the processor(s) 602 may be packaged together with logic for one or more controller(s) of the system control module 604 to form a System In Package (SiP). For one embodiment, at least one of the processor(s) 602 may be integrated on the same die with logic for one or more controller(s) of the system control module 604. For one embodiment, at least one of the processor(s) 602 may be integrated on the same die with logic of one or more controllers of the system control module 604 to form a system on a chip (SoC).

In various embodiments, system 600 may be, but is not limited to being: a browser, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.). In various embodiments, system 600 may have more or fewer components and/or different architectures. For example, in some embodiments, system 600 includes one or more cameras, a keyboard, a Liquid Crystal Display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an Application Specific Integrated Circuit (ASIC), and speakers.

Wherein, if the display includes a touch panel, the display screen may be implemented as a touch screen display to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

The present application further provides a non-volatile readable storage medium, where one or more modules (programs) are stored in the storage medium, and when the one or more modules are applied to a terminal device, the one or more modules may cause the terminal device to execute instructions (instructions) of method steps in the present application.

in one example, a computer device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method according to the embodiments of the present application when executing the computer program.

There is also provided in one example a computer readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements a method as one or more of the embodiments of the application.

an embodiment of the application discloses a data caching method and device, and example 1 includes a data caching method, including:

Acquiring virtual position information of a virtual data buffer area of a virtual network interface component;

designating entity location information of an entity data buffer of an entity network interface component as the virtual location information;

And when the data is stored in the entity data buffer area, storing according to the virtual position information.

example 2 may include the method of example 1, wherein prior to the obtaining the virtual location information of the virtual data buffer of the virtual network interface component, the method further comprises:

Allocating a virtual storage space for the virtual network interface component;

determining virtual location information for a plurality of virtual data buffers in the virtual storage space.

Example 3 may include the method of example 1 and/or example 2, wherein the determining virtual location information for a plurality of virtual data buffers in the virtual storage space comprises:

Creating a virtual receive queue for the virtual network interface component, the virtual receive queue comprising virtual buffer control information;

acquiring the virtual position information from the virtual storage space;

adding the virtual location information to the virtual buffer control information.

Example 4 may include the method of one or more of examples 1-3, wherein the obtaining virtual location information of a data buffer of a virtual network interface component includes:

and detecting virtual position information in the virtual receiving queue.

Example 5 may include the method of one or more of examples 1-4, wherein prior to the detecting the virtual location information in the virtual receive queue, the method further comprises:

Receiving a notification that initialization of the virtual network interface component is complete.

example 6 may include the method of one or more of examples 1-5, wherein the designating entity location information of an entity data buffer of an entity network interface component as the virtual location information comprises:

converting the virtual location information to an entity physical address;

And determining the entity position information of the entity data buffer area according to the entity physical address.

example 7 may include the method of one or more of examples 1-6, wherein the determining entity location information of the entity data buffer from the entity physical address includes:

Adding the entity physical address to entity buffer control information of the entity data buffer.

example 8 may include the method of one or more of examples 1-7, wherein prior to the designating entity location information of an entity data buffer of an entity network interface component as the virtual location information, the method further comprises:

Creating an information queue consisting of the entity buffer control information and an empty entity storage space;

The adding the entity physical address to the entity buffer control information of the entity data buffer comprises:

Acquiring entity buffer control information in the information queue;

Adding the entity physical addresses to the obtained entity buffer control information in sequence;

and storing the entity buffer control information into the entity storage space.

example 9 may include the method of one or more of examples 1-8, wherein prior to the storing data in the entity data buffer according to the virtual location information, the method further comprises:

acquiring entity buffer control information in the entity storage space;

creating an entity receive queue for the entity network interface component;

Adding the entity buffer control information to the entity receive queue.

Example 10 may include the method of one or more of examples 1-9, wherein the virtual network interface component is one-to-one mapped with an entity receive queue of an entity network interface component, the entity receive queue and an entity data buffer are one-to-one mapped, and storing the data in the entity data buffer according to the virtual location information includes:

Determining a virtual network interface component to be sent according to the data;

Receiving a queue from an entity corresponding to the virtual network interface component, and acquiring entity position information of a corresponding entity data buffer area;

And storing the data according to the entity position information.

Example 11 may include the method of one or more of examples 1-10, wherein the obtaining entity location information of a corresponding entity data buffer from an entity receive queue corresponding to the virtual network interface component comprises:

acquiring entity buffer control information in the entity receiving queue, wherein the entity buffer control information comprises entity position information;

after the storing the data according to the entity location information, the method further comprises:

In the entity buffer control information, received data is marked so that a physical machine detects the received data.

Example 12 may include the method of one or more of examples 1-11, wherein the method further comprises:

According to the entity buffering control information, marking the received data in the virtual buffering control information in the virtual receiving queue of the virtual network interface component, so that the virtual network interface component detects the received data.

Example 13 may include the method of one or more of examples 1-12, wherein the method further comprises:

And notifying the virtual network interface component of receiving data according to the entity cache control information.

Example 14 includes a data processing method, comprising:

Receiving a data storage instruction, wherein the data storage instruction is used for storing data into an entity position of an entity data buffer of an entity network interface component;

acquiring a virtual position of a virtual data buffer area of a virtual network interface component corresponding to the entity position of the entity data buffer area of the entity network interface component;

storing the data in the virtual location.

example 15 includes a data caching apparatus comprising:

The information acquisition module is used for acquiring virtual position information of a virtual data buffer area of the virtual network interface component;

An information designating module, configured to designate entity location information of an entity data buffer of an entity network interface component as the virtual location information;

And the data storage module is used for storing data in the entity data buffer according to the virtual position information.

Example 16 may include the apparatus of example 15, wherein the apparatus further comprises:

The space allocation module is used for allocating a virtual storage space for the virtual network interface component before the virtual position information of the virtual data buffer area of the virtual network interface component is acquired;

And the information determining module is used for determining the virtual position information of a plurality of virtual data buffers in the virtual storage space.

Example 17 may include the apparatus of example 15 and/or example 16, wherein the information determination module includes:

A virtual queue creating submodule for creating a virtual receive queue of the virtual network interface component, the virtual receive queue including virtual buffer control information;

the information acquisition submodule is used for acquiring the virtual position information from the virtual storage space;

and the information adding submodule is used for adding the virtual position information to the virtual buffering control information.

Example 18 may include the apparatus of one or more of example 15-example 17, wherein the information acquisition module comprises:

and the information detection submodule is used for detecting the virtual position information in the virtual receiving queue.

Example 19 may include the apparatus of one or more of examples 15-18, wherein the apparatus further comprises:

A notification receiving module, configured to receive a notification that initialization of the virtual network interface component is completed before the virtual location information in the virtual receive queue is detected.

Example 20 may include the apparatus of one or more of examples 15-19, wherein the information specifying means comprises:

the address translation submodule is used for translating the virtual position information into an entity physical address;

and the information determining submodule is used for determining the entity position information of the entity data buffer area according to the entity physical address.

Example 21 may include the apparatus of one or more of examples 15-20, wherein the information determination submodule comprises:

An information adding unit, configured to add the entity physical address to the entity buffer control information of the entity data buffer.

example 22 may include the apparatus of one or more of examples 15-21, wherein the apparatus further comprises:

a space creating module, configured to create an information queue composed of the entity buffer control information and an empty entity storage space before the entity location information of the entity data buffer of the entity network interface component is specified as the virtual location information;

the information adding unit includes:

An information obtaining subunit, configured to obtain entity buffer control information in the information queue;

An address adding subunit, configured to add the entity physical address to the obtained entity buffer control information in sequence;

and the information storage subunit is used for storing the entity buffer control information into the entity storage space.

Example 23 may include the apparatus of one or more of example 15-example 22, wherein the apparatus further comprises:

a control information obtaining module, configured to obtain entity buffer control information in the entity storage space before storing data in the entity data buffer according to the virtual location information;

An entity queue creating module, configured to create an entity receiving queue of the entity network interface component;

and the control information adding module is used for adding the entity buffering control information to the entity receiving queue.

example 24 may include the apparatus of one or more of example 15-example 23, wherein the virtual network interface component is one-to-one mapped with an entity receive queue of an entity network interface component, the entity receive queue and an entity data buffer are one-to-one mapped, the data storage module comprising:

the component determining submodule is used for determining a virtual network interface component to be sent according to the data;

the entity information acquisition submodule is used for receiving a queue from an entity corresponding to the virtual network interface component and acquiring entity position information of a corresponding entity data buffer area;

and the data storage submodule is used for storing the data according to the entity position information.

Example 25 may include the apparatus of one or more of example 15-example 24, wherein the entity information acquisition sub-module comprises:

An entity control information obtaining unit, configured to obtain entity buffer control information in the entity receive queue, where the entity buffer control information includes entity location information;

The device further comprises:

And the first marking module is used for marking the received data in the entity buffer control information after the data is stored according to the entity position information so as to enable the physical machine to detect the received data.

example 26 may include the apparatus of one or more of examples 15-25, wherein the apparatus further comprises:

and the second marking module is used for marking the received data in the virtual buffer control information in the virtual receiving queue of the virtual network interface component according to the entity buffer control information so as to enable the virtual network interface component to detect the received data.

Example 27 may include the apparatus of one or more of examples 15-26, wherein the apparatus further comprises:

and the notification module is used for notifying the virtual network interface component of receiving data according to the entity cache control information.

example 28 includes a data processing apparatus comprising:

The instruction receiving module is used for receiving a data storage instruction, wherein the data storage instruction is used for storing data into an entity position of an entity data buffer area of the entity network interface component;

A position obtaining module, configured to obtain a virtual position of a virtual data buffer of a virtual network interface component, where the virtual position corresponds to an entity position of an entity data buffer of the entity network interface component;

and the data storage module is used for storing the data into the virtual position.

Example 29 includes a computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing a method as in one or more of examples 1-14 when executing the computer program.

example 30 includes a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method as in one or more of examples 1-14.

Although certain examples have been illustrated and described for purposes of description, a wide variety of alternate and/or equivalent implementations, or calculations, may be made to achieve the same objectives without departing from the scope of practice of the present application. This application is intended to cover any adaptations or variations of the embodiments discussed herein. Therefore, it is manifestly intended that the embodiments described herein be limited only by the claims and the equivalents thereof.

29页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种采用通用I/O模块实现的安全计算机平台

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!