[go: up one dir, main page]

CN115002087A - Audio and video data transmission method, system, device and storage medium - Google Patents

Audio and video data transmission method, system, device and storage medium Download PDF

Info

Publication number
CN115002087A
CN115002087A CN202210609559.9A CN202210609559A CN115002087A CN 115002087 A CN115002087 A CN 115002087A CN 202210609559 A CN202210609559 A CN 202210609559A CN 115002087 A CN115002087 A CN 115002087A
Authority
CN
China
Prior art keywords
data
audio
network card
video data
data transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210609559.9A
Other languages
Chinese (zh)
Other versions
CN115002087B (en
Inventor
胡林艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202210609559.9A priority Critical patent/CN115002087B/en
Publication of CN115002087A publication Critical patent/CN115002087A/en
Application granted granted Critical
Publication of CN115002087B publication Critical patent/CN115002087B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开一种音视频数据传输方法、系统、装置及存储介质,涉及信息传媒领域。本申请所提供的音视频数据传输方法,通过采用智能网卡替换掉原先的普通网卡,且对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码,通过智能网卡重新打包数据,并通过驱动传输给虚拟机。比起之前通过解码硬件与虚拟机的直接通信而言,本实施例中采用智能网卡的多层虚拟交换机功能以智能网卡为中间媒介实现宿主机中的虚拟机与硬件解码设备之间的通信,由于接收到的音视频文件的全部数据均可以通过智能网卡的多层虚拟交换机功能传输至硬件解码设备一起进行解码,因此不会导致数据传输延时的问题。

Figure 202210609559

The present application discloses a method, system, device and storage medium for audio and video data transmission, and relates to the field of information media. The audio and video data transmission method provided by the present application replaces the original ordinary network card by using a smart network card, and preprocesses the decapsulated data, and performs hardware decoding on the processed data through a hardware decoding device. The data is repackaged and transmitted to the virtual machine through the driver. Compared with the previous direct communication between the decoding hardware and the virtual machine, in this embodiment, the multi-layer virtual switch function of the intelligent network card is used to realize the communication between the virtual machine in the host machine and the hardware decoding device by using the intelligent network card as an intermediate medium. Since all the data of the received audio and video files can be transmitted to the hardware decoding device through the multi-layer virtual switch function of the smart network card for decoding together, the problem of data transmission delay will not be caused.

Figure 202210609559

Description

一种音视频数据传输方法、系统、装置及存储介质A kind of audio and video data transmission method, system, device and storage medium

技术领域technical field

本申请涉及信息传媒领域,特别是涉及一种音视频数据传输方法、系统、装置及存储介质。The present application relates to the field of information media, and in particular, to a method, system, device and storage medium for audio and video data transmission.

背景技术Background technique

近年来,随着自媒体技术的发展,以及信息量日益增大,高质量音视频原始体积也越来越大,以720P 30fps的视频为例,一个像素大约3个字节,每秒钟产生1280*720*33*3/1024/1024=87MB数据,一分钟的数据量为5.22GB,这样体积巨大的视频是无法在网络中直接传输的,视频编码技术的出现就是解决视频数据在网络传输的问题。In recent years, with the development of self-media technology and the increasing amount of information, the original volume of high-quality audio and video is also increasing. Taking 720P 30fps video as an example, one pixel is about 3 bytes, which is generated every second. 1280*720*33*3/1024/1024=87MB data, the data volume in one minute is 5.22GB, such a huge video cannot be directly transmitted in the network, the emergence of video coding technology is to solve the problem of video data transmission in the network The problem.

现有的音视频数据通过编码技术压缩后传输到云数据中心,通常使用专用硬件进行解码,专用硬件的优势是高带宽、高性能、低延时,针对音视频数据做专用硬件逻辑处理,相对中央处理器(Central Processing Unit,CPU)处理可以大幅降低延时,减少资源消耗。但在云计算的架构下,一台主机上的多台虚拟机无法同时使用专用硬件进行解码,只能通过因此只能单个进行解码从而导致数据传输延时。Existing audio and video data are compressed by encoding technology and then transmitted to the cloud data center. Dedicated hardware is usually used for decoding. The advantages of dedicated hardware are high bandwidth, high performance, and low latency. Dedicated hardware logic processing for audio and video data is relatively Central processing unit (Central Processing Unit, CPU) processing can greatly reduce latency and resource consumption. However, under the cloud computing architecture, multiple virtual machines on a host cannot use dedicated hardware to decode at the same time, and can only decode by one, which results in a delay in data transmission.

鉴于上述技术,寻找一种能解决数据传输延时问题的音视频数据传输方法是本领域技术人员亟待解决的问题。In view of the above technologies, it is an urgent problem for those skilled in the art to find an audio and video data transmission method that can solve the problem of data transmission delay.

发明内容SUMMARY OF THE INVENTION

本申请的目的是提供一种音视频数据传输方法、系统、装置及存储介质,以便于解决云计算的架构下,一台主机上的多台虚拟机无法同时使用专用硬件进行解码,只能通过因此只能单个进行解码从而导致数据传输延时的问题。The purpose of this application is to provide an audio and video data transmission method, system, device and storage medium, so as to solve the problem that under the architecture of cloud computing, multiple virtual machines on a host cannot use dedicated hardware for decoding at the same time, and can only use dedicated hardware for decoding. Therefore, only a single decoding can be performed, which leads to the problem of data transmission delay.

为解决上述技术问题,本申请提供一种音视频数据传输方法,应用于采用智能网卡的宿主机,包括:In order to solve the above-mentioned technical problems, the present application provides an audio and video data transmission method, which is applied to a host machine using an intelligent network card, including:

将数据包进行解封装,所述数据包为包含需要传输的音视频数据的数据包;Decapsulating the data packet, the data packet is a data packet containing the audio and video data that needs to be transmitted;

对解封装后的数据进行预处理,并将处理后的所述数据通过硬件解码设备进行硬件解码;Preprocessing the decapsulated data, and performing hardware decoding on the processed data through a hardware decoding device;

通过所述智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成在所述智能网卡上运行的可执行程序。The data is repackaged through the smart network card, and transmitted to the virtual machine through a driver, so as to generate an executable program running on the smart network card.

优选地,在所述对解封装后的数据进行预处理,并将处理后的所述数据通过硬件解码设备进行硬件解码之前,还包括:Preferably, before performing the preprocessing on the decapsulated data and performing hardware decoding on the processed data through a hardware decoding device, the method further includes:

将需要处理的所述数据按优先级队列进行排列,所述优先级队列的优先级顺序按照所述数据的大小而定。The data to be processed is arranged in a priority queue, and the priority order of the priority queue is determined according to the size of the data.

优选地,在所述将数据包进行解封装之前,还包括:Preferably, before decapsulating the data packet, the method further includes:

将所述宿主机的网络流量的TCP/UDP协议卸载。The TCP/UDP protocol of the network traffic of the host is offloaded.

优选地,在所述对解封装后的数据传输进行预处理包括:Preferably, the preprocessing of the decapsulated data transmission includes:

将所述数据中对应的网络ID的标签删除,并设置所述虚拟机的ID与所述数据的对应关系。Delete the label of the corresponding network ID in the data, and set the corresponding relationship between the ID of the virtual machine and the data.

优选地,所述通过所述智能网卡重新打包数据,并通过驱动传输给虚拟机之后,还包括:Preferably, after the data is repackaged through the smart network card and transmitted to the virtual machine through the driver, the method further includes:

将原有虚拟机代码重构,采用GCC编译器对所述智能网卡的流量预处理程序重新编译,生成可以在智能网卡上运行的可执行程序,所述可执行程序为所述音视频数据对应的音视频。The original virtual machine code is reconstructed, and the GCC compiler is used to recompile the traffic preprocessing program of the smart network card to generate an executable program that can run on the smart network card, and the executable program corresponds to the audio and video data. audio and video.

优选地,采用所述智能网卡的内存设备作为数据缓存和队列,采用PCIE接口作为所述智能网卡与硬件解码设备通信。Preferably, the memory device of the smart network card is used as the data cache and queue, and the PCIE interface is used as the smart network card to communicate with the hardware decoding device.

优选地,在所述将数据包进行解封装之前,还包括:Preferably, before decapsulating the data packet, the method further includes:

创建所述硬件解码设备与所述智能网卡的接口端的通信缓存,将所述智能网卡初步处理后的数据包缓存至所述智能网卡的DDR内存上。A communication buffer between the hardware decoding device and the interface end of the smart network card is created, and the data packets preliminarily processed by the smart network card are buffered in the DDR memory of the smart network card.

为解决上述问题,本申请提供一种音视频数据传输装置,包括:In order to solve the above problems, the present application provides an audio and video data transmission device, including:

解封装模块,用于将数据包进行解封装,所述数据包为包含需要传输的音视频数据的数据包;A decapsulation module for decapsulating a data packet, the data packet being a data packet containing audio and video data that needs to be transmitted;

解码模块,用于对解封装后的数据传输进行预处理,并将处理后的所述数据进行硬件解码;a decoding module for preprocessing the decapsulated data transmission, and performing hardware decoding on the processed data;

打包模块,用于通过所述智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序。The packaging module is used to repackage the data through the smart network card, and transmit the data to the virtual machine through the driver, so as to generate an executable program that can be run on the smart network card.

优选地,该装置还包括:Preferably, the device further includes:

排列模块,用于将需要处理的所述数据按优先级队列进行排列,所述优先级队列的优先级顺序按照所述数据的大小而定。The arranging module is used for arranging the data to be processed in a priority queue, and the priority order of the priority queue is determined according to the size of the data.

优选地,该装置还包括:Preferably, the device further includes:

卸载模块,用于将所述宿主机的网络流量的TCP/UDP协议卸载。An offloading module, configured to offload the TCP/UDP protocol of the network traffic of the host.

优选地,该装置还包括:Preferably, the device further includes:

为解决上述问题,本申请还提供一种音视频数据传输装置,其特征在于,包括存储器,用于存储计算机程序;In order to solve the above problems, the present application also provides an audio and video data transmission device, which is characterized in that it includes a memory for storing a computer program;

处理器,用于执行所述计算机程序时实现如上述的音视频数据传输方法的步骤。The processor is configured to implement the steps of the above-mentioned audio and video data transmission method when executing the computer program.

优选地,该装置还包括:Preferably, the device further includes:

重构模块,用于将原有虚拟机代码重构,采用GCC编译器对所述智能网卡的流量预处理程序重新编译,生成可以在智能网卡上运行的可执行程序,所述可执行程序为所述音视频数据对应的音视频。The reconstruction module is used for reconstructing the original virtual machine code, using the GCC compiler to recompile the traffic preprocessing program of the smart network card, and generating an executable program that can be run on the smart network card, and the executable program is Audio and video corresponding to the audio and video data.

优选地,该装置还包括:Preferably, the device further includes:

缓存模块,用于创建所述硬件解码设备与所述智能网卡的接口端的通信缓存,将所述智能网卡初步处理后的数据包缓存至所述智能网卡的DDR内存上。The cache module is configured to create a communication cache between the hardware decoding device and the interface end of the smart network card, and cache the data packets preliminarily processed by the smart network card to the DDR memory of the smart network card.

为解决上述问题,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述的音视频数据传输方法的步骤。In order to solve the above-mentioned problems, the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned audio and video data transmission method are realized. .

本申请所提供的音视频数据传输方法,通过采用智能网卡替换掉原先的普通网卡,且对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码,通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序,由于智能网卡对数据进行了解封装以及预处理,从而使得硬件解码设备能对该数据包中的数据进行硬件解码,最后在解码完成后,再由智能网卡进行打包,从而通过驱动传输给虚拟机。比起之前通过解码硬件与虚拟机的直接通信而言,本实施例中采用智能网卡的多层虚拟交换机功能以智能网卡为中间媒介实现宿主机中的虚拟机与硬件解码设备之间的通信,由于接收到的音视频文件的全部数据均可以通过智能网卡的多层虚拟交换机功能传输至硬件解码设备一起进行解码,并在解码后回传至智能网卡进行重新打包,将音视频文件对应的数据发送至对应的虚拟机中,因此不会导致数据传输延时的问题。The audio and video data transmission method provided by this application replaces the original ordinary network card by using a smart network card, and preprocesses the decapsulated data, and performs hardware decoding on the processed data through a hardware decoding device. Repackage the data and transmit it to the virtual machine through the driver, so as to generate an executable program that can run on the smart network card. Because the smart network card decapsulates and preprocesses the data, the hardware decoding device can decode the data in the data packet. The data is decoded by hardware, and finally, after the decoding is completed, it is packaged by the smart network card and transmitted to the virtual machine through the driver. Compared with the previous direct communication between the decoding hardware and the virtual machine, in this embodiment, the multi-layer virtual switch function of the intelligent network card is used to realize the communication between the virtual machine in the host machine and the hardware decoding device by using the intelligent network card as an intermediate medium. Because all the data of the received audio and video files can be transmitted to the hardware decoding device through the multi-layer virtual switch function of the smart network card for decoding, and after decoding, it is sent back to the smart network card for repackaging, and the data corresponding to the audio and video files It is sent to the corresponding virtual machine, so it will not cause the problem of data transmission delay.

本申请所提供的音视频数据传输装置以及计算机可读存储介质与上述音视频数据传输方法对应,因此有益效果同上,在此不进行赘述。The audio and video data transmission device and the computer-readable storage medium provided by the present application correspond to the above-mentioned audio and video data transmission method, so the beneficial effects are the same as above, and are not repeated here.

附图说明Description of drawings

为了更清楚地说明本申请实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to describe the embodiments of the present application more clearly, the following will briefly introduce the drawings that are used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, which are not relevant to ordinary skills in the art. As far as personnel are concerned, other drawings can also be obtained from these drawings on the premise of no creative work.

图1为本申请实施例提供的一种音视频数据传输方法流程图;1 is a flowchart of a method for transmitting audio and video data according to an embodiment of the present application;

图2为本申请实施例提供的一种音视频数据传输装置示意图;2 is a schematic diagram of an audio and video data transmission apparatus provided by an embodiment of the present application;

图3为本申请另一实施例提供的音视频数据传输装置的结构图。FIG. 3 is a structural diagram of an audio and video data transmission apparatus provided by another embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本申请保护范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative work fall within the protection scope of the present application.

本申请的核心是提供一种音视频数据传输方法、系统、装置及存储介质,以便于解决云计算的架构下,一台主机上的多台虚拟机无法同时使用专用硬件进行解码,只能通过因此只能单个进行解码从而导致数据传输延时的问题。The core of the present application is to provide an audio and video data transmission method, system, device and storage medium, so as to solve the problem that under the architecture of cloud computing, multiple virtual machines on one host cannot use dedicated hardware to decode at the same time, and can only decode through dedicated hardware. Therefore, only a single decoding can be performed, which leads to the problem of data transmission delay.

在包交换网络里,单个消息被划分为多个数据块,这些数据块称为包,它包含发送者和接收者的地址信息。这些包然后沿着不同的路径在一个或多个网络中传输,并且在目的地重新组合。开放系统互联(Open System Interconnection,OSI)模型是由国际标准化组织(ISO)定义的标准,它定义了一种分层体系结构,在其中的每一层定义了针对不同通信级别的协议。OSI模型有7层,1到7层分别是:物理层、数据链路层、网络层、传输层、会话层、表示层、应用层。OSI模型在逻辑上可分为两个部分:低层的1至3层关注的是原始数据的传输;高层的4至7层关注的是网络下的应用程序。传统的硬件网卡仅实现网络协议中的L1-L2层逻辑,智能网卡中有智能处理芯片,可以处理L3-L4层的逻辑。In a packet-switched network, a single message is divided into multiple data blocks, called packets, which contain the sender and receiver address information. These packets are then transported across one or more networks along different paths and reassembled at the destination. The Open System Interconnection (OSI) model is a standard defined by the International Organization for Standardization (ISO), which defines a layered architecture in which each layer defines protocols for different communication levels. The OSI model has 7 layers. Layers 1 to 7 are: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, and application layer. The OSI model can be logically divided into two parts: the lower layers 1 to 3 are concerned with the transmission of raw data; the upper layers 4 to 7 are concerned with the applications under the network. The traditional hardware network card only implements the L1-L2 layer logic in the network protocol, and the intelligent network card has an intelligent processing chip, which can process the logic of the L3-L4 layer.

为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。In order to make those skilled in the art better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

图1为本申请实施例提供的一种音视频数据传输方法,应用于采用智能网卡的宿主机,包括:Fig. 1 is a kind of audio and video data transmission method that the embodiment of this application provides, is applied to the host machine that adopts intelligent network card, comprises:

S10:将数据包进行解封装,数据包为包含需要传输的音视频数据的数据包;S10: Decapsulate the data packet, and the data packet is a data packet containing audio and video data to be transmitted;

需要说明的是,数据封装,笼统地讲,就是把业务数据映射到某个封装协议的净荷中,然后填充对应协议的包头,形成封装协议的数据包,并完成速率适配。这样说可能不太好理解,简单地说,数据包利用网络在不同设备之间传输时,为了可靠和准确地发送到目的地,并且高效地利用传输资源(传输设备和传输线路),事先要对数据包进行拆分和打包,在所发送的数据包上附加上目标地址,本地地址,以及一些用于纠错的字节,安全性和可靠性较高时,还要进行加密处理等等。这些操作就叫数据封装。解封装是封装的逆过程,拆解协议包,处理包头中的信息,取出净荷中的业务信息。It should be noted that data encapsulation, generally speaking, is to map the service data into the payload of a certain encapsulation protocol, and then fill in the header of the corresponding protocol to form the data packet of the encapsulation protocol, and complete the rate adaptation. This may not be easy to understand. Simply put, when data packets are transmitted between different devices using the network, in order to send them to the destination reliably and accurately, and to use transmission resources (transmission devices and transmission lines) efficiently, the Split and package the data packets, add the destination address, local address, and some bytes for error correction to the sent data packets, when the security and reliability are high, encryption processing is required, etc. . These operations are called data encapsulation. Decapsulation is the reverse process of encapsulation. It disassembles the protocol packet, processes the information in the packet header, and extracts the service information in the payload.

在本实施例中对于数据包内的数据信息不进行具体限定,可以理解的是该数据包中的需要传输的音视频数据需要传输给多个虚拟机,可以理解的是,对于虚拟机而言,需要对于不同的数据流进行接收,因此不同的虚拟机之前的通信所采用的端口不同,从而对于虚拟机进行管理。In this embodiment, the data information in the data packet is not specifically limited. It can be understood that the audio and video data to be transmitted in the data packet needs to be transmitted to multiple virtual machines. , different data streams need to be received, so different virtual machines use different ports for communication before, so as to manage the virtual machines.

S11:对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码;S11: Preprocess the decapsulated data, and perform hardware decoding on the processed data through a hardware decoding device;

需要说明的是,本实施例中对于解封装后的数据进行预处理,程序设计领域中,预处理一般是指在程序源代码被翻译为目标代码的过程中,生成二进制代码之前的过程。典型地,由预处理器(preprocessor)对程序源代码文本进行处理,得到的结果再由编译器核心进一步编译,可以理解的是,预处理一般是通过软件进行的,在本实施例中,对于预处理的具体步骤不进行限定。It should be noted that, in this embodiment, the decapsulated data is preprocessed. In the field of program design, preprocessing generally refers to the process before binary code is generated in the process of translating program source code into target code. Typically, the program source code text is processed by a preprocessor, and the obtained result is further compiled by the compiler core. It can be understood that preprocessing is generally performed by software. In this embodiment, for The specific steps of preprocessing are not limited.

在本实施例中,解码即用特定方法把数码还原成它所代表的内容或将电脉冲信号、光信号、无线电波等转换成它所代表的信息、数据等的过程。在本生实施例中对于硬件的具体过程以及解码设备的具体选择不进行限定,可以理解的是,硬件解码设备可以包括但不限于以下几种装置。In this embodiment, decoding is the process of using a specific method to restore the digital code to the content it represents, or to convert electrical pulse signals, optical signals, radio waves, etc., into the information, data, etc. it represents. In this embodiment, the specific process of the hardware and the specific selection of the decoding device are not limited. It can be understood that the hardware decoding device may include but not limited to the following devices.

数字信号处理器(Digital Signal Processing,DSP)是计算机或专用处理设备,以数字形式对信号进行采集、变换、滤波、估值、增强、压缩、识别等处理,以得到符合用户需要的信号形式。数字信号处理与模拟信号处理是信号处理的子集。数字信号处理的目的是对真实世界的连续模拟信号进行测量或滤波。因此在进行数字信号处理之前需要将信号从模拟域转换到数字域,这通常通过模数转换器实现。而数字信号处理的输出经常也要变换到模拟域,这是通过数模转换器实现的。Digital Signal Processing (DSP) is a computer or special processing device that collects, transforms, filters, evaluates, enhances, compresses, and recognizes signals in digital form to obtain a signal form that meets user needs. Digital signal processing and analog signal processing are subsets of signal processing. The purpose of digital signal processing is to measure or filter real-world continuous analog signals. Therefore, the signal needs to be converted from the analog domain to the digital domain before digital signal processing, which is usually achieved by an analog-to-digital converter. The output of digital signal processing is often also transformed into the analog domain, which is achieved through a digital-to-analog converter.

现场可编程门阵列(Field-Programmable Gate Array,FPGA)是它是在可编程器件的基础上进一步发展的产物。它是作为专用集成电路领域中的一种半定制电路而出现的,既解决了定制电路的不足,又克服了原有可编程器件门电路数有限的缺点。Field-Programmable Gate Array (FPGA) is the product of its further development on the basis of programmable devices. It appears as a semi-custom circuit in the field of application-specific integrated circuits, which not only solves the shortcomings of custom circuits, but also overcomes the shortcomings of the limited number of original programmable device gate circuits.

折叠fold

S12:通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成在智能网卡上运行的可执行程序。S12: Repackage the data through the smart network card, and transmit it to the virtual machine through the driver, so as to generate an executable program running on the smart network card.

虚拟机,在计算机科学中的体系结构裏,是指一种特殊的软件,他可以在计算机平台和终端用户之间创建一种环境,而终端用户则是基于这个软件所创建的环境来操作软件。在计算机科学中,虚拟机是指可以像真实机器一样运行程序的计算机的软件实现。虚拟机技术是虚拟化技术的一种,所谓虚拟化技术就是将事物从一种形式转变成另一种形式,最常用的虚拟化技术有操作系统中内存的虚拟化,实际运行时用户需要的内存空间可能远远大于物理机器的内存大小,利用内存的虚拟化技术,用户可以将一部分硬盘虚拟化为内存,而这对用户是透明的。Virtual machine, in the architecture of computer science, refers to a special kind of software that can create an environment between the computer platform and the end user, and the end user operates the software based on the environment created by the software . In computer science, a virtual machine refers to a software implementation of a computer that can run programs like a real machine. Virtual machine technology is a kind of virtualization technology. The so-called virtualization technology is to change things from one form to another. The most commonly used virtualization technology is the virtualization of memory in the operating system. The memory space may be much larger than the memory size of the physical machine. Using the memory virtualization technology, the user can virtualize a part of the hard disk into memory, which is transparent to the user.

驱动程序即添加到操作系统中的一小块代码,其中包含有关硬件设备,驱动程序是硬件厂商根据操作系统编写的配置文件,可以说没有驱动程序,计算机中的硬件就无法工作。操作系统不同,硬件的驱动程序也不同,各个硬件厂商为了保证硬件的兼容性及增强硬件的功能会不断地升级驱动程序,在本实施例中对于驱动的具体类型不进行限定,需要说明的是,本实施例中所提及的可执行程序即传输的原本的音视频文件,在本实施例中对于生成的具体流程等等均不进行限定。The driver is a small piece of code added to the operating system, which contains relevant hardware devices. The driver is a configuration file written by the hardware manufacturer according to the operating system. It can be said that without the driver, the hardware in the computer cannot work. Different operating systems have different hardware drivers. In order to ensure the compatibility of the hardware and enhance the functions of the hardware, each hardware manufacturer will continuously upgrade the drivers. In this embodiment, the specific type of the driver is not limited. , the executable program mentioned in this embodiment is the original audio and video file transmitted, and the specific process and the like for generation are not limited in this embodiment.

本实施例所提供的音视频数据传输方法,通过采用智能网卡替换掉原先的普通网卡,且对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码,通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序,由于智能网卡对数据进行了解封装以及预处理,从而使得硬件解码设备能对该数据包中的数据进行硬件解码,最后在解码完成后,再由智能网卡进行打包,从而通过驱动传输给虚拟机。比起之前通过解码硬件与虚拟机的直接通信而言,本实施例中采用智能网卡的多层虚拟交换机功能以智能网卡为中间媒介实现宿主机中的虚拟机与硬件解码设备之间的通信,由于接收到的音视频文件的全部数据均可以通过智能网卡的多层虚拟交换机功能传输至硬件解码设备一起进行解码,并在解码后回传至智能网卡进行重新打包,将音视频文件对应的数据发送至对应的虚拟机中,因此不会导致数据传输延时的问题。The audio and video data transmission method provided by this embodiment replaces the original ordinary network card with a smart network card, preprocesses the decapsulated data, and performs hardware decoding on the processed data through a hardware decoding device. The network card repackages the data and transmits it to the virtual machine through the driver, so as to generate executable programs that can run on the smart network card. Because the smart network card decapsulates and preprocesses the data, the hardware decoding device can The data is decoded by hardware, and finally, after the decoding is completed, it is packaged by the smart network card and transmitted to the virtual machine through the driver. Compared with the previous direct communication between the decoding hardware and the virtual machine, in this embodiment, the multi-layer virtual switch function of the intelligent network card is used to realize the communication between the virtual machine in the host machine and the hardware decoding device by using the intelligent network card as an intermediate medium. Because all the data of the received audio and video files can be transmitted to the hardware decoding device through the multi-layer virtual switch function of the smart network card for decoding, and after decoding, it is sent back to the smart network card for repackaging, and the data corresponding to the audio and video files It is sent to the corresponding virtual machine, so it will not cause the problem of data transmission delay.

上述实施例中提到了通过,在对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码之前,还包括:In the above-mentioned embodiment, it is mentioned that before the decapsulated data is preprocessed, and the processed data is decoded by hardware decoding equipment, it also includes:

将需要处理的数据按优先级队列进行排列,优先级队列的优先级顺序按照数据的大小而定。Arrange the data to be processed according to the priority queue, and the priority order of the priority queue is determined according to the size of the data.

优先级是计算机分时操作系统在处理多个作业程序时,决定各个作业程序接受系统资源的优先等级的参数。逻辑运算符中,逻辑非运算符(!)和所有的单目运算符同级,高于双目的算术运算符、关系运算符、逻辑运算符与(&)和逻辑运算符或(‖);与运算高于或运算,它们都低于算数运算符和关系运算符。在本实施例中仅仅限定优先级顺序与数据大小有关,对于优先级的具体计算方式以及相关的其他计算参数等等均不进行限定。The priority is a parameter that determines the priority level of each operating program to receive system resources when the computer time-sharing operating system processes multiple operating programs. Among the logical operators, the logical NOT operator (!) is at the same level as all unary operators, and is higher than the binocular arithmetic operator, relational operator, logical operator and (&) and logical operator or (‖) ; AND operator is higher than OR operator, they are lower than arithmetic and relational operators. In this embodiment, only the priority order is limited to be related to the data size, and the specific calculation method of the priority and other related calculation parameters and the like are not limited.

需要说明的是,在本实施例中对于数据先进行了优先级的排列,从而保证对于数据处理的流畅性,防止数据冗余。It should be noted that, in this embodiment, data is prioritized first, so as to ensure the smoothness of data processing and prevent data redundancy.

考虑到宿主机的先前的通信协议对于本数据传输的影响,在将数据包进行解封装之前,还包括:Considering the influence of the previous communication protocol of the host on this data transmission, before decapsulating the data packet, it also includes:

将宿主机的网络流量的TCP/UDP协议卸载。Offloads the TCP/UDP protocol of the host's network traffic.

传输控制协议(Transmission Control Protocol,TCP)是一种面向连接(连接导向)的、可靠的、基于字节流的运输层(Transport layer)通信协议,。在简化的计算机网络开放式系统互联(Open System Interconnection,OSI)模型中,它完成第四层传输层所指定的功能,用户数据报协议(User Datagram Protocol,UDP)是同一层内另一个重要的传输协议是OSI参考模型中一种无连接的传输层协议,提供面向事务的简单不可靠信息传送服务,IETF RFC 768是UDP的正式规范。Transmission Control Protocol (TCP) is a connection-oriented (connection-oriented), reliable, byte stream-based transport layer (Transport layer) communication protocol. In the simplified computer network Open System Interconnection (OSI) model, it completes the functions specified by the fourth transport layer, and the User Datagram Protocol (UDP) is another important function in the same layer. The transport protocol is a connectionless transport layer protocol in the OSI reference model that provides transaction-oriented simple unreliable information transfer services. IETF RFC 768 is the formal specification of UDP.

应用层向TCP层发送用于网间传输的、用8位字节表示的数据流,然后TCP把数据流分割成适当长度的报文段(通常受该计算机连接的网络的数据链路层的最大传送单元(MTU)的限制)。之后TCP把结果包传给IP层,由它来通过网络将包传送给接收端实体的TCP层。The application layer sends a data stream represented by 8-bit bytes for Internet transmission to the TCP layer, and then TCP divides the data stream into segments of appropriate length (usually controlled by the data link layer of the network to which the computer is connected). Maximum Transmission Unit (MTU) limit). Then TCP passes the result packet to the IP layer, which transmits the packet through the network to the TCP layer of the receiving entity.

