Video processing method, injection method and electronic device

By configuring the virtual machine on the main server and reasonably allocating computing resources, the high cost problems caused by multiple video injection devices and servers are solved, and low-cost and stable video processing is achieved.

CN116132706BActive Publication Date: 2025-08-08KUNYI ELECTRONICS TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310096728.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-07
Publication Date
2025-08-08
Estimated Expiration
2043-02-07

AI Technical Summary

Technical Problem

In the prior art, injecting multiple video data into an automotive controller requires multiple video injection devices and servers, resulting in high usage costs.

Method used

By configuring multiple virtual machines on the main server, configuring the virtual machine's computing resources, including CPU, GPU and memory resources, based on business demand information, the virtual machine receives, decodes videos and transmits them to the video injection device, reducing the demand for servers and video injection devices.

Benefits of technology

This reduces the cost of video processing, avoids the instability of video processing caused by multi-task preemption of computing resources, and improves the utilization rate of computing resources and power efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132706B_ABST
    Figure CN116132706B_ABST
Patent Text Reader

Abstract

The present invention discloses a video processing method, an injection method and an electronic device. The video processing method comprises: firstly obtaining the business demand information of each virtual machine on the main server; secondly, configuring the virtual machine computing resources of the virtual machine according to the business demand information and the computing resources of the main server, the virtual machine computing resources including CPU resources, GPU resources and memory resources; then obtaining the file location information of the video to be decoded on the main server; finally, mapping the file location information to the virtual machine, so that the virtual machine obtains the video to be decoded from the main server according to the file location information, and obtains the video to be injected after decoding by the virtual machine and transmits it to the video injection device, which is connected to the main server. The present invention only requires one main server and one video injection device to complete the transmission of the video data to be injected, thereby reducing the use cost and avoiding the instability of video processing caused by multiple tasks simultaneously occupying computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a video processing method, an injection method and an electronic device. Background Art

[0002] During the algorithm development process for autonomous driving technology, algorithms in vehicle controllers (such as neural networks) need to be trained, verified, and tested. This requires injecting various video data into the controllers. This video data injection process typically involves a server transmitting processed video to a video injection device, which then synchronously injects it back into the controllers.

[0003] As a video receiver, the controller needs to receive multiple channels of video data, each representing a video captured by a camera. A server transmits one channel of video data to a video injection device. To meet this multi-channel video injection requirement, multiple video injection devices and servers are often required, significantly increasing costs. Summary of the Invention

[0004] In order to overcome the above problems and defects, the purpose of the present invention is to provide a video processing method, an injection method and an electronic device, which can reduce the demand for servers and video injection devices through virtual machines and reduce usage costs.

[0005] To achieve the above object, the present invention provides a video processing method in a first aspect, comprising:

[0006] Obtain business demand information for each virtual machine on the master server;

[0007] Configure the virtual machine computing resources based on business requirements and the computing resources of the primary server. The virtual machine computing resources include CPU resources, GPU resources, and memory resources.

[0008] Get the file location information of the video to be decoded on the main server;

[0009] Map file location information to the virtual machine so that:

[0010] The virtual machine obtains the video to be decoded from the main server according to the file location information, and uses the configured virtual machine computing resources to receive and decode the video to be decoded, and transmits the decoded video to be injected to the video injection device, wherein the video injection device is connected to the main server.

[0011] Optionally, after the step of mapping the file location information to the virtual machine, the method further includes:

[0012] Acquire reference information, where the reference information includes working status information of the virtual machine and / or video data reception status, where the working status information includes CPU utilization, GPU utilization, and memory utilization;

[0013] Adjust the virtual machine computing resource configuration of the virtual machine based on the reference information.

[0014] Optionally, the step of receiving and decoding the video to be decoded using the configured virtual machine computing resources includes:

[0015] The virtual machine is enabled to decode the video to be decoded using the configured GPU resources to obtain the video to be injected.

[0016] Optionally, the business requirement information includes decoding means information, where the decoding means information is used to indicate whether the virtual machine needs to process the injected video through GPU hardware decoding. The steps of configuring virtual machine computing resources of the virtual machine according to the business requirement information include:

[0017] Determine whether the virtual machine needs to process the video to be decoded through GPU hardware decoding;

[0018] If yes, configure an independent GPU for the virtual machine as a GPU resource.

