A chip, data packaging method and storage medium

By implementing hardware segmentation and packet assembly in the VNC server chip, the problem of excessive CPU load was solved, improving the smoothness of remote access and system performance.

CN119052184BActive Publication Date: 2025-10-28NEW H3C SEMICON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411084186.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2025-10-28
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

The existing VNC server experiences excessive CPU load during image data processing, resulting in significant delays in data packet transmission and impacting the smoothness of remote access.

Method used

The chip's data reading module reads data blocks of the image to be transmitted from the off-chip cache and writes them into RAM. The packet data write-back module then assembles these data blocks into RFB packets from RAM. Hardware segmentation and packet assembly reduce CPU load.

Benefits of technology

It reduces data packet transmission latency, improves the smoothness of remote access, reduces CPU processing resource consumption, and improves overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052184B_ABST
    Figure CN119052184B_ABST
Patent Text Reader

Abstract

The present application provides a chip, a data packaging method, and a storage medium, relating to the field of data processing technology. The chip is located at the controlled end of remote access, and the chip includes: a data reading module, RAM, and a packaging data write-back module; the data reading module and the packaging data write-back module are both connected to the RAM, and the data reading module and the packaging data write-back module are both connected to the chip's off-chip cache, which stores a picture to be transmitted from the controlled end to the remote access control end; the data reading module is used to read each data block included in the picture to be transmitted from the off-chip cache in sequence based on the basic information of the picture to be transmitted, the picture parameters, and the data block size of a single data block, and write the read data blocks to the RAM; the packaging data write-back module is used to read data blocks from the RAM, combine multiple data blocks into an RFB packet, and write the RFB packet back to the off-chip cache. This can improve the fluency of remote access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a chip, a data packetization method, and a storage medium. Background Technology

[0002] Virtual Network Console (VNC) is a graphical remote desktop control technology based on the Remote Frame Buffer (RFB) protocol. Users can connect to a VNC server through a VNC client to remotely access and control other computers. The VNC server can compress the image data of the controlled computer and assemble it into a data packet format conforming to the RFB protocol, thereby transmitting the data packet to the controlling computer.

[0003] With the increasing demand for remote work and collaboration, the need for an efficient remote desktop experience is also growing. However, current VNC servers typically segment image data at the software level and package it into data packets conforming to the RFB protocol. This method consumes CPU processing resources and time, leading to excessive CPU load and potentially causing significant delays in data packet transmission, thus affecting the smoothness of remote access. Summary of the Invention

[0004] The purpose of this application is to provide a chip, a data packet assembly method, and a storage medium to improve the smoothness of remote access. The specific technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a chip located at a remotely accessed controlled end. The chip includes: a data reading module, RAM, and a packet data write-back module. Both the data reading module and the packet data write-back module are connected to the RAM, and both are connected to an off-chip cache of the chip. The off-chip cache stores images to be transmitted from the controlled end to the remotely accessed control end.

[0006] The data reading module is used to read each data block of the image to be transmitted sequentially from the off-chip cache based on the basic information, image parameters and data block size of the image to be transmitted, and write the read data block into the RAM.

[0007] The packet data write-back module is used to read data blocks from the RAM, combine multiple data blocks into an RFB packet, and write the RFB packet back to the off-chip cache.

[0008] In one possible implementation, the chip further includes a configuration register, a descriptor reading and parsing module, and a parameter reading and parsing module connected in sequence. The descriptor reading and parsing module and the parameter reading and parsing module are both connected to the off-chip cache, and the parameter reading and parsing module is connected to the data reading module.

[0009] The configuration register is used to store the descriptor's header pointer, the data block size, and basic information about the image to be transmitted;

[0010] The descriptor reading and parsing module is used to read descriptors from the off-chip cache based on the header pointer, wherein the descriptor includes the address and length of the image parameters;

[0011] The parameter reading and parsing module is used to read the image parameters from the off-chip cache based on the address and length of the image parameters.

[0012] In one possible implementation, the image parameters include an encoding method, which indicates whether to compress the data block and a preset type of compression algorithm; the chip also includes a compression module, which is connected to the RAM and the parameter reading and parsing module respectively.

[0013] The compression module is used to obtain the encoding method. If the encoding method indicates that the data block is to be compressed, the data block is read from the RAM and the read data block is compressed using the preset type of compression algorithm, and the compressed data block is stored in the RAM.

[0014] The packet data write-back module is specifically used to read compressed data blocks from the RAM and combine multiple compressed data blocks into an RFB packet.

[0015] In one possible implementation, the basic information of the image to be transmitted includes the image format and storage mode, and the image parameters include the size and coordinate position of the image to be transmitted.

[0016] The data reading module is specifically used to calculate the storage address of each data block included in the image to be transmitted based on the image format, storage mode, size, coordinate position and data block size of the image to be transmitted; based on the storage address of each data block, read each data block from the off-chip cache in sequence and write the read data block into the RAM.

[0017] In one possible implementation, the descriptor also includes a data volume threshold for a single RFB packet and a preset number of RFB packets;

[0018] The packet data write-back module is specifically used to sequentially combine data blocks in the RAM into RFB packets until the number of RFB packets reaches the preset number or all data blocks included in the image to be transmitted are packaged. Then, packet assembly is stopped, and the obtained RFB packets are used as the RFB packets of the image to be transmitted. The total data volume of each RFB packet does not exceed the data volume threshold.

[0019] In one possible implementation, the packet assembly data write-back module is specifically used to, when a new data block exists in the RAM, accumulate the data volume of the new data block with the current data volume of the RFB packet to be assembled, to obtain an accumulated data volume; if the accumulated data volume exceeds the data volume threshold, then the RFB packet to be assembled is treated as a complete RFB packet, the current data volume is taken as the total data volume of the complete RFB packet, and the number of completed RFB packets is incremented by 1; if the accumulated data volume does not exceed the data volume threshold, then the new data block is treated as a data block in the RFB packet to be assembled, and the current data volume of the RFB packet to be assembled is updated to the accumulated data volume; the new data block is read from the RAM, and if the number of completed RFB packets reaches the preset number, then packet assembly is stopped; if the number of completed RFB packets does not reach the preset number, then the packet header of the new data block and the new data block are written back to the off-chip buffer, and if the new data block is the last data block of the image to be transmitted, then packet assembly is stopped.

[0020] In one possible implementation, the packet data write-back module is specifically used to update the value of the number of data blocks field in the header of the first data block of the complete RFB packet to the number of data blocks included in the complete RFB packet after the RFB packet to be grouped is a complete RFB packet, and to record the total amount of data of the complete RFB packet in the descriptor;

[0021] The packet data write-back module is specifically used to update the value of the number of data blocks in the header of the first data block of the specified RFB packet to the number of data blocks included in the specified RFB packet if the newly added data block is the last data block of the image to be transmitted, and to record the total amount of data of the specified RFB packet in the descriptor, wherein the specified RFB packet is the RFB packet to which the newly added data block belongs.