UDP是OSI参考模型中一种无连接的传输层协议,它主要用于不要求分组顺序到达的传输中,分组传输顺序的检查与排序由应用层完成,提供面向事务的简单不可靠信息传送服务。UDP协议基本上是IP协议与上层协议的接口。UDP协议适用端口分别运行在同一台设备上的多个应用程序。UDP is a connectionless transport layer protocol in the OSI reference model. It is mainly used in transmissions that do not require the order of packets to arrive. The check and sorting of the packet transmission order is completed by the application layer, providing transaction-oriented simple and unreliable information transmission services. . The UDP protocol is basically the interface between the IP protocol and the upper layer protocol. The UDP protocol is applicable to multiple applications running on the same device.

通过卸载上述协议从而达到对于宿主机的通信方式清空的状态,从而保证音视频数据通信的正常发送。By uninstalling the above protocol, the communication mode for the host is cleared, thereby ensuring the normal transmission of audio and video data communication.

上述实施例中对于预处理的具体方式未进行限定,在此提供优选方案,在对解封装后的数据传输进行预处理包括:The specific method of preprocessing is not limited in the above-mentioned embodiments, and a preferred solution is provided here. The preprocessing of the decapsulated data transmission includes:

将数据中对应的网络ID的标签删除,并设置虚拟机的ID与数据的对应关系。Delete the label of the corresponding network ID in the data, and set the corresponding relationship between the ID of the virtual machine and the data.