[0019] Optionally, the business requirement information further includes response real-time performance, where response real-time performance is used to characterize the program instruction response speed of the virtual machine. The steps of configuring virtual machine computing resources of the virtual machine according to the business requirement information include:

[0020] Determine whether the virtual machine needs to improve real-time response performance;

[0021] If so, an exclusive CPU core is configured for the virtual machine.

[0022] Optionally, the decoding means information further includes information for characterizing the data bandwidth of the video to be decoded. The step of configuring the virtual machine computing resources of the virtual machine according to the service demand information includes:

[0023] Determine whether the virtual machine computing resources of the virtual machine match the data bandwidth;

[0024] If so, memory resources with a memory capacity greater than the first threshold are configured for the virtual machine; if not, memory resources with a memory capacity less than the second threshold are configured for the virtual machine.

[0025] Optionally, the service requirement information further includes a resolution of the video to be decoded. The step of configuring virtual machine computing resources of the virtual machine according to the service requirement information includes:

[0026] Configure the memory capacity of the virtual machine based on the resolution of the video to be decoded.

[0027] Optionally, after configuring the virtual machine computing resources of the virtual machine according to the business demand information, the method further includes:

[0028] The virtual machine clock source of the virtual machine is synchronized with the main server clock source of the main server, so that the virtual machine transmits the video to be injected to the video injection device according to the virtual machine clock source and the timestamp of the video to be injected.

[0029] A second aspect of the present invention provides a video injection method, comprising:

[0030] Receive the video to be injected, where the video data to be injected is obtained according to the above-mentioned video processing method;

[0031] The video to be injected is injected into the video receiving device according to the timestamp of the video to be injected.

[0032] A third aspect of the present invention provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned video processing method or video injection method is implemented.

[0033] Compared with the prior art, the beneficial effects of the present invention include: the video processing method of the present invention includes: first, obtaining the business demand information of each virtual machine on the main server; second, configuring the virtual machine computing resources of the virtual machine according to the business demand information and the computing resources of the main server, the virtual machine computing resources including CPU resources, GPU resources and memory resources; then obtaining the file location information of the video to be injected on the main server; finally, mapping the file location information to the virtual machine, so that the virtual machine obtains the video to be decoded from the main server according to the file location information, and uses the configured virtual machine computing resources to receive and decode the video to be decoded, and transmits the decoded video to be injected to the video injection device, which is connected to the main server. Through the above steps, the present invention configures multiple virtual machines on the main server, and then configures appropriate virtual machine computing resources for each virtual machine, and sends the video to be injected to the video injection device through multiple virtual machines, so that only one main server and one video injection device are needed to complete the transmission of the video data to be injected, thereby reducing the cost of use; and configuring the virtual machine computing resources based on the business demand information can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0035] Figure 1 Schematic diagram of the architecture of a video data transmission system according to an embodiment of the present invention;

[0036] Figure 2 is a flow chart of a video processing method according to an embodiment of the present invention;

[0037] Figure 3 This is a schematic diagram of the framework of the main server and virtual machine according to an embodiment of the present invention;

[0038] Figure 4 Schematic diagram of the architecture of a video processing device according to an embodiment of the present invention;

[0039] Figure 5 FIG. 1 is a schematic diagram of the architecture of a computer system of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0041] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, it will be appreciated by those skilled in the art that the technical solutions of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0042] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0043] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0044] The embodiment of the present invention provides a video data transmission system, such as Figure 1As shown, the video transmission system includes a main server 1, a video injection device 2 and a video receiving device 3.

[0045] Among them, the main server 1 can be a host computer, an industrial computer, a real-time machine or a HOST host, and can decode and process the video data. Data can be transmitted between the video processing unit 1 and the video injection unit 2 via an HDMI line. HDMI (High Definition Multimedia Interface) is a fully digital video and sound transmission interface that can transmit uncompressed audio and video signals. Video can also be transmitted between the video processing unit 1 and the video injection unit 2 via a PCIE (peripheral component interconnect express, a high-speed serial computer expansion bus standard) interface.

[0046] The video injection device 2 may be a FPGA (Field-Programmable Gate Array) video injection board.

[0047] The video receiving device 3 can be a controller with a neural network model and a machine learning algorithm. It can process the received video data and generate output results, such as object recognition in the video image. The video receiving device 3 can use the video data to verify, develop, or test algorithms used in unmanned autonomous driving (or assisted driving) technology.