[0022] In one possible implementation, the packet data write-back module is specifically used to write back a packet header of a first preset length and the newly added data block to the off-chip cache if the newly added data block is the first data block in the RFB packet; and to write back a packet header of a second preset length and the newly added data block to the off-chip cache if the newly added data block is not the first data block in the RFB packet, wherein the first preset length is greater than the second preset length.

[0023] In one possible implementation, the chip further includes a status register;

[0024] The packet data write-back module is further configured to update the completion flag in the descriptor and update the tail pointer of the descriptor stored in the status register after stopping packet assembly. The completion flag is used to indicate that the packet assembly of the image to be transmitted has been completed.

[0025] Secondly, embodiments of this application provide a data packet assembly method applied to a chip in a remotely accessed controlled terminal. The chip is connected to an off-chip cache, which stores images to be transmitted from the controlled terminal to the remotely accessed control terminal. The method includes:

[0026] Based on the basic information, image parameters and data block size of the image to be transmitted, each data block of the image to be transmitted is read sequentially from the off-chip cache, and the read data blocks are written into RAM.

[0027] Read data blocks from the RAM and combine multiple data blocks into an RFB packet;

[0028] The RFB packet is written back to the off-chip cache.

[0029] In one possible implementation, before sequentially reading each data block of the image to be transmitted from the off-chip cache based on the image information of the image to be transmitted and the data block size of a single data block, and writing the read data blocks into the random access memory (RAM), the method further includes:

[0030] Obtain the descriptor's header pointer, the data block size, and basic information about the image to be transmitted;

[0031] The descriptor is read from the off-chip cache based on the head pointer, and the descriptor includes the address and length of the image parameters;

[0032] The image parameters are read from the off-chip cache based on the address and length of the image parameters.

[0033] In one possible implementation, the image parameters include an encoding method, which indicates whether to compress data blocks and a preset type of compression algorithm;

[0034] After writing the read data block into the random access memory (RAM), the method further includes:

[0035] If the encoding method indicates that the data block is to be compressed, then the data block is read from the RAM, and the read data block is compressed using the preset type of compression algorithm, and the compressed data block is stored in the RAM;

[0036] The step of reading data blocks from the RAM and combining multiple data blocks into a single remote frame buffer (RFB) packet includes:

[0037] Compressed data blocks are read from the RAM, and multiple compressed data blocks are combined into an RFB packet.

[0038] In one possible implementation, the basic information of the image to be transmitted includes the image format and storage mode, and the image parameters include the size and coordinate position of the image to be transmitted.

[0039] The step of sequentially reading each data block of the image to be transmitted from the off-chip cache based on the basic information, image parameters, and data block size of the image to be transmitted, and writing the read data blocks into the random access memory (RAM) includes:

[0040] Based on the image format, storage mode, size, coordinate position, and data block size of the image to be transmitted, the storage address of each data block included in the image to be transmitted is calculated sequentially.

[0041] Based on the storage address of each data block, each data block is read sequentially from the off-chip cache and written into the RAM.

[0042] In one possible implementation, the descriptor also includes a data volume threshold for a single RFB packet and a preset number of RFB packets;

[0043] Reading data blocks from the RAM and combining multiple data blocks into a single remote frame buffer (RFB) packet includes:

[0044] The data blocks in the RAM are sequentially combined into RFB packets until the number of RFB packets reaches the preset number or all the data blocks included in the image to be transmitted are packaged, at which point the packetization stops; wherein the total data volume of a single RFB packet does not exceed the data volume threshold.

[0045] Use the obtained RFB packets as the RFB packets for the image to be transmitted.

[0046] In one possible implementation, the step of sequentially combining data blocks in the RAM into RFB packets until the number of RFB packets reaches the preset number or all data blocks included in the image to be transmitted are packaged, and then stopping the packet assembly, includes:

[0047] When a new data block is added to the RAM, the data volume of the new data block is added to the current data volume of the RFB packet to be assembled, and the accumulated data volume is obtained.

[0048] If the accumulated data volume exceeds the data volume threshold, the RFB packet to be grouped is treated as a complete RFB packet, the current data volume is taken as the total data volume of the complete RFB packet, and the number of RFB packets that have been encapsulated is incremented by 1; if the accumulated data volume does not exceed the data volume threshold, the newly added data block is taken as a data block in the RFB packet to be grouped, and the current data volume of the RFB packet to be grouped is updated to the accumulated data volume.

[0049] Read the newly added data block from the RAM;

[0050] If the number of completed RFB packets reaches the preset number, packet assembly will stop.

[0051] If the number of completed RFB packets does not reach the preset number, the header of the newly added data block and the newly added data block are written back to the off-chip buffer. If the newly added data block is the last data block of the image to be transmitted, packet assembly is stopped.

[0052] In one possible implementation, after treating the RFB packet to be grouped as a complete RFB packet, the method further includes:

[0053] Update the value of the number of data blocks field in the header of the first data block of the complete RFB packet to the number of data blocks included in the complete RFB packet;

[0054] The total data volume of the complete RFB packet is recorded in the descriptor;

[0055] After writing back the header of the newly added data block and the newly added data block to the off-chip cache, the method further includes:

[0056] If the newly added data block is the last data block of the image to be transmitted, then the value of the data block count field in the header of the first data block of the specified RFB packet is updated to the number of data blocks included in the specified RFB packet, where the specified RFB packet is the RFB packet to which the newly added data block belongs;

[0057] The total data volume of the specified RFB packet is recorded in the descriptor.

[0058] In one possible implementation, writing back the packet header of the newly added data block and the newly added data block to the off-chip cache includes:

[0059] If the newly added data block is the first data block in the RFB packet, then the packet header of the first preset length and the newly added data block are written back to the off-chip cache;

[0060] If the newly added data block is not the first data block in the RFB packet, then the packet header of the second preset length and the newly added data block are written back to the off-chip cache, where the first preset length is greater than the second preset length.

[0061] In one possible implementation, after the packet assembly is stopped, the method further includes:

[0062] Update the completion flag in the descriptor, the completion flag being used to indicate that the packetization of the image to be transmitted has been completed;

[0063] Update the tail pointer of the descriptor.

[0064] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the second aspect above.

[0065] Fourthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the second aspect above.

[0066] Using the above technical solution, the data reading module in the chip of the remotely accessed controlled terminal can read the data blocks of the image to be transmitted from the off-chip buffer and write the read data blocks into RAM, thereby realizing the segmentation of the image to be transmitted. Then, the packet assembly and data write-back module reads the data blocks from RAM, combines multiple data blocks into an RFB packet, and writes the RFB packet back to the off-chip buffer. In the above process, the segmentation of the image to be transmitted and the assembly of data blocks are both performed by the chip. Compared with segmentation and assembly by the CPU, the embodiments of this application utilize hardware for segmentation and assembly, which reduces the CPU load, improves the efficiency of segmentation and assembly, reduces the data packet transmission latency, and improves the smoothness of remote access from the control terminal to the controlled terminal.

[0067] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0069] Figure 1 A schematic diagram of a remote desktop system provided in an embodiment of this application;

[0070] Figure 2 This is a schematic diagram of the structure of a chip provided in an embodiment of this application;

[0071] Figure 3 This is a schematic diagram of another chip structure provided in an embodiment of this application;