需要说明的是,身份识别标码(Identity,ID)也称为序列号或帐号,是某个体系中相对唯一的编码,相当于是一种“身份证”在某一具体的事物中,ID号一般是不变的,至于用什么来标识该事物,则由设计者自己制定的规则来确定因此在进行预处理时,预先将数据中对应的网络地址删除,本实施例中的标签即指代网络ID在数据中的字符段的体现,虚拟机的ID可以简单理解为虚拟机在程序中对应的地址符号,从而通过上述预处理方式,以防止后续传输中出现数据错误,并将虚拟机的地址与数据对应,从而保证每个数据传输到正确的虚拟机中。It should be noted that the identity identification code (Identity, ID), also known as serial number or account number, is a relatively unique code in a certain system, which is equivalent to a kind of "identity card". In a specific thing, the ID number It is generally unchanged. As for what is used to identify the thing, it is determined by the rules made by the designer himself. Therefore, during preprocessing, the corresponding network address in the data is deleted in advance, and the label in this embodiment refers to the The embodiment of the network ID in the character field of the data, the ID of the virtual machine can be simply understood as the address symbol corresponding to the virtual machine in the program, so that the above preprocessing method is used to prevent data errors in subsequent transmissions, and the virtual machine's Addresses correspond to data, ensuring that each data is transferred to the correct virtual machine.