[0048] The video processing method and video injection method of this embodiment can be used for simulation testing in unmanned driving technology. In particular, the main server 1 transmits the processed video to the video injection device 2, and the video injection device 2 then injects the video data into the video receiving device 3.

[0049] Specifically, the embodiment of the present invention provides a video processing method, such as Figure 2 As shown, it includes step 100, step 200, step 300 and step 400, which are specifically as follows:

[0050] Step 100: Obtain the service demand information of each virtual machine on the main server 1.

[0051] Step 200, such as Figure 3 As shown, according to the business demand information and the computing resources of the main server 1, the virtual machine computing resources of the virtual machine are configured, and the virtual machine computing resources include CPU (central processing unit) resources, GPU (graphics processing unit or graphics card) resources and memory resources.

[0052] The service requirement information includes decoding method information, which indicates whether the virtual machine needs to process the injected video through GPU hardware decoding. Further, step 200 specifically includes: determining whether the virtual machine needs to process the injected video through hardware decoding; if so, configuring a separate GPU as a GPU resource for the virtual machine.

[0053] When a virtual machine needs to implement GPU hardware decoding, an independent GPU is allocated to the virtual machine. Conversely, if a virtual machine does not need to implement GPU hardware decoding, an independent GPU may not be allocated. In this embodiment, an independent GPU can be configured for a virtual machine to improve the video decoding capability of the virtual machine.

[0054] In one embodiment, the business requirement information also includes response real-time performance, which is used to characterize the response speed of the virtual machine's program instructions. Further, step 200 specifically includes: determining whether the virtual machine needs to improve response real-time performance; if so, configuring an exclusive CPU core for the virtual machine.

[0055] When the real-time response of a virtual machine needs to be improved, an exclusive CPU core is allocated to the virtual machine. For example, if a virtual machine requires accurate system latency, the virtual machine needs to achieve very high real-time performance. In this case, one or more exclusive CPU cores can be allocated to the virtual machine, and other virtual machines and the HOST host cannot use these CPU cores.

[0056] In one embodiment, the decoding method information is also used to represent the data bandwidth of the video to be decoded. Furthermore, step 200 may specifically include determining whether the virtual machine's virtual machine computing resources match the data bandwidth; if so, configuring the virtual machine with memory resources having a memory capacity greater than a first threshold; if not, configuring the virtual machine with memory resources having a memory capacity less than a second threshold. The first threshold is greater than the second threshold.

[0057] When a virtual machine is required to quickly process high-bandwidth data such as high-resolution video sequences, a large-capacity memory is allocated to the virtual machine. The "large-capacity memory" can be a memory with a value not lower than a first threshold A. Conversely, the memory of the virtual machine can be allocated a small-capacity memory. The "small-capacity memory" can be a memory with a value not higher than a second threshold B, B<A).

[0058] In one embodiment, the service requirement information further includes the resolution of the video to be decoded. Furthermore, step 200 may specifically include configuring the memory capacity of the virtual machine based on the resolution of the video to be decoded. The higher the resolution of the video to be decoded, the larger the memory capacity configured for the virtual machine; and the smaller the resolution of the video to be decoded, the smaller the memory capacity configured for the virtual machine.

[0059] The memory (or memory resource) may refer to the memory (or memory resource) that can be used by the CPU, and may also include the memory (or memory resource) used by the CPU and the memory (or memory resource) that can be used by the GPU.

[0060] Step 300: Obtain file location information of the video to be decoded on the main server 1. The file location information may be the directory where the video to be decoded is located.

[0061] In step 400, the file location information is mapped to the virtual machine so that the virtual machine obtains the video to be decoded from the main server 1 according to the file location information, and uses the configured virtual machine computing resources to receive and decode the video to be decoded. After the decoded video to be injected is processed by the virtual machine computing resources, it is transmitted to the video injection device 2, and the video injection device 2 is connected to the main server 1.

[0062] In this embodiment, through the above steps, multiple virtual machines are configured on the main server 1, and then appropriate virtual machine computing resources are configured for each virtual machine. The video to be injected is sent to the video injection device 2 through the multiple virtual machines. In this way, only one main server 1 and one video injection device 2 are required to complete the decoding and transmission of the video data to be injected, thereby reducing the cost of use. In addition, the virtual machine computing resources are configured based on business demand information, which can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources.