[0072] Figure 4 A flowchart illustrating a data packet assembly method provided in this application embodiment;

[0073] Figure 5 A flowchart of another data packetization method provided in an embodiment of this application. Detailed Implementation

[0074] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0075] First, the application scenario of this application embodiment is introduced. This application embodiment is applied to a remote desktop system, such as... Figure 1 As shown, the system includes a control terminal 101 and a controlled terminal 102. Both the control terminal 101 and the controlled terminal 102 are electronic devices that support VNC technology, such as laptops, tablets, or desktop computers.

[0076] The control terminal 101 contains a VNC client program, while the controlled terminal 102 contains a VNC server program and a VNC packet assembly program. The VNC packet assembly program on the controlled terminal 102 runs on a chip connected to an off-chip cache. After the VNC server program on the controlled terminal 102 calls the VNC packet assembly program, the VNC packet assembly program can retrieve the desktop display image of the controlled terminal 102 from the off-chip cache, segment and assemble the image, and then transmit the data packet carrying the image data to the VNC client program on the control terminal 101. This allows the control terminal 101 to display the desktop display image of the controlled terminal 102 and remotely control the controlled terminal 102.

[0077] This application embodiment adds a chip to the remotely accessed controlled terminal, thereby enabling image segmentation of the image to be transmitted and packetization of image data. For example... Figure 2 As shown, the chip 20 includes a data reading module 201, a random access memory (RAM) 202, and a packet data write-back module 203. Both the data reading module 201 and the packet data write-back module 203 are connected to the RAM 202, and both are connected to the chip's off-chip cache 21. The off-chip cache 21 stores images to be transmitted from the controlled terminal to the remotely accessed control terminal. These images specifically need to be transmitted to the VNC client program on the control terminal.

[0078] The data reading module 201 is used to read each data block of the image to be transmitted sequentially from the off-chip cache 21 based on the basic information of the image to be transmitted, the image parameters, and the data block size of a single data block, and write the read data blocks into RAM 202.

[0079] The packet data write-back module 203 is used to read data blocks from RAM 202, combine multiple data blocks into an RFB packet, and write the RFB packet back to the off-chip cache 21.

[0080] The image to be transmitted is all or part of the image displayed on the desktop of the controlled terminal. Reading the data of the image to be transmitted according to the size of the data block is equivalent to dividing the image to be transmitted into multiple data blocks of the same size.

[0081] In this embodiment, the data reading module in the chip of the remotely accessed controlled terminal reads data blocks of the image to be transmitted from the off-chip cache and writes the read data blocks into RAM, thereby segmenting the image to be transmitted. Then, the packet assembly and data write-back module reads data blocks from RAM, combines multiple data blocks into an RFB packet, and writes the RFB packet back to the off-chip cache. In the above process, the segmentation of the image to be transmitted and the assembly of data blocks are both performed by the chip. Compared with segmentation and assembly by the CPU, this embodiment utilizes hardware for segmentation and assembly, reducing the CPU load, improving the efficiency of segmentation and assembly, reducing data packet transmission latency, and improving the smoothness of remote access from the control terminal to the controlled terminal.

[0082] In some embodiments of the present application, Figure 3 As shown, the chip 20 also includes a configuration register 204, a descriptor reading and parsing module 205, and a parameter reading and parsing module 206 connected in sequence. The descriptor reading and parsing module 205 and the parameter reading and parsing module 206 are both connected to the off-chip cache 21, and the parameter reading and parsing module 206 is connected to the data reading module 201.

[0083] Configuration register 204 is used to store the descriptor's header pointer, data block size, and basic information about the image to be transmitted.

[0084] The VNC server program on the control end can configure the header pointer, data block size, and basic information of the image to be transmitted for the descriptor in configuration register 204. Optionally, the user can also configure the header pointer, data block size, and basic information of the image to be transmitted in configuration register 204 via a PC or a general interface.

[0085] The descriptor has been pre-stored in the off-chip cache 21.

[0086] The descriptor reading and parsing module 205 is used to read descriptors from the off-chip cache 21 based on the head pointer. The descriptor includes the address and length of the image parameters.

[0087] The image parameters have been pre-stored in the off-chip cache 21.

[0088] The parameter reading and parsing module 206 is used to read image parameters from the off-chip cache 21 based on the address and length of the image parameters.

[0089] This address is the starting address of the image parameters. The parameter reading and parsing module 206 can start from this address and read the parameters according to this length to obtain the image parameters.

[0090] In this embodiment, the configuration register is configured with the descriptor's header pointer, data block size, and basic information about the image to be transmitted. The descriptor reading and parsing module in the chip can then read the descriptor based on the header pointer to obtain the address and length of the image parameters. The parameter reading and parsing module further reads the image parameters from the off-chip cache based on these addresses and lengths. This process is entirely implemented by the hardware chip without CPU intervention, reducing the CPU load and improving overall system performance.

[0091] In some embodiments of this application, the image parameters include an encoding method, which is used to indicate whether the data block is compressed and the preset type of the compression algorithm; the chip 20 also includes a compression module 207, which is connected to the RAM 202 and the parameter reading and parsing module 206 respectively;

[0092] The compression module 207 is used to obtain the encoding method. If the encoding method indicates that the data block is to be compressed, the data block is read from RAM 202 and compressed using a preset type of compression algorithm, and the compressed data block is stored in RAM 202.

[0093] The packet data write-back module 203 is specifically used to read compressed data blocks from RAM 202 and combine multiple compressed data blocks into an RFB packet.

[0094] By using the embodiments of this application, there is no need for the CPU to compress data blocks, which can further reduce the CPU load, allowing CPU resources to be used for other important tasks, improving the overall system performance. In addition, the compression efficiency of hardware compression is higher, which can reduce packet assembly latency and improve the smoothness of remote access.

[0095] In some embodiments of this application, the basic information of the image to be transmitted includes the image format and storage mode, and the image parameters include the size and coordinate position of the image to be transmitted.

[0096] The image format of the image to be transmitted includes the resolution of the desktop image to which the image belongs and the storage space required for each pixel. For example, the resolution is 1920x1080 and each pixel occupies 32 bits.

[0097] The dimensions of the image to be transferred can be its width and height. For example, a width of 1920 pixels and a height of 1080 pixels means the entire desktop image will be transferred. Another example is a width of 300 pixels and a height of 200 pixels, in which case a portion of the desktop image will be transferred, such as when sharing a window displayed on the desktop. The coordinates of the image to be transferred can be its starting coordinates, such as the pixel coordinates of its top-left corner.

[0098] The data reading module 201, connected to the configuration register 204, is specifically used to calculate the storage address of each data block included in the image to be transmitted based on the image format, storage mode, size, coordinate position, and data block size of the image to be transmitted; based on the storage address of each data block, it reads each data block from the off-chip cache in sequence and writes the read data block into RAM 202.

[0099] The size of a single data block includes row (column) and row (column) information. For example, the size of a single data block can be 4x4, meaning that both the column and row are 4.