考虑到最终方案的实用性,即传输完成后对于相关的音视频文件的生成,在此提供优选方案,通过智能网卡重新打包数据,并通过驱动传输给虚拟机之后,还包括:Considering the practicability of the final solution, that is, for the generation of related audio and video files after the transmission is completed, a preferred solution is provided here. After the data is repackaged through the smart network card and transmitted to the virtual machine through the driver, it also includes:

将原有虚拟机代码重构,采用GCC编译器对智能网卡的流量预处理程序重新编译,生成可以在智能网卡上运行的可执行程序,可执行程序为音视频数据对应的音视频。The original virtual machine code is reconstructed, and the GCC compiler is used to recompile the traffic preprocessing program of the smart network card to generate an executable program that can run on the smart network card. The executable program is the audio and video corresponding to the audio and video data.

需要说明的是,虚拟交换机(Open VSwitch,OVS)是一个高质量的,多层虚拟交换机(网络分层的层),其目的是让大规模网络自动化可以通过编程扩展,同时仍然支持标准的管理接口和协议:NetFlow.SFlow...等,并且它还支持多个物理机的分布式环境。利用软件的方式形成交换部件,所以也叫软件交换机,跟传统的物理交换机相比,虚拟交换机同要具备很多有点:配置灵活,因为是软件实现的,一台物理服务器上可以配置数十太或者数百台虚拟交换机,而且端口数目可以灵活选择。成本低廉,通过软件的方式可轻易达到10Gbps的交换速度。It should be noted that an Open VSwitch (OVS) is a high-quality, multi-layer virtual switch (layers of network layers) designed to allow large-scale network automation to scale programmatically, while still supporting standard management Interfaces and protocols: NetFlow.SFlow...etc, and it also supports a distributed environment of multiple physical machines. The software is used to form switching components, so it is also called a software switch. Compared with traditional physical switches, virtual switches have many advantages: flexible configuration, because it is implemented by software, a physical server can be configured with dozens of ethers or Hundreds of virtual switches, and the number of ports can be flexibly selected. The cost is low, and the switching speed of 10Gbps can be easily achieved through software.

