Data transmission method and server
By intercepting and sending drawing instructions on the server side, combined with image encoding processing in historical rendering requests, the problem of large image transmission volume is solved, server performance and bandwidth requirements are reduced, and efficient image transmission is achieved.
Patent Information
- Application Number
- CN202010363206.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-04-30
AI Technical Summary
In scenarios with high image quality requirements, in the existing technology, the server needs to perform image rendering and send a large amount of image data, resulting in high network bandwidth requirements and heavy server performance pressure. Especially when supporting multiple clients, there is a large amount of data transmission. problem.
By intercepting the drawing instructions in the image rendering request on the server side instead of the final image, sending it to the client for rendering, and using the images in historical rendering requests for encoding processing, the amount of image transmission data is reduced.
It reduces the data processing pressure and network bandwidth requirements on the server side, reduces the workload of the server, does not even require GPU resources, and improves image transmission efficiency.
Smart Images

Figure CN111629228B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of electronic information technology, and in particular to a data transmission method and a server. Background Art
[0002] In many existing scenarios, such as online games, three-dimensional (3D) videos or 3D remote desktop transmission, 3D image transmission and client display are required. In order to meet this requirement, the existing technology adopts the following technical means: image rendering is performed on the server, and the rendered images are sent frame by frame to the client, which decodes and displays them.
[0003] However, in scenarios with high image quality requirements, on the one hand, the amount of image data transmitted is very large, which places very high demands on network bandwidth; on the other hand, the server may need to support image rendering work for a large number of clients at the same time, which places very high performance requirements on the server.
[0004] Although the server can send 2D rendering instructions and 3D rendering instructions to the client to solve part of the image transmission pressure, it is also necessary to send images related to image rendering to the client at the same time when sending instructions to complete the image rendering. In this process, the amount of image data sent is also very large, which requires a very high network bandwidth. Summary of the invention
[0005] The embodiment of the present disclosure provides a data transmission method and a server, which can solve the problem of large data transmission volume when the server transmits image data to the client device in the cloud desktop technology. The technical solution is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a data transmission method is provided, the method comprising:
[0007] receiving a target image rendering request, where the target image rendering request is used to request rendering and generating a target image on a target device, where the target image may include a 3D image or a 2D image;
[0008] According to the target image rendering request, a target instruction in the image rendering request is obtained, and according to the instruction type, a first rendering instruction in the target instruction is found, the first rendering instruction is used to instruct to complete rendering according to the first image, wherein the server does not need to perform image rendering according to the target instruction;
[0009] According to the first rendering instruction, a second rendering instruction is found in the historical image rendering request, where the second rendering instruction is used to instruct to complete rendering according to the second image;
[0010] When the comparison result between the first rendering instruction and the second rendering instruction meets the preset result, encoding the first image according to the second image;
[0011] The second rendering instruction and the encoded first image are sent.
[0012] In one embodiment, the method of finding the second rendering instruction in the historical image rendering request includes:
[0013] Obtaining a preset time threshold and a target time at which the target image rendering request is received;
[0014] According to the target time and the time threshold, obtaining at least one historical image rendering request corresponding to the target image rendering request;
[0015] In the historical rendering request, at least one second rendering instruction is found according to the instruction type.
[0016] In one embodiment, when the comparison result between the first rendering instruction and the second rendering instruction meets a preset value, the method includes:
[0017] Obtaining a comparison item, the comparison item including function information in the instruction, the function information including a function name and function parameters;
[0018] According to the comparison item, sequentially comparing the first rendering instruction and the second rendering instruction;
[0019] When the comparison items in the first rendering instruction are the same as the comparison items in the second rendering instruction, it is determined that the comparison result between the first rendering instruction and the second rendering instruction meets the preset result.
[0020] In one embodiment, the method includes encoding the first image according to the second image, comprising:
[0021] Using the second image as a coding reference image, obtaining a comparison result between the second image and the first image;
[0022] When the comparison result shows an image of the same portion, obtaining position information corresponding to the image of the same portion;
[0023] When the comparison result shows different parts of the image, marking the different parts of the image;
[0024] The encoding process of the first image is realized by encoding the image of the different parts and the position information.
[0025] In one embodiment, the method sends the second rendering instruction, including:
[0026] Obtaining target identification information of the second rendering instruction;
[0027] The second rendering instruction is sent by sending the target identification information.
[0028] In the present invention, the server sends the drawing instructions instead of the final image to the client through the network, and the final rendering work is performed on the client. In this way, the workload of the server is greatly reduced, and even GPU resources are not required. The server is only responsible for collecting the rendering instructions and sending them to the client. Further, the image referenced in the target instruction is encoded according to the image referenced in the historical rendering request, thereby reducing the amount of image transmission data and thus reducing the bandwidth.
[0029] According to a second aspect of an embodiment of the present disclosure, there is provided a server, comprising: a receiver, a processor and a transmitter, wherein the processor is connected to the receiver and the transmitter respectively;
[0030] The receiver is used to receive a target image rendering request, where the target image rendering request is used to request rendering on a target device to generate a target image, where the target image may include a 3D image or a 2D image;
[0031] The processor is configured to obtain a target instruction in the image rendering request according to the target image rendering request, and to find a first rendering instruction in the target instruction according to the instruction type, wherein the first rendering instruction is used to instruct to complete rendering according to the first image, wherein the server does not need to perform image rendering according to the target instruction;
[0032] According to the first rendering instruction, a second rendering instruction is found in the historical image rendering request, where the second rendering instruction is used to instruct to complete rendering according to the second image;
[0033] When the comparison result between the first rendering instruction and the second rendering instruction meets the preset result, encoding the first image according to the second image;
[0034] The transmitter is used to send the second rendering instruction and the encoded first image.
[0035] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0037] Figure 1 is a flow chart of a data transmission method provided by an embodiment of the present disclosure;
[0038] Figure 2 is a schematic diagram of a system structure in a data transmission method provided by an embodiment of the present disclosure;
[0039] Figure 3 It is a data processing logic diagram of a data transmission method provided by an embodiment of the present disclosure;
[0040] Figure 4 It is a structural diagram of a server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0042] Embodiment 1
[0043] The present disclosure provides a data transmission method, such as Figure 1 As shown, the data transmission method is applied to the server and includes the following steps:
[0044] 101. Receive a target image rendering request.
[0045] The target image rendering request is used to request rendering on a target device to generate a target image, and the target image may include a 3D or 2D image.
[0046] 102. Execute the rendering request, and before the image rendering request is completely executed, intercept a target instruction in the image rendering request.
[0047] The method provided by the present disclosure intercepts the target instruction in the image rendering request, and the target instruction is used to instruct to complete the rendering. Specifically, the target instruction may include: a graphics card configuration instruction, a special effect instruction, and a drawing instruction;
[0048] The server executes the image rendering request locally, and before the image rendering request is completed, it intercepts the image rendering instruction (target instruction) generated in the process of executing the image rendering request; that is, there is no need to perform image rendering according to the instruction in the server, so the image rendering request will not enter the graphics card on the server side for execution, but will be sent to the client after interception and executed by the client graphics card; thereby alleviating the data processing pressure on the server side, and even without the need for a graphics processor to support the 3D image rendering tasks of a large number of clients, and also reducing the need for server upgrades.
[0049] The method provided in the present disclosure also includes parsing the rendering instruction to obtain the target instruction from the image rendering instruction for the current image rendering request, and according to the type of instruction, finding the first rendering instruction that references the image, such as obtaining the first rendering instruction, which includes a reference to the first image.
[0050] The drawing instruction is composed of one or more functions containing specific parameters, which can be reproduced in the operating system of the client target device to complete the final 3D image rendering. For example, the received drawing instruction is: func1 (parameter 1, parameter 2, parameter 3); func2 (parameter 1, parameter 2); func3 (parameter 1, parameter 2, parameter 3, parameter 4); wherein func1, func2, and func3 are three exemplary function names given to distinguish different functions. According to the above example, the data processing device can execute the three functions in the drawing instruction to perform 3D image rendering (that is, the function reproduction process).
[0051] Generally speaking, the parameters of a drawing function can generally include the following types of information: drawing position information, drawing information, and referenced image information; among them, drawing position information refers to all relevant information used to indicate the image drawing position; drawing information refers to information related to the drawing shape, size, color, line type, etc.; referenced image information refers to information such as the name of the image that needs to be referenced in the drawing.
[0052] In the prior art, when a drawing instruction includes referenced image information, when a drawing function is sent to a client, a corresponding image also needs to be sent to the client at the same time. When sending the image, the amount of image data sent is relatively large, which increases the data processing pressure and transmission efficiency of the server. Therefore, the present invention compresses the referenced image to improve efficiency and reduce pressure.
[0053] 103. According to the first rendering instruction, find a second rendering instruction in the historical image rendering request, where the second rendering instruction includes instructions for rendering according to the second image.
[0054] The method provided by the present disclosure searches for a second rendering instruction in the historical image rendering request, comprising:
[0055] Obtaining a preset time threshold and a target time at which the target image rendering request is received;
[0056] According to the target time and the time threshold, obtaining at least one historical image rendering request corresponding to the target image rendering request;
[0057] In the historical rendering request, at least one second rendering instruction is found according to the instruction type, and the specific instruction type may be a drawing instruction or other instructions that need to reference the second image. Of course, the second rendering instruction may also be found based on a more underlying function parameter.
[0058] 104. When a comparison result between the first rendering instruction and the second rendering instruction meets a preset value, encode the first image according to the second image.
[0059] The method provided by the present disclosure determines whether a comparison result between the first rendering instruction and the second rendering instruction meets a preset value, including:
[0060] Obtaining a comparison item, the comparison item including function information in the instruction, the function information including a function name and function parameters;
[0061] According to the comparison item, sequentially comparing the first rendering instruction and the second rendering instruction;
[0062] When the comparison items in the first rendering instruction are the same as the comparison items in the second rendering instruction, it is determined that the comparison result between the first rendering instruction and the second rendering instruction meets the preset result.
[0063] Specifically, the judgment standard for judging whether the two image rendering instructions in the first image rendering instruction and the second image rendering instruction meet the condition is: the function name and the parameter are the same, that is, the processing performed by the function and the location where the corresponding processing is performed on the current image are exactly the same. It should be noted that in this step, the information of the referenced images is not compared, and the first image and the second image can be the same or different.
[0064] Furthermore, the first rendering instruction may include multiple instructions of the same type, and the second rendering instruction may also include multiple instructions of the same type. For example, when searching for the second rendering instruction, the following instructions may be included:
[0065] A rendering instruction that is exactly the same as the second rendering instruction is found from the first rendering instruction. The image rendering instructions that meet the conditions are called the first target image rendering instruction and the second target image rendering instruction, wherein the first target image rendering instruction comes from the first image rendering instruction and the second target image rendering instruction comes from the second image rendering instruction.
[0066] The method provided by the present disclosure, when encoding a first image, encodes an image referenced in a first target image rendering instruction for a rendering request of a current image according to an image referenced in a second target image rendering instruction for a previous image rendering request, specifically comprising:
[0067] Using the second image as a coding reference image, obtaining a comparison result between the second image and the first image;
[0068] When the comparison result shows an image of the same portion, obtaining position information corresponding to the image of the same portion;
[0069] When the comparison result shows different parts of the image, marking the different parts of the image;
[0070] The encoding process of the first image is achieved by encoding the different parts of the image and the position information.
[0071] In practical applications, the encoding method can be selected according to actual needs. For example, the referenced first image can be encoded by combining inter-frame encoding and intra-frame encoding, thereby improving the efficiency of image encoding and reducing the amount of data transmitted for several images.
[0072] 105. Send the second rendering instruction and the encoded first image.
[0073] When sending the second rendering instruction, the method provided by the present disclosure can send the second rendering instruction by sending the target identification information corresponding to the second rendering instruction, and mark the encoded first image by the target identification information, thereby facilitating the client's target device to distinguish which image rendering instruction the first image is encoded with reference to.
[0074] When sending the target instruction, the method provided by the present disclosure also marks the target instruction, specifically including:
[0075] Obtaining target identification information corresponding to the target instruction, where the target identification information includes identification information of the second rendering instruction;
[0076] Marking the target instruction by the target identification information;
[0077] Send the marked target command.
[0078] By marking the target instructions, when the client receives the image rendering instructions sent by the server, it can distinguish which image rendering instructions are used to encode the first image; at the same time, it can also distinguish which image rendering instructions are for which image rendering request, and determine the order of each image rendering request.
[0079] Here is a specific system diagram, such as Figure 2As shown, the server 201 and the client target device 202 can communicate with each other, and both the client target device 201 and the server are configured with an operating system that supports the Windows Display Driver Model (WDDM).
[0080] The specific data processing logic diagram of the server is as follows Figure 3 As shown: the target image rendering request received by the service is the currently received image rendering request, and the historical image rendering request is an image rendering request before the target image rendering request. After receiving each image rendering request, the server will execute the image rendering request locally and intercept the generated image rendering instructions during the execution of the image rendering request. The image rendering instruction of the referenced image corresponding to the target image rendering request is recorded as the first rendering instruction. The image rendering instruction of the referenced image corresponding to the historical image rendering request is recorded as the second rendering instruction. The first image rendering instruction and the second image rendering instruction are compared. If the comparison result of the first image rendering instruction and the second rendering instruction meets the preset result, the first image can be encoded with reference to the second image, that is, the encoded first image is sent to the client target device as the image referenced by the first rendering instruction.
[0081] When the client receives the target image rendering instruction, it will decode the referenced image with reference to the second image. That is, before executing the currently received image rendering instruction, the client needs to cache the decoding results (decoded images) of all images referenced in the last received image rendering instruction. In actual implementation, the client can cache the decoding results of the images referenced in one or more recently received image rendering instructions.
[0082] The data transmission method provided by the embodiment of the present disclosure is that after receiving an image rendering request, the server parses the image rendering request and obtains a target instruction, which includes a first rendering instruction. According to the first rendering instruction, the server finds a second rendering instruction in the historical image rendering request. When the comparison result between the second rendering instruction and the first rendering instruction meets the preset result, the server encodes the first image according to the second image, and sends the encoded first image and second image rendering instructions to the client target device. In the present disclosure, the server sends the drawing instructions instead of the final image to the client through the network, and the final rendering work is performed on the client. In this way, the workload of the server is greatly reduced, and even GPU resources are not required. The server is only responsible for collecting the rendering instructions and sending them to the client. The image referenced in the target instruction is further encoded according to the image referenced in the historical rendering request, thereby reducing the amount of image transmission data and thus reducing bandwidth.
[0083] Embodiment 2
[0084] Based on the above Figure 1 and Figure 3 The data transmission method described in the corresponding embodiment is as follows: an embodiment of the device of the present disclosure, which can be used to execute the embodiment of the method of the present disclosure.
[0085] The present disclosure provides a server, such as Figure 4 As shown, the server 40 includes: a receiver 401, a processor 402 and a transmitter 403, wherein the processor 402 is connected to the receiver 401 and the transmitter 403 respectively;
[0086] The receiver 401 is used to receive a target image rendering request, where the target image rendering request is used to request rendering on a target device to generate a target image, where the target image may include a 3D image or a 2D image, and send the target image rendering request to the processor 402;
[0087] The processor 402 is configured to obtain a target instruction in the image rendering request according to the target image rendering request, where the target instruction includes a first rendering instruction, where the first rendering instruction is used to instruct to complete rendering according to the first image, wherein the server does not need to perform image rendering according to the target instruction;
[0088] According to the first rendering instruction, a second rendering instruction is found in the historical image rendering request, where the second rendering instruction is used to instruct to complete rendering according to the second image;
[0089] When the comparison result between the first rendering instruction and the second rendering instruction meets the preset result, encoding the first image according to the second image;
[0090] and sending the target instruction and the first image which has been encoded to the transmitter 403;
[0091] The transmitter 403 is used to send the second rendering instruction and the encoded first image.
[0092] In one embodiment, the processor 402 in the apparatus 40 of the present disclosure is further configured to:
[0093] Obtaining a preset time threshold and a target time at which the target image rendering request is received;
[0094] According to the target time and the time threshold, obtaining at least one historical image rendering request corresponding to the target image rendering request;
[0095] In the historical rendering request, at least one second rendering instruction is found according to the instruction type.
[0096] In one embodiment, the processor 402 in the apparatus 40 of the present disclosure is further configured to:
[0097] Obtaining a comparison item, the comparison item including function information in the instruction, the function information including a function name and function parameters;
[0098] According to the comparison item, sequentially comparing the first rendering instruction and the second rendering instruction;
[0099] When the comparison items in the first rendering instruction are the same as the comparison items in the second rendering instruction, it is determined that the comparison result between the first rendering instruction and the second rendering instruction meets the preset result.
[0100] In one embodiment, the processor 402 in the apparatus 40 of the present disclosure is further configured to:
[0101] Using the second image as a coding reference image, obtaining a comparison result between the second image and the first image;
[0102] When the comparison result shows an image of the same portion, obtaining position information corresponding to the image of the same portion;
[0103] When the comparison result shows different parts of the image, marking the different parts of the image;
[0104] The encoding process of the first image is achieved by encoding the different parts of the image and the position information.
[0105] In one embodiment, the processor 402 in the apparatus 40 of the present disclosure is further configured to:
[0106] Obtaining target identification information of the second rendering instruction;
[0107] The second rendering instruction is sent by sending the target identification information.
[0108] The server provided by the embodiment of the present disclosure, after receiving an image rendering request, parses the image rendering request and obtains a target instruction, the target instruction including a first rendering instruction, finds a second rendering instruction in a historical image rendering request according to the first rendering instruction, encodes the first image according to the second image when the comparison result between the second rendering instruction and the first rendering instruction meets the preset result, and sends the encoded first image and second image rendering instructions to the client target device. In the present disclosure, the server sends the drawing instructions instead of the final image to the client through the network, and the final rendering work is performed on the client. In this way, the workload of the server is greatly reduced, and even GPU resources are not needed. The server is only responsible for collecting the rendering instructions and sending them to the client. Further, the image referenced in the target instruction is encoded according to the image referenced in the historical rendering request, thereby reducing the amount of image transmission data and thus reducing bandwidth.
[0109] Based on the above Figure 1 and Figure 3 Corresponding to the data transmission method described in the embodiment, the embodiment of the present disclosure also provides a computer-readable storage medium, for example, a non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The storage medium stores computer instructions for executing the above Figure 1 and Figure 3 The data transmission method described in the corresponding embodiment will not be repeated here.
[0110] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
Claims
1. A data transmission method, characterized in that: Applied to a server, the method comprises: receiving a target image rendering request, wherein the target image rendering request is used to request rendering and generating a target image on a target device, wherein the target image may include a 3D image or a 2D image; According to the target image rendering request, a target instruction in the image rendering request is obtained, and according to the instruction type, a first rendering instruction in the target instruction is found, where the first rendering instruction is used to instruct to complete rendering according to the first image; According to the first rendering instruction, a second rendering instruction is found in the historical image rendering request, where the second rendering instruction is used to instruct to complete rendering according to the second image; When a comparison result between the first rendering instruction and the second rendering instruction meets a preset result, encoding the first image according to the second image; Sending the second rendering instruction and the encoded first image; The step of finding the second rendering instruction in the historical image rendering request includes: Obtaining a preset time threshold and a target time of receiving the target image rendering request; Acquire, according to the target time and the time threshold, at least one historical image rendering request corresponding to the target image rendering request; In the historical rendering request, at least one second rendering instruction is found according to the instruction type.
2. The method according to claim 1, characterized in that When the comparison result between the first rendering instruction and the second rendering instruction meets a preset value, it includes: Acquire a comparison item, wherein the comparison item includes function information in the instruction, and the function information includes a function name and function parameters; According to the comparison item, comparing the first rendering instruction and the second rendering instruction in sequence; When the comparison items in the first rendering instruction are the same as the comparison items in the second rendering instruction, it is determined that the comparison result between the first rendering instruction and the second rendering instruction meets the preset result.
3. The method according to claim 1, characterized in that The encoding process of the first image according to the second image includes: Using the second image as a coding reference image, and obtaining a comparison result between the second image and the first image; When the comparison result shows an image of the same portion, obtaining position information corresponding to the image of the same portion; When the comparison result shows different parts of the image, marking the different parts of the image; The encoding process of the first image is achieved by encoding the images of the different parts and the position information.
4. The method according to claim 1, characterized in that: The sending of the second rendering instruction comprises: Obtaining target identification information of the second rendering instruction; The second rendering instruction is sent by sending the target identification information.
5. A server, characterized in that: include: A receiver, a processor and a transmitter, wherein the processor is connected to the receiver and the transmitter respectively; The receiver is used to receive a target image rendering request, where the target image rendering request is used to request rendering on a target device to generate a target image, where the target image may include a 3D image or a 2D image; The processor is configured to obtain a target instruction in the image rendering request according to the target image rendering request, and to find a first rendering instruction in the target instruction according to the instruction type, wherein the first rendering instruction is used to instruct to complete rendering according to the first image; According to the first rendering instruction, a second rendering instruction is found in the historical image rendering request, where the second rendering instruction is used to instruct to complete rendering according to the second image; When a comparison result between the first rendering instruction and the second rendering instruction meets a preset result, encoding the first image according to the second image; The transmitter is used to send the second rendering instruction and the encoded first image; The processor is further configured to: Obtaining a preset time threshold and a target time of receiving the target image rendering request; Acquire, according to the target time and the time threshold, at least one historical image rendering request corresponding to the target image rendering request; In the historical rendering request, at least one second rendering instruction is found according to the instruction type.
6. The server according to claim 5, characterized in that: The processor is further configured to: Acquire a comparison item, wherein the comparison item includes function information in the instruction, and the function information includes a function name and function parameters; According to the comparison item, comparing the first rendering instruction and the second rendering instruction in sequence; When the comparison items in the first rendering instruction are the same as the comparison items in the second rendering instruction, it is determined that the comparison result between the first rendering instruction and the second rendering instruction meets the preset result.
7. The server according to claim 5, characterized in that: The processor is further configured to: Using the second image as a coding reference image, and obtaining a comparison result between the second image and the first image; When the comparison result shows an image of the same portion, obtaining position information corresponding to the image of the same portion; When the comparison result shows different parts of the image, marking the different parts of the image; The encoding process of the first image is achieved by encoding the images of the different parts and the position information.
8. The server according to any one of claims 5 to 7, characterized in that: The processor is further configured to: Obtaining target identification information of the second rendering instruction; The second rendering instruction is sent by sending the target identification information.