[0100] In this embodiment of the application, based on the size and coordinate position of the image to be transmitted and the size of a single data block, the coordinates of each pixel in a single data block can be determined, and then the storage address corresponding to the coordinates of each pixel can be calculated. The storage address of each pixel obtained is the storage address of the data block to be read.

[0101] For example, the image to be transmitted is 200x100 pixels with coordinates (6,8). This means the image includes pixels within the 200x100 pixel area starting at coordinates (6,8) of a 1920x1080 desktop image. Assuming a single data block is 4x4, the first data block has X-coordinates of 6 to 9 and y-coordinates of 8 to 11, meaning it contains 16 pixels. The first pixel has coordinates (6,8), and the last pixel has coordinates (9,11), all within the range of pixels in the image to be transmitted. The storage address of these 16 pixels in the off-chip cache can then be obtained based on their coordinates. This storage address is the storage address of the first data block.

[0102] The storage mode can be either liner mode or tile mode.

[0103] Taking a resolution of 1920x1080 and a pixel of 32 bits as an example, if the image storage format is liner mode, then the address of the pixel with coordinates (x,y) is base (initial storage address) + 1920*4*y + x*4;

[0104] If the storage mode is tile mode, then the address of the pixel with coordinates (x, y) is base (initial storage address).

[0105] +y[msb:2]*1920*4*4+x[msb:2]*16*4+y[1:0]*4*4+x[1:0]*4.

[0106] Where [msb:2] represents the quotient obtained by dividing by 4 (ignoring the remainder), for example, y[msb:2] represents the quotient obtained by dividing y by 4.

[0107] Through this embodiment, the data reading module in the chip can calculate the storage address of each pixel in each data block, and then read the data block based on the storage address. This is equivalent to dividing the image to be transmitted into multiple data blocks, realizing image segmentation using hardware, which can improve segmentation efficiency.

[0108] In some embodiments of this application, the descriptor also includes a data size threshold for a single RFB packet and a preset number of RFB packets;

[0109] The packet data write-back module 203 is specifically used to sequentially combine data blocks in RAM 202 into RFB packets until the number of RFB packets reaches a preset number or all data blocks included in the image to be transmitted are packaged. Then, the packet assembly stops, and the obtained RFB packets are used as RFB packets for the image to be transmitted. The total data volume of each RFB packet does not exceed the data volume threshold.

[0110] The data length threshold is preset based on the requirements of the RFB protocol.

[0111] In this embodiment of the application, RFB packets are assembled in accordance with the requirements of the RFB protocol, which enables seamless integration with the RFB protocol, making the process of remote access and control smoother and more natural.

[0112] In this embodiment, the packet assembly data write-back module 203 is specifically used to, when there is a newly added data block in RAM 202, accumulate the data volume of the newly added data block with the current data volume of the RFB packet to be assembled, and obtain the accumulated data volume; if the accumulated data volume exceeds the data volume threshold, the RFB packet to be assembled is treated as a complete RFB packet, the current data volume is taken as the total data volume of the complete RFB packet, and the number of RFB packets that have been encapsulated is incremented by 1; if the accumulated data volume does not exceed the data volume threshold, the newly added data block is treated as a data block in the RFB packet to be assembled, and the current data volume of the RFB packet to be assembled is updated to the accumulated data volume; then, the newly added data block is read from RAM, and if the number of RFB packets that have been encapsulated reaches a preset number, packet assembly is stopped; if the number of RFB packets that have been encapsulated does not reach the preset number, the packet header of the newly added data block and the newly added data block are written back to the off-chip buffer, and if the newly added data block is the last data block of the image to be transmitted, packet assembly is stopped.

[0113] In this case, assuming the newly added data block is data block M, after adding the data volume of data block M to the current data volume of the RFB packet to be assembled, if the added data volume exceeds the data volume threshold, it means that data block M should not be added to the RFB packet to be assembled. That is, the RFB packet to be assembled is not large enough to accommodate another data block. Therefore, data block M is not added to the RFB packet to be assembled. Instead, the RFB packet to be assembled is treated as a complete RFB packet, thus completing the assembly of the RFB packet to be assembled.

[0114] Conversely, if the accumulated data volume does not exceed the data volume threshold, then data block M can be used as a data block of the RFB packet to be formed.

[0115] After determining whether the newly added data block can be used as a data block in the RFB packet to be assembled, the newly added data block needs to be read from RAM 202. If the number of RFB packets that have been packaged has reached the preset number, it means that there is no need to continue assembling the packets, so there is no need to write the newly added data block back to the off-chip cache 21. If the amount of data in the RFB packets that have been packaged has not reached the preset number, it means that there is still a need to continue assembling the packets, so the packet header and the newly added data block can be written back to the off-chip cache 21, which is equivalent to adding the newly added data block to the RFB packet to be assembled.

[0116] After writing the header and the new data block back to the off-chip buffer 21, it is necessary to determine whether the new data block is the last data block of the image to be transmitted. If so, it means that the packetization of all data blocks included in the image to be transmitted has been completed, so the packetization can be stopped. If not, the packetization data write-back module 203 can trigger the data reading module 201 to continue calculating the storage address of the next data block included in the image to be transmitted, and read the next data block, and write the next data block into RAM so that the packetization data write-back module 203 can continue to assemble the next data block.

[0117] Using this method, the packet data write-back module can add new data blocks to the appropriate RFB packets to be assembled, ensuring that the total data volume of a single RFB packet does not exceed the data volume threshold, and that the number of completed RFB packets does not exceed the preset number. It can be well integrated with the RFB protocol stack, and when processing complex images and high-resolution images to be transmitted, it can also quickly process large amounts of image data in hardware, reduce the packet assembly and transmission latency of RFB packets, improve the real-time performance and response speed of remote access, and provide a faster remote desktop experience.

[0118] In some embodiments of this application, the packet data write-back module 203 is specifically used to update the value of the number of data blocks in the header of the first data block of the complete RFB packet to the number of data blocks included in the complete RFB packet after the RFB packet to be assembled is a complete RFB packet, and record the total amount of data of the complete RFB packet in the descriptor.

[0119] It is understood that each data block in a complete RFB packet has a header, and the header of the first data block contains a data block count field. The value of this data block count field indicates the number of data blocks in the complete RFB packet. In this embodiment, after obtaining a complete RFB packet, the value of the data block count field can be updated promptly, ensuring the accuracy of the value and thus improving packet assembly accuracy. This allows the control terminal to accurately obtain each data block in the complete RFB packet based on the data block count field and reconstruct the image to be transmitted, improving the performance of remote access.

[0120] The packet data write-back module 203 is specifically used to update the value of the number of data blocks in the header of the first data block of the specified RFB packet to the number of data blocks included in the specified RFB packet if the newly added data block is the last data block of the image to be transmitted, and to record the total amount of data of the specified RFB packet in the descriptor, wherein the specified RFB packet is the RFB packet to which the newly added data block belongs.

[0121] It is understandable that if the newly added data block is the last data block of the image to be transmitted, it means that the newly added data block will be the last data block in the specified RFB packet. At this time, the specified RFB packet is completed. The embodiments of this application can update the value of the data block quantity field in the specified RFB packet in a timely manner, ensuring the accuracy of the value of the data block quantity field, improving the accuracy of packet assembly, so that the control end can accurately obtain each data block in the complete RFB packet based on the data block quantity field and restore the image to be transmitted, thereby improving the performance of remote access.