[0063] In one embodiment, after the step of mapping the file location information to the virtual machine, the method further includes:

[0064] Reference information is obtained, where the reference information includes working status information of the virtual machine and / or video data reception status, and the working status information includes CPU utilization, GPU utilization, and memory utilization.

[0065] Adjust the virtual machine computing resource configuration of the virtual machine based on the reference information.

[0066] For example, the CPU utilization, GPU utilization, and memory utilization of a virtual machine can be monitored in real time. When the CPU utilization, GPU utilization, or memory utilization of a virtual machine is too high, more CPU resources, GPU resources, or memory resources can be allocated to that virtual machine. When the CPU utilization, GPU utilization, or memory utilization of a virtual machine is too low, some of that virtual machine's CPU resources, GPU resources, or memory resources can be allocated to other virtual machines with higher CPU utilization, GPU utilization, or memory utilization. This allows the overall CPU resources, GPU resources, or memory resources of the host server 1 to be fully utilized while also ensuring the normal operation of each virtual machine.

[0067] For example, the video reception status of the video injection device 2 can be queried to determine whether the goal of processing four channels of 4K resolution 30fps video has been achieved. If not, the configuration of the virtual machine computing resources can be adjusted so that each virtual machine that requires hardware decoding can achieve the goal of processing four channels of 4K resolution 30fps video.

[0068] In the prior art, virtual machines typically use CPU resources for soft decoding. However, in embodiments of the present invention, virtual machines can utilize GPU resources for hard decoding, improving video decoding efficiency. Therefore, when efficient GPU hard decoding of video is required, a dedicated GPU is assigned to the virtual machine.

[0069] On the other hand, in this embodiment, the virtual machine can use GPU hard decoding, or use CPU resources to receive the video to be decoded, give the video to be decoded to GPU resources, and also use CPU resources to output the decoded video to be injected.

[0070] In one embodiment, after configuring the virtual machine computing resources of the virtual machine according to the business demand information, the method further includes:

[0071] The virtual machine clock source of the virtual machine is synchronized with the master server 1 clock source of the master server 1, so that the virtual machine transmits the video to be injected to the video injection device 2 according to the virtual machine clock source and the timestamp of the video to be injected.

[0072] Each virtual machine is highly synchronized with the clock source of the same main server 1, so that the video can be injected synchronously. The video injection device 2 can synchronously inject video frames with the same timestamp into the video receiving device 3.

[0073] The video processing method of this embodiment can ensure the real-time performance and data bandwidth of video processing. For example, when processing 3840x2160 resolution 30fps frame rate video, efficient data processing by the CPU and GPU is required to complete the decoding and output work within 33ms. At the same time, since each pixel has RGB3 bytes, the bandwidth required to be processed is 3840x2160x3x30=746496000 bytes per second, which is approximately 750MB / s. Based on the above data, after reasonably allocating virtual machine computing resources, CPU utilization, GPU utilization, and memory utilization are all fully utilized, and the goal of each virtual machine requiring hardware decoding to process four channels of 4K30fps can be achieved.

[0074] On the other hand, during the working process, the main server 1 can also be connected to the video injection device 2 (such as FPGA) at the back end based on the CPU utilization, GPU utilization, memory utilization and other computing resource usage. The FPGA at the back end can determine whether the goal of processing 4 channels of 4K30fps is achieved based on the reception of video data. If not, it can provide alarm feedback or output performance reports to provide a basis for changing the resource configuration of the virtual machine.

[0075] In this embodiment, multiple virtual machines can be configured on the main server 1, and then appropriate virtual machine computing resources can be configured for each virtual machine. The video to be injected can be sent to the video injection device 2 through multiple virtual machines. In this way, only one main server 1 and one video injection device 2 are needed to complete the transmission of the video data to be injected, thereby reducing the cost of use. In addition, the virtual machine computing resources are configured based on business demand information, which can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources.

