CN114900699A - Video coding and decoding card virtualization method and device, storage medium and terminal - Google Patents

Video coding and decoding card virtualization method and device, storage medium and terminal Download PDF

Info

Publication number
CN114900699A
CN114900699A CN202210413533.7A CN202210413533A CN114900699A CN 114900699 A CN114900699 A CN 114900699A CN 202210413533 A CN202210413533 A CN 202210413533A CN 114900699 A CN114900699 A CN 114900699A
Authority
CN
China
Prior art keywords
decoding
video coding
card
video
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210413533.7A
Other languages
Chinese (zh)
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.)
Xinyuan Microelectronics Hainan Co ltd
Xinyuan Microelectronics Nanjing Co ltd
Xinyuan Technology Shanghai Co ltd
VeriSilicon Microelectronics Shanghai Co Ltd
VeriSilicon Microelectronics Chengdu Co Ltd
Original Assignee
Xinyuan Microelectronics Hainan Co ltd
Xinyuan Microelectronics Nanjing Co ltd
Xinyuan Technology Shanghai Co ltd
VeriSilicon Microelectronics Shanghai Co Ltd
VeriSilicon Microelectronics Chengdu 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 Xinyuan Microelectronics Hainan Co ltd, Xinyuan Microelectronics Nanjing Co ltd, Xinyuan Technology Shanghai Co ltd, VeriSilicon Microelectronics Shanghai Co Ltd, VeriSilicon Microelectronics Chengdu Co Ltd filed Critical Xinyuan Microelectronics Hainan Co ltd
Priority to CN202210413533.7A priority Critical patent/CN114900699A/en
Publication of CN114900699A publication Critical patent/CN114900699A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides a virtualization method, a virtualization device, a storage medium and a virtualization terminal for a video coding and decoding card, wherein the method comprises the following steps: receiving a video coding and decoding instruction, wherein the video coding and decoding instruction comprises priority information; creating a virtual video coding and decoding card, wherein the virtual video coding and decoding card generates a video coding and decoding request based on the video coding and decoding instruction package; and sending the video coding and decoding request to a physical video coding and decoding card so that the physical video coding and decoding card can execute video coding and decoding operation based on the priority information. The response granularity of the video coding and decoding request is smaller than the switching granularity of the virtual equipment; the whole register is not required to be refreshed, so that the bandwidth of a bus interface is saved; the scheduling mechanism of the virtual video coding and decoding card is not needed to be realized, and the design of a host side driving program is simplified.

Description