[0122] In some embodiments of this application, the packet data write-back module 203 is specifically used to write back the packet header of a first preset length and the newly added data block to the off-chip cache 21 if the newly added data block is the first data block in the RFB packet; and to write back the packet header of a second preset length and the newly added data block to the off-chip cache 21 if the newly added data block is not the first data block in the RFB packet, wherein the first preset length is greater than the second preset length.

[0123] The specific values ​​of the first preset length and the second preset length follow the provisions of the RFB protocol. Since the header of the first data block carries more fields, the first preset length is greater than the second preset length.

[0124] Thus, the method of RFB packet assembly in this embodiment conforms to the RFB protocol stack, making the remote access and control process smoother and more natural.

[0125] Optionally, the chip 20 also includes a status register 208.

[0126] The packet assembly data write-back module 203 is also used to update the completion flag in the descriptor and update the tail pointer of the descriptor stored in the status register 208 after stopping packet assembly. The completion flag indicates that packet assembly of the image to be transmitted has been completed.

[0127] Then, the VNC server program can obtain the tail pointer of the descriptor from the status register 208, and obtain the descriptor from the off-chip buffer 21 based on the head pointer and tail pointer of the descriptor, obtain the RFB packet based on the descriptor, and transmit the RFB packet to the control terminal.

[0128] Corresponding to the aforementioned chip, this application embodiment also provides a data packet assembly method. This method is applied to a chip in the remotely accessed controlled terminal, where the chip is connected to an off-chip buffer. The off-chip buffer stores images to be transmitted from the controlled terminal to the remotely accessed control terminal, such as... Figure 4 As shown, the method includes:

[0129] S401. Based on the basic information of the image to be transmitted, the image parameters, and the data block size of a single data block, read each data block of the image to be transmitted sequentially from the off-chip cache and write the read data blocks into RAM.

[0130] S402: Read data blocks from RAM and combine multiple data blocks into an RFB packet.

[0131] S403. Write the RFB packet back to the off-chip cache.

[0132] Using the embodiments of this application, the chip in the remotely accessed controlled terminal can read data blocks of the image to be transmitted from the off-chip cache, write the read data blocks into RAM, thereby segmenting the image to be transmitted. Then, it reads data blocks from RAM, combines multiple data blocks into an RFB packet, and writes the RFB packet back to the off-chip cache. In the above process, the segmentation of the image to be transmitted and the assembly of data blocks are both performed by the chip. Compared with segmentation and assembly by the CPU, the embodiments of this application utilize hardware for segmentation and assembly, reducing the CPU load, improving the efficiency of segmentation and assembly, reducing data packet transmission latency, and improving the smoothness of remote access from the control terminal to the controlled terminal.

[0133] In some embodiments of this application, before S401, which reads each data block of the image to be transmitted sequentially from the off-chip cache based on the basic information of the image to be transmitted, image parameters, and the data block size of a single data block, and writes the read data block into RAM, the method further includes the following steps:

[0134] Step 1: Obtain the descriptor's header pointer, data block size, and basic information about the image to be transmitted.

[0135] Step 2: Read the descriptor from the off-chip cache based on the head pointer.

[0136] The descriptor includes the address and length of the image parameters.

[0137] Step 3: Read the image parameters from the off-chip cache based on the address and length of the image parameters.

[0138] Using the embodiments of this application, the chip can read the descriptor based on the head pointer to obtain the address and length of the image parameters, and further read the image parameters from the off-chip cache based on the address and length of the image parameters. This process is implemented entirely by the hardware chip without CPU intervention, reducing the CPU load and improving overall system performance.

[0139] In some embodiments of this application, the image parameters include encoding parameters, the encoding method being used to indicate whether the data block is compressed and the preset type of the compression algorithm;

[0140] Based on this, after writing the read data block into RAM, the method further includes:

[0141] If the encoding method indicates that the data block should be compressed, the data block is read from RAM and compressed using a preset compression algorithm, and the compressed data block is stored in RAM.

[0142] Accordingly, the above-mentioned S402, reading data blocks from RAM and combining multiple data blocks into an RFB packet, can be specifically implemented as follows:

[0143] Read compressed data blocks from RAM and combine multiple compressed data blocks into an RFB packet.

[0144] By using the embodiments of this application, there is no need for the CPU to compress data blocks, which can further reduce the CPU load, allowing CPU resources to be used for other important tasks, improving the overall system performance. In addition, the compression efficiency of hardware compression is higher, which can reduce packet assembly latency and improve the smoothness of remote access.

[0145] In some embodiments of this application, the basic information of the image to be transmitted includes the image format and storage mode, and the image parameters include the size and coordinate position of the image to be transmitted.

[0146] Based on this, the above-mentioned S401, based on the basic information of the image to be transmitted, the image parameters, and the data block size of a single data block, sequentially reads each data block of the image to be transmitted from the off-chip cache, and writes the read data blocks into RAM, which can be specifically implemented as follows:

[0147] Based on the image format, storage mode, size, coordinate position, and data block size of the image to be transmitted, the storage address of each data block included in the image to be transmitted is calculated sequentially; based on the storage address of each data block, each data block is read from the off-chip cache sequentially, and the read data blocks are written to RAM.

[0148] Optionally, for each data block, the reading and packing process can be performed serially. That is, after the chip reads a data block from the off-chip cache and writes it into RAM, it can continue to pack that data block. After packing that data block, it continues to read the next data block from the off-chip cache and pack it, and so on. This method requires less RAM cache space and saves storage resources.

[0149] Alternatively, the chip can sequentially read data blocks from the off-chip cache and store them in RAM. Simultaneously, the chip can reassemble the data blocks already stored in RAM into packets; this reassembly process does not affect the chip's ability to continue reading data blocks from the off-chip cache. This method requires relatively more RAM cache space but further improves packet assembly efficiency.

[0150] Through this embodiment, the chip can calculate the storage address of each pixel in each data block, and then read the data block based on the storage address. This is equivalent to dividing the image to be transmitted into multiple data blocks, realizing image segmentation using hardware, which can improve segmentation efficiency.

[0151] The following describes how to combine RFB packets.

[0152] In this embodiment of the application, the descriptor also includes a data volume threshold for a single RFB packet and a preset number of RFB packets.

[0153] The above-mentioned S402, reading data blocks from RAM and combining multiple data blocks into an RFB packet, can be specifically implemented as follows:

[0154] The data blocks in RAM are sequentially combined into RFB packets until the number of RFB packets reaches a preset number or all the data blocks included in the image to be transmitted are packaged. At this point, the packet assembly stops, and the obtained RFB packets are used as the RFB packets for the image to be transmitted.

[0155] The total data volume of a single RFB packet shall not exceed the data volume threshold.

[0156] Specifically, this may include the following steps:

[0157] Step A: When a new data block is added to RAM, the data volume of the new data block is added to the current data volume of the RFB packet to be assembled, and the accumulated data volume is obtained.