[0076] At the same time, this embodiment adopts a solution for efficient collaboration of multiple GPUs and utilizes virtualization technology so that a main server 1 can support the output of multiple graphics cards. Each graphics card can work independently without interfering with each other's performance. This embodiment can effectively improve the utilization rate of computing resources such as CPU, GPU, and memory, and improve the efficiency of power utilization. This embodiment uses the clock source of the same main server 1, and each virtual machine forms a high-precision clock source synchronization, which provides a guarantee for the time accuracy of completing the camera video re-injection work. At the same time, the use of virtualization technology can be extended to clusters, and resources can be easily configured as needed in the computer room environment.

[0077] An embodiment of the present invention further provides a video injection method, comprising:

[0078] Receive the video to be injected, where the video data to be injected is obtained according to the above-mentioned video processing method;

[0079] The video to be injected is injected into the video receiving device 3 according to the timestamp of the video to be injected.

[0080] The video injection method of this embodiment utilizes the video processing method provided by the above embodiment. Multiple virtual machines can be configured on the main server 1, and then appropriate virtual machine computing resources can be configured for each virtual machine. The video to be injected is sent to the video injection device 2 through multiple virtual machines. In this way, only one main server 1 and one video injection device 2 are required to complete the transmission of the video data to be injected, reducing the cost of use. In addition, the virtual machine computing resources are configured based on business demand information, which can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources.

[0081] At the same time, in some instances, a solution for efficient collaboration of multiple GPUs can be adopted, and virtualization technology can be used to enable a main server 1 to support the output of multiple graphics cards, and each graphics card can work independently without interfering with each other's performance. This embodiment can effectively improve the utilization rate of computing resources such as CPU, GPU, and memory, and improve the efficiency of power utilization. This embodiment uses the clock source of the same main server 1, and each virtual machine forms a high-precision clock source synchronization, which provides a guarantee for the time accuracy of completing the camera video re-injection work. At the same time, the use of virtualization technology can be extended to clusters, and resources can be easily configured as needed in the computer room environment.

[0082] Each virtual machine can utilize GPU resources for hard decoding of the video being decoded, or CPU resources for soft decoding. Because the resolution of HD video is significantly higher than that of standard video formats, the bitrate of HD video is very high. Furthermore, encoding methods such as VC-1 and H.264 offer high compression ratios, resulting in a high decoding workload. Therefore, conventionally using the CPU for decoding (often referred to as "soft decoding") can significantly deplete CPU computing power. For example, some older CPUs often experience CPU utilization rates exceeding 90% when soft decoding H.264, and even older CPUs may not be able to handle this performance.

[0083] Therefore, in one embodiment, it is possible to select whether to use GPU decoding or CPU decoding for the virtual machine based on at least one of the encoding method, encoding compression rate, bit rate, resolution, etc. of the video to be decoded. For example, if the encoding method of a video to be decoded is an encoding method with a compression rate higher than a threshold, it is determined that the video to be decoded needs to be decoded using GPU hardware, and the corresponding decoding method information can be obtained. For another example, if the encoding method of a video to be decoded is VC-1 and H.264, etc., it is determined that the video to be decoded needs to be decoded using GPU hardware by the corresponding virtual machine, and the corresponding decoding method information can be obtained. In addition, if a video to be decoded is not confirmed to need to be decoded using GPU hardware, it can be determined that the video to be decoded needs to be decoded using CPU software by the corresponding virtual machine.

[0084] Through the above method, resources can be fully utilized while avoiding the situation where the CPU decoding occupancy rate is too high and decoding is not moving. In addition, because the number of GPUs is limited, GPU hardware decoding is only used under specific conditions, which can effectively save GPU resources. This embodiment also provides a video processing device, such as Figure 4 Shown, including:

[0085] The first acquisition unit 501 is used to obtain the service demand information of each virtual machine on the main server;

[0086] A configuration unit 502 is configured to configure virtual machine computing resources of the virtual machine according to the business demand information and the computing resources of the host server, where the virtual machine computing resources include CPU resources, GPU resources, and memory resources;

[0087] The second obtaining unit 503 is used to obtain the file location information of the video to be decoded on the main server;

[0088] The mapping unit 504 is used to map the file location information to the virtual machine so that the virtual machine obtains the video to be decoded from the main server according to the file location information, and uses the configured virtual machine computing resources to receive and decode the video to be decoded, and transmits the decoded video to be injected to the video injection device, which is connected to the main server.