Video coding and decoding card virtualization method and device, storage medium and terminal
Technical Field
The invention relates to the field of video coding and decoding, in particular to a method, a device, a storage medium and a terminal for virtualizing a video coding and decoding card.
Background
With the rapid development of the internet, virtualization of various peripherals has an increasing demand in the field of servers. The virtualization of the peripheral has important significance for improving the utilization rate of hardware resources and meeting the increasing market demand. The field of video encoding and decoding is an important application field of virtualization technology.
The existing video codec card virtualization technology mainly shares hardware equipment through time division multiplexing, and creates a corresponding virtual video codec card for each virtual machine, wherein each virtual video codec card comprises a register simulating a physical video codec card. When the virtual machine sends commands and data to the physical video coding and decoding card, the virtual machine firstly writes the addresses of the commands and the data to the virtual registers of the virtual video coding and decoding card, then the virtual video coding and decoding card scheduler selects one virtual video coding and decoding card, and the virtual registers of the virtual video coding and decoding card are all refreshed to real hardware equipment, namely the physical video coding and decoding card, and the physical video coding and decoding card executes corresponding video coding and decoding operations.
The existing video coding and decoding card virtualization technology has the following defects: firstly, a scheduling algorithm needs to store multiple virtual devices on a host (host) side, when registers are many (up to thousands of registers of a VPU (Video Processing Unit)) need to occupy more memory, and the refreshing efficiency of the registers is low; secondly, the design and implementation cost of the scheduling mechanism of the virtual device is high.
Disclosure of Invention
In view of the above disadvantages of the prior art, an object of the present invention is to provide a method, an apparatus, a storage medium, and a terminal for virtualizing a video codec card, which are used to solve the problems of the prior art that the virtualization of the video codec card occupies more memory, the register refresh efficiency is low, and the cost is high.
To achieve the above and other related objects, a first aspect of the present invention provides a video codec card virtualization method, which includes: receiving a video coding and decoding instruction, wherein the video coding and decoding instruction comprises priority information; creating a virtual video coding and decoding card, wherein the virtual video coding and decoding card generates a video coding and decoding request based on the video coding and decoding instruction package; and sending the video coding and decoding request to a physical video coding and decoding card so that the physical video coding and decoding card can execute video coding and decoding operation based on the priority information.
In some embodiments of the first aspect of the present invention, the physical video codec card includes a video codec unit, a microprocessor unit, a memory unit, and a bus interface unit, and the method for virtualizing a video codec card includes: the physical video coding and decoding card receives the video coding and decoding request through the bus interface unit and stores the video coding and decoding request to the memory unit; the firmware on the micro-processing unit analyzes the video coding and decoding request; and the video coding and decoding unit executes video coding and decoding operation based on the analyzed video coding and decoding request.
In some embodiments of the first aspect of the present invention, the generating of the video codec request includes: the method comprises the steps that a host computer creates a virtual video coding and decoding card corresponding to a virtual machine based on an equipment virtualization infrastructure, wherein the virtual video coding and decoding card does not reserve all registers of a physical video coding and decoding card; the device virtualization infrastructure drives the virtual video codec card to generate the video codec request based on the received video codec command.
In some embodiments of the first aspect of the present invention, the method for virtualizing a video codec card includes: creating a Virtual video coding and decoding card corresponding to a Virtual machine through a drive layer of a host by using a VFIO-MDEV (Virtual Function I/O media devices) device virtualization infrastructure; and after the virtual video coding and decoding card receives the video coding and decoding command sent by the virtual machine, the video coding and decoding request is generated by the driving of the VFIO-MDEV equipment virtualization infrastructure.
In some embodiments of the first aspect of the present invention, the video codec card virtualization method includes: and designing a service quality strategy based on the priority information to provide different user services.
To achieve the above and other related objects, a second aspect of the present invention provides a video codec card virtualization apparatus, comprising: the video coding and decoding device comprises an instruction receiving module, a video coding and decoding module and a video coding and decoding module, wherein the instruction receiving module is used for receiving a video coding and decoding instruction which comprises priority information; the encoding and decoding request generating module is used for creating a virtual video encoding and decoding card, and the virtual video encoding and decoding card generates a video encoding and decoding request based on the video encoding and decoding instruction package; and the coding and decoding module is used for sending the video coding and decoding request to a physical video coding and decoding card so that the physical video coding and decoding card can execute video coding and decoding operation based on the priority information.
To achieve the above and other related objects, a third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the video codec card virtualization method.
To achieve the above and other related objects, a fourth aspect of the present invention provides an electronic terminal, comprising: a processor and a memory; the memory is used for storing computer programs, and the processor is used for executing the computer programs stored by the memory so as to enable the terminal to execute the video codec card virtualization method.
As described above, the present invention provides a method, an apparatus, a storage medium, and a terminal for virtualizing a video codec card, which have the following advantages: the method overcomes the defects of a video coding and decoding virtualization method of the traditional time-sharing multiplexing shared hardware equipment, provides a new thought capable of more efficiently utilizing hardware resources, and realizes the virtualization of the video coding and decoding card by packaging a video coding and decoding instruction to generate a request containing priority information, namely optimizing a time-sharing mode into a priority request queue mode. The response granularity of the video coding and decoding request (v-request) is smaller than the switching granularity of the virtual equipment; the whole register is not required to be refreshed, so that the bandwidth of a bus interface is saved; the scheduling mechanism of the virtual video coding and decoding card is not required to be realized, and the design of a host (host) side driver is simplified; furthermore, a Quality of Service (QoS) policy is designed to provide different user services, thereby improving user experience; the video coding and decoding request is analyzed through Firmware of the physical video coding and decoding card, so that the safety of enterprise information (such as VPU IP information) can be better protected; and the microprocessor resources on the physical video coding and decoding card are fully utilized.
Drawings
Fig. 1 is a flowchart illustrating a method for virtualizing a video codec card according to an embodiment of the present invention.
Fig. 2 is a block diagram of a video codec card according to an embodiment of the invention.
Fig. 3 is a schematic diagram illustrating an operating principle of a time-division multiplexing-based video codec card virtualization method according to an embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating an operating principle of a method for virtualizing a video codec card based on a priority request queue according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a video codec card virtualization apparatus according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of an electronic terminal according to an embodiment of the invention.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It is noted that in the following description, reference is made to the accompanying drawings which illustrate several embodiments of the present invention. It is to be understood that other embodiments may be utilized and that mechanical, structural, electrical, and operational changes may be made without departing from the spirit and scope of the present invention. The following detailed description is not to be taken in a limiting sense, and the scope of embodiments of the present invention is defined only by the claims of the issued patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. Spatially relative terms, such as "upper," "lower," "left," "right," "lower," "below," "lower," "above," "upper," and the like, may be used herein to facilitate describing one element or feature's relationship to another element or feature as illustrated in the figures.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," "retained," and the like are to be construed broadly, e.g., as meaning fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," and/or "comprising," when used in this specification, specify the presence of stated features, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, operations, elements, components, items, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: a; b; c; a and B; a and C; b and C; A. b and C ". An exception to this definition will occur only when a combination of elements, functions or operations are inherently mutually exclusive in some way.
The invention aims to provide a virtualization method, a virtualization device, a storage medium and a virtualization terminal for a video coding and decoding card, which are used for solving the problems that in the prior art, the virtualization of the video coding and decoding card occupies more memory, the register refreshing efficiency is low and the cost is higher.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention are further described in detail by the following embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The following embodiments mainly use the Linux system and its device virtualization infrastructure VFIO-MDEV as examples to describe the present invention, but the present invention is not limited to the Linux system or the device virtualization infrastructure VFIO-MDEV.
Example one
As shown in fig. 1, an embodiment of the present invention provides a schematic flow chart of a method for virtualizing a video codec card, where the method specifically includes the following steps:
s11, receiving a video coding and decoding instruction, wherein the video coding and decoding instruction comprises priority information. The video coding and decoding instruction can be sent by a virtual machine client, and data to be coded and decoded or data address information can be sent to a server at the same time. The priority information is information given to the client based on a preset priority rule.
And S12, creating a virtual video coding and decoding card, wherein the virtual video coding and decoding card generates a video coding and decoding request based on the video coding and decoding instruction package. A mapping relationship exists between the virtual video codec card and the physical video codec card (real hardware device), and the virtual machine uses the corresponding hardware device by operating the virtual video codec card. And packetizing the generated video codec request to contain priority information.
In a preferred embodiment of the present invention, the generating method of the video encoding and decoding request includes: the method comprises the steps that a host computer creates a virtual video coding and decoding card corresponding to a virtual machine based on an equipment virtualization infrastructure, wherein the virtual video coding and decoding card does not reserve all registers of a physical video coding and decoding card; the device virtualization infrastructure drives the virtual video codec card to generate the video codec request based on the received video codec instruction.
Taking the Linux system as an example, the Linux system comprises a VFIO-MDEV device virtualization infrastructure; the video coding and decoding card virtualization method comprises the following steps: the VFIO-MDEV equipment virtualization infrastructure establishes a virtual video coding and decoding card corresponding to a virtual machine through a driving layer of a host; and after the virtual video coding and decoding card receives the video coding and decoding command sent by the virtual machine, the video coding and decoding request is generated by the driving of the VFIO-MDEV equipment virtualization infrastructure.
And S13, sending the video coding and decoding request to a physical video coding and decoding card so that the physical video coding and decoding card can execute video coding and decoding operation based on the priority information. The physical video codec card generates a request queue, i.e., a priority request queue, based on the priority information in the request.
In a preferred embodiment of this embodiment, the physical video codec card includes a video codec unit, a microprocessor unit, a memory unit, and a bus interface unit, and the method for virtualizing a video codec card includes: the physical video coding and decoding card receives the video coding and decoding request through the bus interface unit and stores the video coding and decoding request to the memory unit; the firmware on the micro-processing unit analyzes the video coding and decoding request; and the video coding and decoding unit executes video coding and decoding operation based on the analyzed video coding and decoding request.
As shown in fig. 2, as an alternative implementation manner, an embodiment of the present invention provides a block diagram of a video codec card, where the video codec card includes a video codec unit 21 (preferably, a VPU), a memory unit 22 (preferably, a DDR (double data rate synchronous dynamic random access memory)), a microprocessor unit 23, and a bus interface unit 24 (preferably, a PCIE bus (peripheral component interconnect express) high-speed serial computer expansion bus).
The video coding and decoding card is in communication connection with the host through a PCIE slot of the server host, and the server host runs a driving program of the video coding and decoding card to drive the video coding and decoding card to work. The working principle is expressed as follows: the server host sends commands and data to be coded and decoded to the register and the memory unit 22 of the video coding and decoding unit 21 through the bus interface unit 24, the video coding and decoding unit 21 executes coding and decoding operations to obtain processed data, and the host retrieves the processed data from the video coding and decoding card. The micro-processing unit 23 on the video codec card is mainly used for detecting the working state of the card.
In a preferred embodiment of the present invention, the method for virtualizing a video codec card includes: and designing a Quality of Service (QoS) strategy based on the priority information to provide different user services, namely providing corresponding services for different users. QoS is a quality of agreement between networks and users and between users communicating with each other on a network regarding information transmission and sharing, and when a network is overloaded or congested, QoS can ensure that important traffic is not delayed or dropped while ensuring efficient operation of the network.
The embodiment provides a working principle schematic diagram (fig. 3) of a time-division multiplexing-based video codec card virtualization method and a working principle schematic diagram (fig. 4) of a priority request queue-based video codec card virtualization method, respectively.
As shown in fig. 3, in the time division multiplexing-based Video codec Card virtualization method, a Virtual Machine (VM) corresponds to a Virtual Video codec Card (Virtual Video Card) in a physical Host (Host) one to one, and the Virtual Video codec Card includes Virtual registers (V-registers, registers that emulate the physical Video codec Card). The working process is as follows: the VFIO-MDEV creates a virtual video coding and decoding card on a driving layer of a host, and the virtual machine writes a video coding and decoding command and an address of data to be processed into a virtual register of the virtual video coding and decoding card; the virtual codec Card scheduler selects one virtual codec Card, and refreshes all virtual registers of the selected virtual codec Card to registers (registers) of a physical Video codec Card (HW Video Card), so that the physical Video codec Card executes corresponding Video codec operation.
As shown in fig. 4, in the method for virtualizing a Video codec Card based on a priority request queue, a Virtual Machine (VM) corresponds to a Virtual Video codec Card (Virtual Video Card) in a physical Host (Host) one to one, and the Virtual Video codec Card does not include a Virtual register. When the virtual machine operates the virtual video coding and decoding card, the VFIO-MDEV drive on the host machine generates a video coding and decoding request (v-request) and sends the v-request to the physical video coding and decoding card; the physical video coding and decoding card generates a video coding and decoding Request queue (Request-requests), and Firmware on the physical video coding and decoding card responds to the v-Request according to the priority and operates a video coding and decoding unit (VPU) to execute corresponding video coding and decoding operations.
In some embodiments, the video codec card virtualization method may be applied to a controller, such as an arm (advanced RISC machines) controller, an fpga (field Programmable Gate array) controller, a soc (system on chip) controller, a dsp (digital Signal processing) controller, or an mcu (microcontroller unit) controller, etc. In some embodiments, the video codec card virtualization method may also be applied to a computer including components such as memory, a memory controller, one or more processing units (CPUs), a peripheral interface, RF circuitry, audio circuitry, speakers, a microphone, an input/output (I/O) subsystem, a display screen, other output or control devices, and an external port; the computer includes, but is not limited to, Personal computers such as desktop computers, notebook computers, tablet computers, smart phones, smart televisions, Personal Digital Assistants (PDAs), and the like. In other embodiments, the video codec card virtualization method may also be applied to a server, where the server may be arranged on one or more physical servers according to various factors such as functions, loads, and the like, and may also be formed by a distributed or centralized server cluster.
Example two
As shown in fig. 5, an embodiment of the present invention provides a schematic structural diagram of a video codec card virtualization apparatus, including: an instruction receiving module 51, configured to receive a video coding/decoding instruction, where the video coding/decoding instruction includes priority information; a coding and decoding request generating module 52, configured to create a virtual video coding and decoding card, where the virtual video coding and decoding card generates a video coding and decoding request based on the video coding and decoding instruction; and the encoding and decoding module 53 is configured to send the video encoding and decoding request to a physical video encoding and decoding card, so that the physical video encoding and decoding card executes a video encoding and decoding operation based on the priority information.
It should be noted that the modules provided in this embodiment are similar to the methods and embodiments provided above, and therefore, the description thereof is omitted. It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the codec module 53 may be a processing element separately set up, or may be integrated into a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and a processing element of the apparatus calls and executes the functions of the codec module 53. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
EXAMPLE III
As shown in fig. 6, an embodiment of the present invention provides a schematic structural diagram of an electronic terminal. The electronic terminal provided by the embodiment comprises: a processor 61, a memory 62, a communicator 63; the memory 62 is connected with the processor 61 and the communicator 63 through a system bus and completes mutual communication, the memory 62 is used for storing computer programs, the communicator 63 is used for communicating with other devices, and the processor 61 is used for operating the computer programs, so that the electronic terminal executes the steps of the video coding and decoding card virtualization method.
The above-mentioned system bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The communication interface is used for realizing communication between the database access device and other devices (such as a client, a read-write library and a read-only library). The Memory may include a Random Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Example four
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the video codec card virtualization method described above.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the above method embodiments may be performed by hardware associated with a computer program. The aforementioned computer program may be stored in a computer readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
In summary, the present invention provides a method, an apparatus, a storage medium, and a terminal for virtualizing a video codec card, which implement virtualization of the video codec card by generating a request including priority information by packing a video codec command, that is, optimizing a time-sharing manner into a priority request queue manner. The response granularity of the video coding and decoding request is smaller than the switching granularity of the virtual equipment; the simulation of all registers and the refreshing of all registers are not needed, so that the bandwidth of a bus interface and the storage space of a host are saved; the scheduling mechanism of the virtual video coding and decoding card is not required to be realized, the design of a host side driving program is simplified, and the labor is saved; furthermore, a service quality strategy is designed to provide different services for different users, so that the user experience is improved; the video coding and decoding request is analyzed through the firmware of the physical video coding and decoding card, so that the safety of enterprise information can be better protected; and the microprocessor resources on the physical video coding and decoding card are fully utilized. Therefore, the invention effectively overcomes the problems of more memory occupation, low register refreshing efficiency and higher cost of the video coding and decoding card virtualization in the prior art, and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (8)