[0158] Step B: If the accumulated data volume exceeds the data volume threshold, the RFB packet to be grouped is treated as a complete RFB packet, the current data volume is taken as the total data volume of the complete RFB packet, and the number of RFB packets that have been packaged is incremented by 1.

[0159] Step D is performed after step B.

[0160] Optionally, after setting the current data volume as the total data volume of the complete RFB packet, the value of the number of data blocks field in the header of the first data block of the complete RFB packet can be updated to the number of data blocks included in the complete RFB packet; and the total data volume of the complete RFB packet can be recorded in the descriptor.

[0161] Step C: If the accumulated data volume does not exceed the data volume threshold, the newly added data block will be used as a data block in the RFB packet to be grouped, and the current data volume of the RFB packet to be grouped will be updated to the accumulated data volume.

[0162] Step D is performed after step C.

[0163] Step D: Read the newly added data block from RAM.

[0164] Step E: If the number of completed RFB packets reaches the preset number, stop packet assembly;

[0165] Step F: If the number of completed RFB packets does not reach the preset number, the header of the newly added data block and the newly added data block are written back to the off-chip buffer. If the newly added data block is the last data block of the image to be transmitted, packet assembly is stopped.

[0166] If the newly added data block is the first data block in the RFB packet, then the packet header of the first preset length and the newly added data block are written back to the off-chip cache.

[0167] If the newly added data block is not the first data block in the RFB packet, then the packet header of the second preset length and the newly added data block are written back to the off-chip cache, and the first preset length is greater than the second preset length.

[0168] Optionally, after writing back the header of the newly added data block and the newly added data block to the off-chip cache, if the newly added data block is the last data block of the image to be transmitted, then update the value of the data block count field in the header of the first data block of the specified RFB packet to the number of data blocks included in the specified RFB packet, specify the RFB packet as the RFB packet to which the newly added data block belongs; and record the total data volume of the specified RFB packet in the descriptor.

[0169] In this embodiment of the application, RFB packets are assembled in accordance with the requirements of the RFB protocol, which enables seamless integration with the RFB protocol, making the process of remote access and control smoother and more natural.

[0170] After stopping packet assembly, the method further includes: updating the completion flag in the descriptor, which indicates that packet assembly of the images to be transmitted has been completed; and updating the tail pointer of the descriptor.

[0171] Then, the VNC server program can obtain the tail pointer of the descriptor from the status register 208, and obtain the descriptor from the off-chip buffer 21 based on the head pointer and tail pointer of the descriptor, obtain the RFB packet based on the descriptor, and transmit the RFB packet to the control terminal.

[0172] The following describes the data packet assembly method provided in this application embodiment with specific process details. This method is applied to chips, such as... Figure 5 As shown, the method includes:

[0173] S501, Obtain the updated header pointer, data block size, and image format and storage mode of the image to be transmitted.

[0174] Here, the head pointer is the head pointer of the descriptor.

[0175] S502, Read descriptors based on head pointer.

[0176] S503, Parse descriptors.

[0177] By parsing the descriptor, one can obtain the address, length, preset number of RFB packets, data length of a single RFB packet, and initial storage address of the image to be transmitted, which are included in the descriptor.

[0178] S504. Read the image parameters based on the address and length of the image parameters.

[0179] The chip can use this address as the starting address to read data of this length from the off-chip cache, thus obtaining the image parameters.

[0180] S505, Parse image parameters.

[0181] By parsing the image parameters, the size, coordinates, and encoding method of the image to be transmitted can be obtained.

[0182] The dimensions of the image to be transmitted can be its width and height, and its coordinate position can be the starting coordinates (x, y) of the image to be transmitted. The encoding method indicates whether the data block is compressed and the compression algorithm used when compressing the data block.

[0183] The image to be transmitted refers to the image that needs to be transmitted to the control terminal in this image transmission task. The image to be transmitted can be all or part of the image currently displayed on the controlled terminal's desktop. For example, if the currently displayed image is 1920x1080, the image to be transmitted could be a 200x100 image within that image. The coordinates of the image to be transmitted are its position within the currently displayed image on the desktop. For example, it could be the coordinates of the top-left corner of the image. As an example, if the top-left corner of the currently displayed image is (0,0), the coordinates of the image to be transmitted could be (6,8).

[0184] S506. Calculate the storage address of the data block to be read based on the image format, storage mode, size, coordinate position, and data block size of the image to be transmitted.

[0185] The image format of the image to be transmitted includes the resolution of the desktop image to which the image belongs and the storage space required for each pixel. For example, the resolution is 1920x1080 and each pixel occupies 32 bits.

[0186] The size of a single data block includes row (column) and row (column) information. For example, the size of a single data block can be 4x4, meaning that both the column and row are 4.

[0187] In this embodiment of the application, based on the size and coordinate position of the image to be transmitted and the size of a single data block, the coordinates of each pixel in a single data block can be determined, and then the storage address corresponding to the coordinates of each pixel can be calculated. The storage address of each pixel obtained is the storage address of the data block to be read.

[0188] For example, the image to be transmitted is 200x100 pixels with coordinates (6,8). This means the image includes pixels within the 200x100 pixel area starting at coordinates (6,8) of a 1920x1080 desktop image. Assuming a single data block is 4x4, the first data block has X-coordinates of 6 to 9 and y-coordinates of 8 to 11, meaning it contains 16 pixels. The first pixel has coordinates (6,8), and the last pixel has coordinates (9,11), all within the range of pixels in the image to be transmitted. The storage address of these 16 pixels in the off-chip cache can then be obtained based on their coordinates. This storage address is the storage address of the first data block.

[0189] The storage mode can be either liner mode or tile mode.

[0190] Taking a resolution of 1920x1080 and a pixel of 32 bits as an example, if the image storage format is liner mode, then the address of the pixel with coordinates (x,y) is base (initial storage address) + 1920*4*y + x*4;

[0191] If the storage mode is tile mode, then the address of the pixel with coordinates (x, y) is base (initial storage address).

[0192] +y[msb:2]*1920*4*4+x[msb:2]*16*4+y[1:0]*4*4+x[1:0]*4.

[0193] Where [msb:2] represents the quotient obtained by dividing by 4 (ignoring the remainder), for example, y[msb:2] represents the quotient obtained by dividing y by 4.

[0194] S507: Read data block M from off-chip cache based on the storage address of the data block to be read.

[0195] The minimum value of M is 1, and the maximum value is the number of data blocks included in the image to be transmitted.

[0196] S508. Store data block M into RAM.

[0197] S509. Determine whether to compress the data block based on the encoding method.

[0198] If yes, then execute S510-S511; otherwise, execute S512.

[0199] S510: Read data block M from RAM and compress data block M.

[0200] S511. Store the compressed data block M into RAM.

[0201] After S511, continue executing S512.

[0202] S512, The total data volume of M data blocks is K = K' + K.

[0203] K' represents the total data size of the first M-1 data blocks, and K” represents the data size of the Mth data block.