GNU编译器套件(GNU Compiler Collection,GUN)包含多种编程语言的前端,也包括了这些语言的库是以GPL许可证所发行的自由软件,也是GNU计划的关键部分。GCC原本作为GNU操作系统的官方编译器,现已被大多数类Unix操作系统采纳为标准的编译器。The GNU Compiler Collection (GUN) contains front-ends for many programming languages, as well as libraries for these languages. Free software released under the GPL license is a key part of the GNU project. Originally used as the official compiler of the GNU operating system, GCC has now been adopted as the standard compiler by most Unix-like operating systems.

在本实施例中增加了后续的可执行文件生成方式,从而保证了方案的完整性,优化了用户的体验。In this embodiment, a subsequent executable file generation method is added, thereby ensuring the integrity of the solution and optimizing the user experience.

上述实施例中对于通信方式,以及数据缓存方式均未进行限定,在此提供优选方案,采用智能网卡的内存设备作为数据缓存和队列,采用PCIE接口作为智能网卡与硬件解码设备通信。In the above embodiments, neither the communication mode nor the data buffering mode is limited, and a preferred solution is provided here. The memory device of the smart network card is used as the data cache and queue, and the PCIE interface is used as the smart network card to communicate with the hardware decoding device.

高速串行计算机扩展总线标准(peripheral component interconnect express,PCIE),包括更高的最大系统总线吞吐量,更低的I/O引脚数量和更小的物理尺寸,更好的总线设备性能缩放,更详细的错误检测和报告机制(高级错误报告,AER)和本机热插拔功能。PCIE标准的更新版本为I/O虚拟化提供了硬件支持。High-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE), including higher maximum system bus throughput, lower I/O pin count and smaller physical size, better bus device performance scaling, More detailed error detection and reporting mechanism (Advanced Error Reporting, AER) and native hotplug capability. An updated version of the PCIE standard provides hardware support for I/O virtualization.

考虑到硬件解码设备与智能网卡的通信,在此提供优选方案,在将数据包进行解封装之前,还包括:Considering the communication between the hardware decoding device and the smart network card, a preferred solution is provided here. Before decapsulating the data packet, it also includes:

创建硬件解码设备与智能网卡的接口端的通信缓存,将智能网卡初步处理后的数据包缓存至智能网卡的DDR内存上。Create a communication buffer between the hardware decoding device and the interface of the smart network card, and cache the data packets preliminarily processed by the smart network card in the DDR memory of the smart network card.

双倍速率(Double Data Rate,DDR)内存,与传统的单数据速率相比,DDR技术实现了一个时钟周期内进行两次读/写操作,即在时钟的上升沿和下降沿分别执行一次读/写操作,因此缓存速率更快,业务效率更高。Double Data Rate (DDR) memory, compared with the traditional single data rate, DDR technology realizes two read/write operations in one clock cycle, that is, one read is performed on the rising edge and the falling edge of the clock. /write operations, so the cache rate is faster and the business is more efficient.