1. A virtualization method for a video codec card is characterized by comprising the following steps:
receiving a video coding and decoding instruction, wherein the video coding and decoding instruction comprises priority information;
creating a virtual video coding and decoding card, wherein the virtual video coding and decoding card generates a video coding and decoding request based on the video coding and decoding instruction package;
and sending the video coding and decoding request to a physical video coding and decoding card so that the physical video coding and decoding card can execute video coding and decoding operation based on the priority information.
2. The method of claim 1, wherein the physical video codec card comprises a video codec unit, a microprocessor unit, a memory unit, and a bus interface unit, and the method comprises:
the physical video coding and decoding card receives the video coding and decoding request through the bus interface unit and stores the video coding and decoding request to the memory unit;
the firmware on the micro-processing unit analyzes the video coding and decoding request;
and the video coding and decoding unit executes video coding and decoding operation based on the analyzed video coding and decoding request.
3. The method of claim 1, wherein the video codec card virtualization method is characterized in that the video codec request generation mode comprises:
the method comprises the steps that a host computer creates a virtual video coding and decoding card corresponding to a virtual machine based on an equipment virtualization infrastructure, wherein the virtual video coding and decoding card does not reserve all registers of a physical video coding and decoding card;
the device virtualization infrastructure drives the virtual video codec card to generate the video codec request based on the received video codec instruction.
4. The video codec card virtualization method according to claim 1, comprising:
creating a virtual video coding and decoding card corresponding to the virtual machine through a driving layer of the host by using a VFIO-MDEV equipment virtualization infrastructure;
and after the virtual video coding and decoding card receives the video coding and decoding command sent by the virtual machine, the video coding and decoding request is generated by the driving of the VFIO-MDEV equipment virtualization infrastructure.
5. The video codec card virtualization method according to claim 1, comprising:
and designing a service quality strategy based on the priority information to provide different user services.
6. A video codec card virtualization apparatus, comprising:
the video coding and decoding device comprises an instruction receiving module, a video coding and decoding module and a video coding and decoding module, wherein the instruction receiving module is used for receiving a video coding and decoding instruction which comprises priority information;
the encoding and decoding request generating module is used for creating a virtual video encoding and decoding card, and the virtual video encoding and decoding card generates a video encoding and decoding request based on the video encoding and decoding instruction package;
and the coding and decoding module is used for sending the video coding and decoding request to a physical video coding and decoding card so that the physical video coding and decoding card can execute video coding and decoding operation based on the priority information.
7. A computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the video codec card virtualization method according to any one of claims 1 to 5.
8. An electronic terminal, comprising: a processor and a memory;
the memory is used for storing a computer program, and the processor is used for executing the computer program stored by the memory to enable the terminal to execute the video codec card virtualization method according to any one of claims 1 to 5.
CN202210413533.7A 2022-04-13 2022-04-13 Video coding and decoding card virtualization method and device, storage medium and terminal Pending CN114900699A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210413533.7A CN114900699A (en) 2022-04-13 2022-04-13 Video coding and decoding card virtualization method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210413533.7A CN114900699A (en) 2022-04-13 2022-04-13 Video coding and decoding card virtualization method and device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN114900699A true CN114900699A (en) 2022-08-12