[0204] It should be noted that if none of the M data blocks are compressed, the total data size K of the M data blocks refers to the total data size of the M data blocks themselves; if the M data blocks have been compressed, the total data size of the M data blocks refers to the total data size of the M data blocks after compression.

[0205] S513. Determine whether the total data volume K exceeds the data length threshold of a single RFB packet.

[0206] If yes, then execute S514-S516; otherwise, execute S517.

[0207] S514. Modify the number of data blocks in the header of the first data block of the RFB packet.

[0208] For example, if the total data volume of data blocks 1 to M exceeds the data length threshold of a single RFB packet, it means that data blocks 1 to M-1 can form a complete RFB packet. In this case, the value of the number-of-rectangles field in the header of data block 1 in the RFB packet is modified to M-1.

[0209] S515. Complete the encapsulation of an RFB packet and update the data length of the RFB packet in the descriptor to K'.

[0210] The descriptor specifies the storage location for the data length of each RFB packet. Each time an RFB data packet is encapsulated, the data length of the RFB packet is updated in the descriptor.

[0211] S516. Increment the number of completed RFB packets by 1, and set the total data size of the next RFB packet's data block as K.

[0212] In this case, it means that data blocks 1 to M-1 can form a complete RFB packet. Then, data block M becomes the first data block of the next RFB packet (RFB packet N+1). At this time, RFB packet N+1 includes data block M, and the total data size is the data size of data block M, i.e., K.

[0213] After S516, execute S518.

[0214] S517. Treat data block M as a data block in the current RFB packet, and count the total data volume of the current RFB packet as K.

[0215] Here, the current RFB packet can be referred to as RFB packet N, and the total data size of the data blocks included in RFB packet N at this time is K. Furthermore, in this case, RFB packet N has not yet been fully assembled, and the number of RFB packets that have been fully encapsulated remains unchanged.

[0216] S518, Read data block M from RAM.

[0217] If data block M has not been compressed, then the uncompressed data block M is read in this step; if data block M has been compressed, then the compressed data block M is read in this step.

[0218] S519. Determine whether the current number of RFB packets is less than the preset number.

[0219] If yes, then execute S521; otherwise, execute S520.

[0220] S520: Do not write back data block M, and confirm that the image has not been completely segmented.

[0221] In this case, if the current number of RFB packets has reached the pre-defined preset number, the segmentation of the image to be transmitted can be stopped.

[0222] After S520, execute S528.

[0223] S521. Determine whether data block M is the first data block in the RFB packet.

[0224] If yes, then execute S523; otherwise, execute S522.

[0225] S522, write back the 96-bit packet header and data block M.

[0226] After S522, execute S524.

[0227] S523, write back the 128-bit packet header and data block M.

[0228] S524. Determine whether data block M is the last data block of the image to be transmitted.

[0229] If yes, then execute S525; otherwise, return to S506.

[0230] S525. Modify the number of data blocks field in the header of the first data block of the RFB packet.

[0231] At this point, the total amount of data blocks included in the RFB packet may not have reached the data length threshold. However, since data block M is the last data block of the image to be transmitted, even if the data length threshold has not been reached, packet assembly should be stopped and the actual number of data blocks in the current RFB packet should be modified in the packet header.

[0232] S526. Complete the encapsulation of an RFB packet and update the data length of the RFB packet in the descriptor.

[0233] S527. Confirm that image segmentation is complete.

[0234] S528. Confirm that the image package is complete and update the completion flag in the descriptor.

[0235] S529, Update the tail pointer of the descriptor.

[0236] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described data packetization methods.

[0237] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data packetization methods described above.

[0238] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0239] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0240] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the method embodiments are basically similar to the chip embodiments, so the description is relatively simple; relevant parts can be referred to the description of the chip embodiments.

[0241] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A chip, characterized in that, The chip is located at the remotely accessed controlled end, and the chip includes: a data reading module, a random access memory (RAM), and a packet data write-back module; both the data reading module and the packet data write-back module are connected to the RAM, and both the data reading module and the packet data write-back module are connected to the chip's off-chip cache, which stores images to be transmitted from the controlled end to the remotely accessed control end; The data reading module is used to read each data block of the image to be transmitted sequentially from the off-chip cache based on the basic information, image parameters and data block size of the image to be transmitted, and write the read data block into the RAM. The packet data write-back module is used to read data blocks from the RAM, combine multiple data blocks into a remote frame buffer (RFB) packet, and write the RFB packet back to the off-chip cache.

2. The chip according to claim 1, characterized in that, The chip also includes a configuration register, a descriptor reading and parsing module, and a parameter reading and parsing module connected in sequence. The descriptor reading and parsing module and the parameter reading and parsing module are both connected to the off-chip cache, and the parameter reading and parsing module is connected to the data reading module. The configuration register is used to store the descriptor's header pointer, the data block size, and basic information about the image to be transmitted; The descriptor reading and parsing module is used to read descriptors from the off-chip cache based on the header pointer, wherein the descriptor includes the address and length of the image parameters; The parameter reading and parsing module is used to read the image parameters from the off-chip cache based on the address and length of the image parameters.

3. The chip according to claim 2, characterized in that, The image parameters include an encoding method, which indicates whether to compress the data block and the preset type of the compression algorithm; the chip also includes a compression module, which is connected to the RAM and the parameter reading and parsing module respectively. The compression module is used to obtain the encoding method. If the encoding method indicates that the data block is to be compressed, the data block is read from the RAM and the read data block is compressed using the preset type of compression algorithm, and the compressed data block is stored in the RAM. The packet data write-back module is specifically used to read compressed data blocks from the RAM and combine multiple compressed data blocks into an RFB packet.

4. The chip according to claim 1 or 2, characterized in that, The basic information of the image to be transmitted includes the image format and storage mode, and the image parameters include the size and coordinate position of the image to be transmitted. The data reading module is specifically used to calculate the storage address of each data block included in the image to be transmitted based on the image format, storage mode, size, coordinate position and data block size of the image to be transmitted; based on the storage address of each data block, read each data block from the off-chip cache in sequence and write the read data block into the RAM.

5. The chip according to claim 2, characterized in that, The descriptor also includes a data volume threshold for a single RFB packet and a preset number of RFB packets; The packet data write-back module is specifically used to sequentially combine data blocks in the RAM into RFB packets until the number of RFB packets reaches the preset number or all data blocks included in the image to be transmitted are packaged. Then, packet assembly is stopped, and the obtained RFB packets are used as the RFB packets of the image to be transmitted. The total data volume of each RFB packet does not exceed the data volume threshold.

6. The chip according to claim 5, characterized in that, The packet assembly data write-back module is specifically used to, when there is a newly added data block in the RAM, accumulate the data volume of the newly added data block with the current data volume of the RFB packet to be assembled, to obtain the accumulated data volume; if the accumulated data volume exceeds the data volume threshold, then the RFB packet to be assembled is treated as a complete RFB packet, the current data volume is taken as the total data volume of the complete RFB packet, and the number of completed RFB packets is incremented by 1; if the accumulated data volume does not exceed the data volume threshold, then the newly added data block is treated as a data block in the RFB packet to be assembled, and the current data volume of the RFB packet to be assembled is updated to the accumulated data volume; The newly added data block is read from the RAM. If the number of completed RFB packets reaches the preset number, packet assembly is stopped. If the number of completed RFB packets does not reach the preset number, the header of the newly added data block and the newly added data block are written back to the off-chip buffer. If the newly added data block is the last data block of the image to be transmitted, packet assembly is stopped.