本实施例中通过提供一种更优的缓存方式,从而保证In this embodiment, a better caching method is provided to ensure that

为解决上述问题,本申请提供一种音视频数据传输装置,包括:In order to solve the above problems, the present application provides an audio and video data transmission device, including:

解封装模块,用于将数据包进行解封装,数据包为包含需要传输的音视频数据的数据包;The decapsulation module is used to decapsulate the data packet, and the data packet is a data packet containing the audio and video data to be transmitted;

解码模块,用于对解封装后的数据传输进行预处理,并将处理后的数据进行硬件解码;The decoding module is used to preprocess the decapsulated data transmission and perform hardware decoding on the processed data;

打包模块,用于通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序。The packaging module is used to repackage data through the smart network card and transmit it to the virtual machine through the driver, so as to generate an executable program that can be run on the smart network card.

在上述实施例中,对于音视频数据传输方法进行了详细描述,本申请还提供音视频数据传输装置对应的实施例。需要说明的是,本申请从两个角度对装置部分的实施例进行描述,一种是基于功能模块的角度,另一种是基于硬件的角度。In the above embodiments, the audio and video data transmission method is described in detail, and the present application also provides the corresponding embodiment of the audio and video data transmission apparatus. It should be noted that this application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware.

图2为本申请实施例提供的一种音视频数据传输装置示意图,该装置包括:FIG. 2 is a schematic diagram of an audio and video data transmission device provided by an embodiment of the application, and the device includes:

解封装模块10,用于将数据包进行解封装,数据包为包含需要传输的音视频数据的数据包;The decapsulation module 10 is used to decapsulate the data packet, and the data packet is a data packet containing the audio and video data to be transmitted;

解码模块11,用于对解封装后的数据传输进行预处理,并将处理后的数据进行硬件解码;The decoding module 11 is used to preprocess the decapsulated data transmission, and perform hardware decoding on the processed data;

打包模块12,用于通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序。The packaging module 12 is used to repackage the data through the smart network card, and transmit the data to the virtual machine through the driver, so as to generate an executable program that can be run on the smart network card.

优选地,该装置还包括:Preferably, the device further includes:

排列模块,用于将需要处理的数据按优先级队列进行排列,优先级队列的优先级顺序按照数据的大小而定。The arrangement module is used to arrange the data to be processed according to the priority queue, and the priority order of the priority queue is determined according to the size of the data.

优选地,该装置还包括:Preferably, the device further includes:

卸载模块,用于将宿主机的网络流量的TCP/UDP协议卸载。The offloading module is used to offload the TCP/UDP protocol of the network traffic of the host.

优选地,该装置还包括:Preferably, the device further includes:

为解决上述问题,本申请还提供一种音视频数据传输装置,其特征在于,包括存储器,用于存储计算机程序;In order to solve the above problems, the present application also provides an audio and video data transmission device, which is characterized in that it includes a memory for storing a computer program;

处理器,用于执行计算机程序时实现如上述的音视频数据传输方法的步骤。The processor is configured to implement the steps of the above-mentioned audio and video data transmission method when executing the computer program.

优选地,该装置还包括:Preferably, the device further includes:

重构模块,用于将原有虚拟机代码重构,采用GCC编译器对智能网卡的流量预处理程序重新编译,生成可以在智能网卡上运行的可执行程序,可执行程序为音视频数据对应的音视频。The reconstruction module is used to reconstruct the original virtual machine code, use the GCC compiler to recompile the traffic preprocessing program of the smart network card, and generate an executable program that can run on the smart network card. The executable program corresponds to the audio and video data. audio and video.

优选地,该装置还包括:Preferably, the device further includes:

缓存模块,用于创建硬件解码设备与智能网卡的接口端的通信缓存,将智能网卡初步处理后的数据包缓存至智能网卡的DDR内存上。The cache module is used to create a communication cache between the hardware decoding device and the interface end of the smart network card, and cache the data packets preliminarily processed by the smart network card to the DDR memory of the smart network card.

由于装置部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例及其对应的有益效果请参见方法部分的实施例的描述,这里暂不赘述。Since the embodiments of the apparatus part and the embodiments of the method part correspond to each other, the embodiments of the apparatus part and the corresponding beneficial effects may refer to the description of the embodiments of the method part, which will not be repeated here.

本实施例所提供的音视频数据传输装置,包括解封装模块,解码模块和打包模块,能够实现通过采用智能网卡替换掉原先的普通网卡,且对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码,通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序,由于智能网卡对数据进行了解封装以及预处理,从而使得硬件解码设备能对该数据包中的数据进行硬件解码,最后在解码完成后,再由智能网卡进行打包,从而通过驱动传输给虚拟机。比起之前通过解码硬件与虚拟机的直接通信而言,本实施例中采用智能网卡的多层虚拟交换机功能以智能网卡为中间媒介实现宿主机中的虚拟机与硬件解码设备之间的通信,由于接收到的音视频文件的全部数据均可以通过智能网卡的多层虚拟交换机功能传输至硬件解码设备一起进行解码,并在解码后回传至智能网卡进行重新打包,将音视频文件对应的数据发送至对应的虚拟机中,因此不会导致数据传输延时的问题。The audio and video data transmission device provided in this embodiment includes a decapsulation module, a decoding module and a packaging module, which can replace the original ordinary network card by using a smart network card, preprocess the decapsulated data, and process the decapsulated data. The resulting data is decoded by hardware decoding equipment, repackaged by the smart network card, and transmitted to the virtual machine through the driver, so as to generate executable programs that can run on the smart network card. processing, so that the hardware decoding device can perform hardware decoding on the data in the data packet, and finally, after the decoding is completed, it is packaged by the intelligent network card, and then transmitted to the virtual machine through the driver. Compared with the previous direct communication between the decoding hardware and the virtual machine, in this embodiment, the multi-layer virtual switch function of the intelligent network card is used to realize the communication between the virtual machine in the host machine and the hardware decoding device by using the intelligent network card as an intermediate medium. Because all the data of the received audio and video files can be transmitted to the hardware decoding device through the multi-layer virtual switch function of the smart network card for decoding, and after decoding, it is sent back to the smart network card for repackaging, and the data corresponding to the audio and video files It is sent to the corresponding virtual machine, so it will not cause the problem of data transmission delay.

图3为本申请另一实施例提供的音视频数据传输装置的结构图,如图3所示,音视频数据传输装置包括:存储器20,用于存储计算机程序;FIG. 3 is a structural diagram of an audio and video data transmission device provided by another embodiment of the application. As shown in FIG. 3 , the audio and video data transmission device includes: a memory 20 for storing a computer program;

处理器21,用于执行计算机程序时实现如上述实施例中所提到的音视频数据传输方法的步骤。The processor 21 is configured to implement the steps of the audio and video data transmission method mentioned in the above embodiments when executing the computer program.

本实施例提供的音视频数据传输装置可以包括但不限于智能手机、平板电脑、笔记本电脑或台式电脑等。The audio and video data transmission apparatus provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.

其中,处理器21可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器21可以采用数字信号处理(Digital Signal Processor,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable LogicArray,PLA)中的至少一种硬件形式来实现。处理器21也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称中央处理器(CentralProcessing Unit,CPU);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器21可以在集成有图像处理器(Graphics Processing Unit,GPU),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器21还可以包括人工智能(Artificial Intelligence,AI)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented by at least one hardware form among digital signal processing (Digital Signal Processor, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). . The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake-up state, also called a central processing unit (CPU); A low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a graphics processor (Graphics Processing Unit, GPU), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 21 may further include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.