Family

ID=82717454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210413533.7A Pending CN114900699A (en) 2022-04-13 2022-04-13 Video coding and decoding card virtualization method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN114900699A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499665A (en) * 2022-09-14 2022-12-20 北京睿芯高通量科技有限公司 High-concurrency coding and decoding system for multi-channel videos
CN116320469A (en) * 2023-05-16 2023-06-23 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium
CN116582438A (en) * 2023-05-16 2023-08-11 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499665A (en) * 2022-09-14 2022-12-20 北京睿芯高通量科技有限公司 High-concurrency coding and decoding system for multi-channel videos
CN116320469A (en) * 2023-05-16 2023-06-23 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium
CN116582438A (en) * 2023-05-16 2023-08-11 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium
CN116582438B (en) * 2023-05-16 2023-10-27 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium
CN116320469B (en) * 2023-05-16 2024-03-01 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10365830B2 (en) Method, device, and system for implementing hardware acceleration processing
CN114900699A (en) Video coding and decoding card virtualization method and device, storage medium and terminal
US20190294328A1 (en) Virtualizing non-volatile storage at a peripheral device
US11347480B2 (en) Transpose operations using processing element array
US11093297B2 (en) Workload optimization system
EP3571586B1 (en) Dynamic and application-specific virtualized graphics processing
US20130151747A1 (en) Co-processing acceleration method, apparatus, and system
US10897428B2 (en) Method, server system and computer program product for managing resources
US20160266918A1 (en) Data assignment and data scheduling for physical machine in a virtual machine environment
US10275558B2 (en) Technologies for providing FPGA infrastructure-as-a-service computing capabilities
JP2015528231A (en) Offload virtual machine flows to physical queues
RU2573733C1 (en) Method and apparatus for adjusting i/o channel on virtual platform
CN111309649B (en) Data transmission and task processing method, device and equipment
US11023825B2 (en) Platform as a service cloud server and machine learning data processing method thereof
WO2021164163A1 (en) Request processing method and apparatus, device and storage medium
CN113037795B (en) Thin terminal system and processing method thereof
CN115686836A (en) Unloading card provided with accelerator
CN112965788A (en) Task execution method, system and equipment in hybrid virtualization mode
US11249760B2 (en) Parameter management between programs
US9176910B2 (en) Sending a next request to a resource before a completion interrupt for a previous request
US20210073033A1 (en) Memory management using coherent accelerator functionality
Zhang et al. NVMe-over-RPMsg: A virtual storage device model applied to heterogeneous multi-core SoCs
CN110704163A (en) Server and virtual storage method and device thereof
US20230111884A1 (en) Virtualization method, device, board card and computer-readable storage medium
US10877552B1 (en) Dynamic power reduction through data transfer request limiting

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