[0089] The video processing device of this embodiment adopts the video processing method provided by the above embodiment. Multiple virtual machines can be configured on the main server 1, and then appropriate virtual machine computing resources are configured for each virtual machine. The video to be injected is sent to the video injection device 2 through multiple virtual machines. In this way, only one main server 1 and one video injection device 2 are required to complete the transmission of the video data to be injected, thereby reducing the cost of use. Moreover, the virtual machine computing resources are configured based on the business demand information, which can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources.

[0090] At the same time, this embodiment adopts a solution for efficient collaboration of multiple GPUs and utilizes virtualization technology so that a main server 1 can support the output of multiple graphics cards. Each graphics card can work independently without interfering with each other's performance. This embodiment can effectively improve the utilization rate of computing resources such as CPU, GPU, and memory, and improve the efficiency of power utilization. This embodiment uses the clock source of the same main server 1, and each virtual machine forms a high-precision clock source synchronization, which provides a guarantee for the time accuracy of completing the camera video re-injection work. At the same time, the use of virtualization technology can be extended to clusters, and resources can be easily configured as needed in the computer room environment.

[0091] Figure 5 A schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present invention is shown.

[0092] It should be noted that Figure 5 The computer system of the electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0093] like Figure 5As shown, the computer system includes a central processing unit (CPU) 1801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1802 or the program loaded from the storage part 1808 into the random access memory (RAM) 1803, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 1803. The CPU 1801, ROM 1802 and RAM 1803 are connected to each other via a bus 1804. An input / output (I / O) interface 1805 is also connected to the bus 1804.

[0094] The following components are connected to the I / O interface 1805: an input section 1806 including a keyboard, a mouse, and the like; an output section 1807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 1808 including a hard disk; and a communication section 1809 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 1809 performs communication processing via a network such as the Internet. A drive 1810 is also connected to the I / O interface 1805 as needed. Removable media 1811, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1810 as needed, so that computer programs read from the removable media can be installed in the storage section 1808 as needed.

[0095] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program carried on a computer-readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1809 and / or installed from a removable medium 1811. When the computer program is executed by the central processing unit (CPU) 1801, the various functions defined in the system of the present invention are performed.

[0096] It should be noted that the computer-readable medium shown in the embodiments of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0097] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0098] The units involved in the embodiments of the present invention may be implemented in software or hardware, and the units described may also be provided in a processor. In some cases, the names of these units do not limit the units themselves.

[0099] Specifically, the electronic device of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the video data transmission method and / or video data injection method provided in the above embodiments are implemented.

[0100] Through the electronic device of this embodiment, first obtain the business demand information of each virtual machine on the main server; secondly, configure the virtual machine computing resources of the virtual machine according to the business demand information and the computing resources of the main server, and the virtual machine computing resources include CPU resources, GPU resources and memory resources; then obtain the file location information of the video to be injected on the main server; finally, map the file location information to the virtual machine, so that the virtual machine obtains the video to be decoded from the main server according to the file location information, and uses the configured virtual machine computing resources to receive and decode the video to be decoded, and transmits the decoded video to be injected to the video injection device, which is connected to the main server. Through the above steps, the present invention configures multiple virtual machines on the main server, and then configures appropriate virtual machine computing resources for each virtual machine, and sends the video to be injected to the video injection device through multiple virtual machines. In this way, only one main server and one video injection device are needed to complete the transmission of the video data to be injected, thereby reducing the cost of use; and configuring the virtual machine computing resources based on the business demand information can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources.

[0101] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not incorporated into the electronic device. The storage medium carries one or more computer programs, and when executed by a processor of the electronic device, the electronic device implements the methods provided in the above embodiments.

[0102] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0103] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present invention.

[0104] Specifically, through the storage medium of this embodiment, first obtain the business demand information of each virtual machine on the main server; secondly, configure the virtual machine computing resources of the virtual machine according to the business demand information and the computing resources of the main server, and the virtual machine computing resources include CPU resources, GPU resources and memory resources; then obtain the file location information of the video to be injected on the main server; finally, map the file location information to the virtual machine, so that the virtual machine obtains the video to be decoded from the main server according to the file location information, and uses the configured virtual machine computing resources to receive and decode the video to be decoded, and transmits the decoded video to be injected to the video injection device, which is connected to the main server. Through the above steps, the present invention configures multiple virtual machines on the main server, and then configures appropriate virtual machine computing resources for each virtual machine, and sends the video to be injected to the video injection device through multiple virtual machines. In this way, only one main server and one video injection device are needed to complete the transmission of the video data to be injected, thereby reducing the cost of use; and configuring the virtual machine computing resources based on the business demand information can avoid unstable video processing caused by multiple tasks simultaneously occupying computing resources.