7. The chip according to claim 6, characterized in that, The packet data write-back module is specifically used to update the value of the number of data blocks in the header of the first data block of the complete RFB packet to the number of data blocks included in the complete RFB packet after the RFB packet to be grouped is a complete RFB packet, and to record the total amount of data of the complete RFB packet in the descriptor; The packet data write-back module is specifically used to update the value of the number of data blocks in the header of the first data block of the specified RFB packet to the number of data blocks included in the specified RFB packet if the newly added data block is the last data block of the image to be transmitted, and to record the total data volume of the specified RFB packet in the descriptor, wherein the specified RFB packet is the RFB packet to which the newly added data block belongs.

8. The chip according to claim 6, characterized in that, The packet data write-back module is specifically used to write back a packet header of a first preset length and the newly added data block to the off-chip cache if the newly added data block is the first data block in the RFB packet; and to write back a packet header of a second preset length and the newly added data block to the off-chip cache if the newly added data block is not the first data block in the RFB packet, wherein the first preset length is greater than the second preset length.

9. The chip according to any one of claims 5-8, characterized in that, The chip also includes a status register; The packet data write-back module is further configured to update the completion flag in the descriptor and update the tail pointer of the descriptor stored in the status register after stopping packet assembly. The completion flag is used to indicate that the packet assembly of the image to be transmitted has been completed.

10. A data packet assembly method, characterized in that, A chip used in a remotely accessed controlled terminal, the chip being connected to an off-chip buffer, the off-chip buffer storing images to be transmitted from the controlled terminal to the remotely accessed control terminal, the method comprising: Based on the basic information, image parameters and data block size of the image to be transmitted, each data block of the image to be transmitted is read sequentially from the off-chip cache, and the read data blocks are written into the random access memory RAM. Read data blocks from the RAM and combine multiple data blocks into a single remote frame buffer (RFB) packet; The RFB packet is written back to the off-chip cache.

11. The method according to claim 10, characterized in that, Before sequentially reading each data block of the image to be transmitted from the off-chip cache based on the image information of the image to be transmitted and the data block size of a single data block, and writing the read data blocks into the random access memory (RAM), the method further includes: Obtain the descriptor's header pointer, the data block size, and basic information about the image to be transmitted; The descriptor is read from the off-chip cache based on the head pointer, and the descriptor includes the address and length of the image parameters; The image parameters are read from the off-chip cache based on the address and length of the image parameters.

12. The method according to claim 11, characterized in that The image parameters include an encoding method, which indicates whether to compress the data block and the preset type of the compression algorithm; After writing the read data block into the random access memory (RAM), the method further includes: If the encoding method indicates that the data block is to be compressed, then the data block is read from the RAM, and the read data block is compressed using the preset type of compression algorithm, and the compressed data block is stored in the RAM; The step of reading data blocks from the RAM and combining multiple data blocks into a single remote frame buffer (RFB) packet includes: Compressed data blocks are read from the RAM, and multiple compressed data blocks are combined into an RFB packet.

13. The method according to claim 10 or 11, characterized in that, The basic information of the image to be transmitted includes the image format and storage mode, and the image parameters include the size and coordinate position of the image to be transmitted. The step of sequentially reading each data block of the image to be transmitted from the off-chip cache based on the basic information, image parameters, and data block size of the image to be transmitted, and writing the read data blocks into the random access memory (RAM) includes: Based on the image format, storage mode, size, coordinate position, and data block size of the image to be transmitted, the storage address of each data block included in the image to be transmitted is calculated sequentially. Based on the storage address of each data block, each data block is read sequentially from the off-chip cache and written into the RAM.

14. The method according to claim 11, characterized in that, The descriptor also includes a data volume threshold for a single RFB packet and a preset number of RFB packets; Reading data blocks from the RAM and combining multiple data blocks into a single remote frame buffer (RFB) packet includes: The data blocks in the RAM are sequentially combined into RFB packets until the number of RFB packets reaches the preset number or all the data blocks included in the image to be transmitted are packaged, at which point the packetization stops; wherein the total data volume of a single RFB packet does not exceed the data volume threshold. Use the obtained RFB packets as the RFB packets for the image to be transmitted.

15. The method according to claim 14, characterized in that, The step of sequentially combining data blocks in the RAM into RFB packets until the number of RFB packets reaches the preset number or all data blocks included in the image to be transmitted are packaged, and then stopping the packet assembly, includes: When a new data block is added to the RAM, the data volume of the new data block is added to the current data volume of the RFB packet to be assembled, and the accumulated data volume is obtained. If the accumulated data volume exceeds the data volume threshold, the RFB packet to be grouped is treated as a complete RFB packet, the current data volume is taken as the total data volume of the complete RFB packet, and the number of RFB packets that have been encapsulated is incremented by 1; if the accumulated data volume does not exceed the data volume threshold, the newly added data block is taken as a data block in the RFB packet to be grouped, and the current data volume of the RFB packet to be grouped is updated to the accumulated data volume. Read the newly added data block from the RAM; If the number of completed RFB packets reaches the preset number, packet assembly will stop. If the number of completed RFB packets does not reach the preset number, the header of the newly added data block and the newly added data block are written back to the off-chip buffer. If the newly added data block is the last data block of the image to be transmitted, packet assembly is stopped.

16. The method according to claim 15, characterized in that, After grouping the RFB packet to be assembled into a complete RFB packet, the method further includes: Update the value of the number of data blocks field in the header of the first data block of the complete RFB packet to the number of data blocks included in the complete RFB packet; The total data volume of the complete RFB packet is recorded in the descriptor; After writing back the header of the newly added data block and the newly added data block to the off-chip cache, the method further includes: If the newly added data block is the last data block of the image to be transmitted, then the value of the data block count field in the header of the first data block of the specified RFB packet is updated to the number of data blocks included in the specified RFB packet, where the specified RFB packet is the RFB packet to which the newly added data block belongs; The total data volume of the specified RFB packet is recorded in the descriptor.

17. The method according to claim 15, characterized in that, The step of writing back the header of the newly added data block and the newly added data block to the off-chip cache includes: If the newly added data block is the first data block in the RFB packet, then the packet header of the first preset length and the newly added data block are written back to the off-chip cache; If the newly added data block is not the first data block in the RFB packet, then the packet header of the second preset length and the newly added data block are written back to the off-chip cache, where the first preset length is greater than the second preset length.

18. The method according to any one of claims 14-17, characterized in that, After stopping the packet assembly, the method further includes: Update the completion flag in the descriptor, the completion flag being used to indicate that the packetization of the image to be transmitted has been completed; Update the tail pointer of the descriptor.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 10-18.

Citation Information

Patent Citations

  • Image transmission method and device

    CN108174200A

  • System and method for multi-stream data write

    US20170371585A1