存储器20可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器20还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。本实施例中,存储器20至少用于存储以下计算机程序201,其中,该计算机程序被处理器21加载并执行之后,能够实现前述任一实施例公开的音视频数据传输方法的相关步骤。另外,存储器20所存储的资源还可以包括操作系统202和数据203等,存储方式可以是短暂存储或者永久存储。其中,操作系统202可以包括Windows、Unix、Linux等。数据203可以包括但不限于音视频数据传输方法中涉及的数据等。Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the audio and video data transmission method disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, etc., and the storage mode may be short-term storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, and the like. The data 203 may include, but is not limited to, the data involved in the audio and video data transmission method, and the like.

在一些实施例中,音视频数据传输装置还可包括有显示屏22、输入输出接口23、通信接口24、电源25以及通信总线26。In some embodiments, the audio and video data transmission device may further include a display screen 22 , an input/output interface 23 , a communication interface 24 , a power supply 25 and a communication bus 26 .

本领域技术人员可以理解,图3中示出的结构并不构成对音视频数据传输装置的限定,可以包括比图示更多或更少的组件。Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the audio and video data transmission apparatus, and may include more or less components than those shown in the figure.

本申请实施例提供的音视频数据传输装置,包括存储器和处理器,处理器在执行存储器存储的程序时,能够实现如下方法:上述实施例中涉及的音视频数据传输方法。The audio and video data transmission apparatus provided by the embodiment of the present application includes a memory and a processor, and the processor can implement the following method when executing a program stored in the memory: the audio and video data transmission method involved in the above embodiments.

由于装置部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。Since the embodiment of the apparatus part corresponds to the embodiment of the method part, for the embodiment of the apparatus part, please refer to the description of the embodiment of the method part, which will not be repeated here.

本实施例所提供的音视频数据传输装置,包括存储器和处理器,处理器在执行存储器存储的程序时,能够实现通过采用智能网卡替换掉原先的普通网卡,且对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码,通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序,由于智能网卡对数据进行了解封装以及预处理,从而使得硬件解码设备能对该数据包中的数据进行硬件解码,最后在解码完成后,再由智能网卡进行打包,从而通过驱动传输给虚拟机。比起之前通过解码硬件与虚拟机的直接通信而言,本实施例中采用智能网卡的多层虚拟交换机功能以智能网卡为中间媒介实现宿主机中的虚拟机与硬件解码设备之间的通信,由于接收到的音视频文件的全部数据均可以通过智能网卡的多层虚拟交换机功能传输至硬件解码设备一起进行解码,并在解码后回传至智能网卡进行重新打包,将音视频文件对应的数据发送至对应的虚拟机中,因此不会导致数据传输延时的问题。The audio and video data transmission device provided in this embodiment includes a memory and a processor. When the processor executes a program stored in the memory, the original ordinary network card can be replaced by a smart network card, and the decapsulated data can be pre-processed. Process, and decode the processed data through hardware decoding equipment, repackage the data through the smart network card, and transmit it to the virtual machine through the driver, so as to generate executable programs that can run on the smart network card. Decapsulation and preprocessing are performed, so that the hardware decoding device can perform hardware decoding on the data in the data packet. Finally, after the decoding is completed, it is packaged by the smart network card and transmitted to the virtual machine through the driver. Compared with the previous direct communication between the decoding hardware and the virtual machine, in this embodiment, the multi-layer virtual switch function of the intelligent network card is used to realize the communication between the virtual machine in the host machine and the hardware decoding device by using the intelligent network card as an intermediate medium. Because all the data of the received audio and video files can be transmitted to the hardware decoding device through the multi-layer virtual switch function of the smart network card for decoding, and after decoding, it is sent back to the smart network card for repackaging, and the data corresponding to the audio and video files It is sent to the corresponding virtual machine, so it will not cause the problem of data transmission delay.

最后,本申请还提供一种计算机可读存储介质对应的实施例。计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述方法实施例中记载的步骤。Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps described in the foregoing method embodiments are implemented.

可以理解的是,如果上述实施例中的方法以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。It can be understood that, if the methods in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.

由于可读存储介质部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。Since the embodiments of the readable storage medium part correspond to the embodiments of the method part, the embodiments of the apparatus part refer to the description of the embodiments of the method part, which will not be repeated here.

本实施例所提供的计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现通过采用智能网卡替换掉原先的普通网卡,且对解封装后的数据进行预处理,并将处理后的数据通过硬件解码设备进行硬件解码,通过智能网卡重新打包数据,并通过驱动传输给虚拟机,以便于生成可以在智能网卡上运行的可执行程序,由于智能网卡对数据进行了解封装以及预处理,从而使得硬件解码设备能对该数据包中的数据进行硬件解码,最后在解码完成后,再由智能网卡进行打包,从而通过驱动传输给虚拟机。比起之前通过解码硬件与虚拟机的直接通信而言,本实施例中采用智能网卡的多层虚拟交换机功能以智能网卡为中间媒介实现宿主机中的虚拟机与硬件解码设备之间的通信,由于接收到的音视频文件的全部数据均可以通过智能网卡的多层虚拟交换机功能传输至硬件解码设备一起进行解码,并在解码后回传至智能网卡进行重新打包,将音视频文件对应的数据发送至对应的虚拟机中,因此不会导致数据传输延时的问题。The computer-readable storage medium provided by this embodiment stores a computer program, and when the computer program is executed by the processor, the original ordinary network card is replaced by using a smart network card, and the decapsulated data is preprocessed and processed. The resulting data is decoded by hardware decoding equipment, repackaged by the smart network card, and transmitted to the virtual machine through the driver, so as to generate executable programs that can run on the smart network card. processing, so that the hardware decoding device can perform hardware decoding on the data in the data packet, and finally, after the decoding is completed, it is packaged by the intelligent network card, and then transmitted to the virtual machine through the driver. Compared with the previous direct communication between the decoding hardware and the virtual machine, in this embodiment, the multi-layer virtual switch function of the intelligent network card is used to realize the communication between the virtual machine in the host machine and the hardware decoding device by using the intelligent network card as an intermediate medium. Because all the data of the received audio and video files can be transmitted to the hardware decoding device through the multi-layer virtual switch function of the smart network card for decoding, and after decoding, it is sent back to the smart network card for repackaging, and the data corresponding to the audio and video files It is sent to the corresponding virtual machine, so it will not cause the problem of data transmission delay.

以上对本申请所提供的一种音视频数据传输方法、装置及计算机可读存储介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The audio and video data transmission method, device, and computer-readable storage medium provided by the present application have been described in detail above. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can also be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is no such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

Claims (10)