[0105] Other embodiments of the present invention will readily occur to those skilled in the art after considering the specification and practicing the embodiments disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein.

[0106] It should be understood that the present invention is not limited to the exact construction described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A video processing method, characterized in that: include: Obtain business demand information for each virtual machine on the master server; Configuring virtual machine computing resources of the virtual machine according to the business demand information and the computing resources of the host server, wherein the virtual machine computing resources include CPU resources, GPU resources, and memory resources; Obtain file location information of the video to be decoded on the main server; Mapping the file location information to the virtual machine so that: The virtual machine obtains the video to be decoded from the main server according to the file location information, receives and decodes the video to be decoded using the configured virtual machine computing resources, and transmits the decoded video to be injected to a video injection device connected to the main server. Specifically, the video to be injected is sent to the video injection device through multiple virtual machines, and the video to be injected is configured to be transmitted by the video injection device to a video receiving device for simulation testing; The service requirement information includes decoding method information, and the decoding method information is used to indicate whether the virtual machine needs to process the video to be decoded through GPU hardware decoding. Specifically, whether GPU decoding or CPU decoding is selected for the virtual machine based on at least one of the encoding method, encoding compression rate, bit rate, and resolution of the video to be decoded; The step of configuring the virtual machine computing resources of the virtual machine according to the business demand information includes: determining whether the virtual machine needs to process the video to be decoded through GPU hardware decoding; if so, configuring an independent GPU for the virtual machine as the GPU resource; if not, not allocating an independent GPU for the virtual machine; After the step of configuring the virtual machine computing resources of the virtual machine according to the business demand information, the method further includes: The virtual machine clock source of the virtual machine is synchronized with the main server clock source of the main server, so that the virtual machine transmits the video to be injected to the video injection device according to the virtual machine clock source and the timestamp of the video to be injected.

2. The video processing method according to claim 1, wherein: After the step of mapping the file location information to the virtual machine, the method further includes: Acquire reference information, where the reference information includes working status information of the virtual machine and / or video data reception status, where the working status information includes CPU utilization, GPU utilization, and memory utilization; Adjust the virtual machine computing resource configuration of the virtual machine according to the reference information.

3. The video processing method according to claim 1, wherein: The step of using the configured virtual machine computing resources to receive and decode the video to be decoded includes: The virtual machine is enabled to decode the video to be decoded using the configured GPU resources to obtain the video to be injected.

4. The video processing method according to claim 1, wherein: The business requirement information further includes response real-time performance, where the response real-time performance is used to characterize the program instruction response speed of the virtual machine. The step of configuring virtual machine computing resources of the virtual machine according to the business requirement information includes: Determining whether the virtual machine needs to improve real-time response performance; If so, an exclusive CPU core is configured for the virtual machine.

5. The video processing method according to claim 1, wherein: The service requirement information further includes information for characterizing the data bandwidth of the video to be decoded. The step of configuring the virtual machine computing resources of the virtual machine according to the service requirement information includes: Determining whether the virtual machine computing resources of the virtual machine match the data bandwidth; If so, memory resources with a memory capacity greater than a first threshold are configured for the virtual machine; if not, memory resources with a memory capacity less than a second threshold are configured for the virtual machine.

6. The video processing method according to claim 1, wherein: The business requirement information further includes the resolution of the video to be decoded. The step of configuring the virtual machine computing resources of the virtual machine according to the business requirement information includes: The memory capacity of the virtual machine is configured according to the resolution of the video to be decoded.

7. A video injection method, characterized in that: include: receiving a video to be injected, wherein the video data to be injected is obtained by the video processing method according to any one of claims 1 to 6; Inject the video to be injected into a video receiving device according to the timestamp of the video to be injected.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the video processing method according to any one of claims 1 to 6 or the video injection method according to claim 7 is implemented.

Citation Information

Patent Citations

  • Resource allocation method, resource allocation device and resource allocation system

    CN102567072A

  • Business processing method and device, terminal equipment and storage medium

    CN115460040A