Data processing method and apparatus, computing device, and system
This application discloses a data processing method and apparatus, a computing device, and a system, and relates to the field of remote control. The method includes: A first computing device obtains first information used by a second computing device to display a first image, where the first information includes a drawing instruction, and the drawing instruction is used to render first to-be-rendered data to obtain the first image. The first computing device determines indication information of the first to-be-rendered data, and sends second information that includes the drawing instruction and the indication information to the second computing device.
1 . A method, performed by a first computing device, and the method comprising:
obtaining first information, wherein the first information indicates to a second computing device to display a first image, the first information comprises a drawing instruction, and the drawing instruction is used to render first to-be-rendered data to obtain the first image;
determining whether the first to-be-rendered data was previously sent by the first computing device to the second computing device;
determining, based on a sending record, indication information of the first to-be-rendered data based on whether the first to-be-rendered data was previously sent by the first computing device to the second computing device, wherein the indication information comprises a first indication or a second indication, the first indication identifies that the first to-be-rendered data was previously sent by the first computing device to the second computing device, the second indication identifies compressed data that is of the first to-be-rendered data and that is currently sent by the first computing device to the second computing device, the sending record indicates to-be-rendered data that has been sent by the first computing device to the second computing device, and wherein determining the indication information of the first to-be-rendered data comprises:
obtaining an identifier of the first to-be-rendered data; and
determining the indication information by comparing the identifier of the first to-be-rendered data with one or more identifiers of to-be-rendered data comprised in the sending record; and
sending second information to the second computing device, wherein the second information comprises the drawing instruction and the indication information.
2 . The method according to claim 1 , wherein determining the indication information by comparing the identifier of the first to-be-rendered data with the one or more identifiers of to-be-rendered data comprised in the sending record comprises:
when the sending record comprises the identifier of the first to-be-rendered data, comprising the identifier of the first to-be-rendered data in the indication information.
3 . The method according to claim 1 , wherein determining the indication information by comparing the identifier of the first to-be-rendered data with the one or more identifiers of to-be-rendered data comprised in the sending record comprises:
when the sending record does not comprise the identifier of the first to-be-rendered data, determining, based on an identifier of second to-be-rendered data comprised in the sending record, differential data between the first to-be-rendered data and the second to-be-rendered data, and comprising the identifier of the second to-be-rendered data and the differential data in the indication information.
4 . The method according to claim 3 , further comprising:
after sending the second information to the second computing device, updating the sending record to comprise the identifier of the first to-be-rendered data.
5 . The method according to claim 1 , wherein determining the indication information by comparing the identifier of the first to-be-rendered data with the one or more identifiers of to-be-rendered data comprised in the sending record comprises:
when the sending record does not comprise the identifier of the first to-be-rendered data, compressing the first to-be-rendered data to obtain the compressed data, and comprising the compressed data in the indication information.
6 . The method according to claim 1 , wherein the first to-be-rendered data comprises texture data.
7 . The method according to claim 1 , wherein the first to-be-rendered data comprises vertex data.
8 . The method according to claim 1 , wherein the first to-be-rendered data comprises texture data and vertex data.
9 . A method, performed by a second computing device, and the method comprising:
receiving second information sent by a first computing device, wherein the second information indicates to the second computing device to display a first image, the second information comprises a drawing instruction and indication information, the indication information comprises a first indication or a second indication, the first indication identifies first to-be-rendered data previously sent by the first computing device to the second computing device, and the second indication identifies compressed data that is of the first to-be-rendered data and that is currently sent by the first computing device to the second computing device;
obtaining the first to-be-rendered data based on the indication information;
rendering the first to-be-rendered data based on the drawing instruction to obtain the first image; and
displaying the first image;
wherein when the indication information comprises the identifier of the first to-be-rendered data, obtaining the first to-be-rendered data based on the indication information comprises:
obtaining the first to-be-rendered data based on the identifier of the first to-be-rendered data and a receiving record, wherein the receiving record indicates to-be-rendered data that has been previously received by the second computing device and that has been previously sent by the first computing device; and
wherein when the indication information comprises an identifier of second to-be-rendered data and differential data of the second to-be-rendered data, obtaining the first to-be-rendered data based on the indication information comprises:
obtaining the second to-be-rendered data based on the identifier of the second to-be-rendered data and the receiving record; and
obtaining the first to-be-rendered data based on same data in the second to-be-rendered data and the first to-be-rendered data and the differential data, wherein the first to-be-rendered data comprises the differential data and the same data.
10 . The method according to claim 9 , wherein when the indication information comprises the compressed data, obtaining the first to-be-rendered data based on the indication information comprises:
decompressing the compressed data to obtain the first to-be-rendered data.
11 . The method according to claim 9 , wherein the first to-be-rendered data comprises vertex data.
12 . The method according to claim 9 , wherein the first to-be-rendered data comprises texture data and vertex data.
13 . An apparatus, comprising:
at least one processor; and
a memory coupled to the at least one processor and storing programming instructions for execution by the at least one processor to cause the apparatus to:
obtain first information, wherein the first information indicates to a second computing device to display a first image, the first information comprises a drawing instruction, and the drawing instruction is used to render first to-be-rendered data to obtain the first image;
determine indication information of the first to-be-rendered data based on whether the first to-be-rendered data was previously sent by the apparatus to the second computing device, wherein the indication information comprises a first indication or a second indication, the first indication identifies the first to-be-rendered data previously sent to the second computing device, and the second indication identifies compressed data that is of the first to-be-rendered data and that is currently sent to the second computing device, wherein a sending record indicates to-be-rendered data that has been sent by the first computing device to the second computing device, and wherein determining the indication information of the first to-be-rendered data comprises:
obtaining an identifier of the first to-be-rendered data; and
determining the indication information by comparing the identifier of the first to-be-rendered data with one or more identifiers of to-be-rendered data comprised in the sending record; and
send second information to the second computing device, wherein the second information comprises the drawing instruction and the indication information.
14 . The apparatus according to claim 13 , wherein execution of the programming instructions by the at least one processor causes the apparatus to:
when the sending record comprises the identifier of the first to-be-rendered data, comprise the identifier of the first to-be-rendered data in the indication information.
15 . The apparatus according to claim 13 , wherein execution of the programming instructions by the at least one processor causes the apparatus to:
when the sending record does not comprise the identifier of the first to-be-rendered data, determine, based on an identifier of second to-be-rendered data comprised in the sending record, differential data between the first to-be-rendered data and the second to-be-rendered data, and comprise the identifier of the second to-be-rendered data and the differential data in the indication information.
16 . The apparatus according to claim 15 , wherein execution of the programming instructions by the at least one processor further causes the apparatus to:
update the sending record to comprise the identifier of the first to-be-rendered data.
17 . The apparatus according to claim 13 , wherein execution of the programming instructions by the at least one processor causes the data processing apparatus to:
when the sending record does not comprise the identifier of the first to-be-rendered data, compress the first to-be-rendered data to obtain the compressed data, and comprise the compressed data in the indication information.
18 . The apparatus according to claim 13 , wherein the first to-be-rendered data comprises texture data.
19 . The apparatus according to claim 13 , wherein the first to-be-rendered data comprises vertex data.