1. An audio and video data transmission method is characterized by being applied to a host machine adopting an intelligent network card and comprising the following steps:
decapsulating a data packet, wherein the data packet is a data packet containing audio and video data to be transmitted;
preprocessing the decapsulated data, and performing hardware decoding on the processed data through hardware decoding equipment;
and repackaging data through the intelligent network card, and transmitting the repackaged data to the virtual machine through driving so as to generate an executable program running on the intelligent network card.
2. The method for transmitting audio-video data according to claim 1, wherein before the preprocessing the decapsulated data and performing hardware decoding on the processed data by a hardware decoding device, the method further comprises:
and arranging the data to be processed according to a priority queue, wherein the priority order of the priority queue is determined according to the size of the data.
3. The method for transmitting audio-video data according to claim 2, further comprising, before the decapsulating the data packet:
and unloading the TCP/UDP protocol of the network flow of the host machine.
4. The method for transmitting audio-video data according to claim 2, wherein the preprocessing the decapsulated data transmission comprises:
and deleting the label of the corresponding network ID in the data, and setting the corresponding relation between the ID of the virtual machine and the data.
5. The audio-video data transmission method according to any one of claims 1 to 4, wherein after the data is repackaged by the smart network card and is transmitted to the virtual machine by driving, the method further comprises:
reconstructing codes of an original virtual machine, and recompiling a flow preprocessing program of the intelligent network card by adopting a GCC compiler to generate an executable program which can run on the intelligent network card, wherein the executable program is audio and video corresponding to the audio and video data.
6. The audio/video data transmission method according to claim 2, wherein the memory device of the intelligent network card is used as a data buffer and a queue, and the PCIE interface is used as the intelligent network card to communicate with the hardware decoding device.
7. The method for transmitting audio-video data according to claim 1, further comprising, before the decapsulating the data packet:
and creating a communication cache of the hardware decoding device and the interface end of the intelligent network card, and caching the data packet after the primary processing of the intelligent network card to a DDR memory of the intelligent network card.
8. An audio-video data transmission apparatus, comprising:
the de-encapsulation module is used for de-encapsulating a data packet, wherein the data packet contains audio and video data to be transmitted;
the decoding module is used for preprocessing the unpackaged data transmission and performing hardware decoding on the processed data;
and the packaging module is used for repackaging the data through the intelligent network card and transmitting the repackaged data to the virtual machine through driving so as to generate an executable program capable of running on the intelligent network card.
9. An audio-video data transmission apparatus, comprising a memory for storing a computer program;
a processor for implementing the steps of the audio-visual data transmission method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the audio-visual data transmission method according to one of claims 1 to 7.
CN202210609559.9A 2022-05-31 2022-05-31 Audio and video data transmission method, system, device and storage medium Active CN115002087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210609559.9A CN115002087B (en) 2022-05-31 2022-05-31 Audio and video data transmission method, system, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210609559.9A CN115002087B (en) 2022-05-31 2022-05-31 Audio and video data transmission method, system, device and storage medium

Publications (2)

Publication Number Publication Date
CN115002087A true CN115002087A (en) 2022-09-02
CN115002087B CN115002087B (en) 2024-07-02

Family

ID=83030797

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210609559.9A Active CN115002087B (en) 2022-05-31 2022-05-31 Audio and video data transmission method, system, device and storage medium

Country Status (1)

Country Link
CN (1) CN115002087B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883658A (en) * 2022-12-07 2023-03-31 长安大学 A cross-platform image information transmission method, system, device and readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104772A (en) * 2011-02-28 2011-06-22 南京邮电大学 Method for designing wireless video sensor coding/decoding system
US8010692B1 (en) * 2009-11-05 2011-08-30 Adobe Systems Incorporated Adapting audio and video content for hardware platform
CN107302703A (en) * 2016-04-15 2017-10-27 中兴通讯股份有限公司 Audio and video playing method and device
CN207070236U (en) * 2017-01-18 2018-03-02 北京小鸟科技股份有限公司 IP-based audio frequency and video control Lossless transport and exchange system
CN107911700A (en) * 2017-10-31 2018-04-13 深信服科技股份有限公司 A kind of hardware coding/decoding method, decoding device and storage medium based on virtualization
US20190220296A1 (en) * 2016-12-21 2019-07-18 Tencent Technology (Shenzhen) Company Limited Method and apparatus for transmitting data packet based on virtual machine
US20190220328A1 (en) * 2018-01-16 2019-07-18 Qsc, Llc Audio, video and control system implementing virtual machines
CN110990116A (en) * 2019-11-21 2020-04-10 优刻得科技股份有限公司 Method, device and system for transmitting data between intelligent network card and virtual machine
CN113821310A (en) * 2021-11-19 2021-12-21 阿里云计算有限公司 Data processing method, programmable network card device, physical server and storage medium
CN114024910A (en) * 2021-10-29 2022-02-08 上海广策信息技术有限公司 Extremely-low-delay reliable communication system and method for financial transaction system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8010692B1 (en) * 2009-11-05 2011-08-30 Adobe Systems Incorporated Adapting audio and video content for hardware platform
CN102104772A (en) * 2011-02-28 2011-06-22 南京邮电大学 Method for designing wireless video sensor coding/decoding system
CN107302703A (en) * 2016-04-15 2017-10-27 中兴通讯股份有限公司 Audio and video playing method and device
US20190220296A1 (en) * 2016-12-21 2019-07-18 Tencent Technology (Shenzhen) Company Limited Method and apparatus for transmitting data packet based on virtual machine
CN207070236U (en) * 2017-01-18 2018-03-02 北京小鸟科技股份有限公司 IP-based audio frequency and video control Lossless transport and exchange system
CN107911700A (en) * 2017-10-31 2018-04-13 深信服科技股份有限公司 A kind of hardware coding/decoding method, decoding device and storage medium based on virtualization
US20190220328A1 (en) * 2018-01-16 2019-07-18 Qsc, Llc Audio, video and control system implementing virtual machines
CN110990116A (en) * 2019-11-21 2020-04-10 优刻得科技股份有限公司 Method, device and system for transmitting data between intelligent network card and virtual machine
CN114024910A (en) * 2021-10-29 2022-02-08 上海广策信息技术有限公司 Extremely-low-delay reliable communication system and method for financial transaction system
CN113821310A (en) * 2021-11-19 2021-12-21 阿里云计算有限公司 Data processing method, programmable network card device, physical server and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DAJIANG ZHOU: "An 8K H.265/HEVC Video Decoder Chip With a New System Pipeline Design", 《 IEEE JOURNAL OF SOLID-STATE CIRCUITS》 *
王升;班有容;陈佳媛;张昊;: "硬件加速在核心网转发面应用的思考和实践", 中兴通讯技术, no. 03 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883658A (en) * 2022-12-07 2023-03-31 长安大学 A cross-platform image information transmission method, system, device and readable storage medium

Also Published As

Publication number Publication date
CN115002087B (en) 2024-07-02

Similar Documents

Publication Publication Date Title
US9934065B1 (en) Servicing I/O requests in an I/O adapter device
US6987961B1 (en) Ethernet emulation using a shared mailbox between two processors in a feature phone
US6209087B1 (en) Data processor with multiple compare extension instruction
JP2019075109A (en) Data storage device and bridge device
US20020071450A1 (en) Host-fabric adapter having bandwidth-optimizing, area-minimal, vertical sliced memory architecture and method of connecting a host system to a channel-based switched fabric in a data network
US11182150B2 (en) Zero packet loss upgrade of an IO device
US8736617B2 (en) Hybrid graphic display
CN110297797B (en) Heterogeneous protocol conversion device and method
CN111262917A (en) A remote data transfer device and method based on FPGA cloud platform
CN113746749A (en) Network connection device
CN115033348B (en) A method, system, device and medium for unified management of virtual machines and containers
CN106610789B (en) A kind of data processing method, apparatus and system
CN108600331A (en) Interactive interface rendering method, client, terminal and system
CN110149374B (en) File transmission method, terminal equipment and computer readable storage medium
CN115237500A (en) A data processing method, apparatus, device and medium for a pooling platform
GB2512061A (en) Transactional message format data conversion
CN115002087B (en) Audio and video data transmission method, system, device and storage medium
US11620250B2 (en) Systems and methods for data transfer over a shared interface
WO2007120789A2 (en) Method and apparatus for processing data at physical layer
US20040024833A1 (en) Key reuse for RDMA virtual address space
CN116069395A (en) Cloud computing acceleration DPU system
US10049001B1 (en) Dynamic error correction configuration
US9594706B2 (en) Island-based network flow processor with efficient search key processing
CN114095572B (en) Data transfer method and device
CN110958216B (en) Secure online network packet transmission

Legal Events

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