Cloud desktop clipboard data processing method
By dividing files into large files and small files in the cloud desktop clipboard, and using block processing and multi-threaded compression encoding methods, the cloud desktop clipboard is solved, and more efficient, stable and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411719627.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-11
AI Technical Summary
When transmitting large files, cloud desktop clipboards are inefficient in transmission efficiency due to limited network bandwidth and high latency, and there is a risk of data leakage and illegal access.
By dividing the target file into large files and small files, chunked processing is performed for large files and multi-threaded compression encoding is adopted, string matching and compression encoding are performed directly for small files, and the transmission process is optimized.
It improves the efficiency and stability of data transmission, reduces transmission delay and error rate, and enhances data security.
Smart Images

Figure CN119806719A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and in particular to a method for processing cloud desktop clipboard data. Background Art
[0002] In recent years, cloud computing technology has developed rapidly, and cloud computing products, technologies and services have triggered a new round of industrial changes in the market. Cloud desktop is an application service based on cloud computing and virtualization technology. It extracts the traditional computer desktop environment through cloud computing technology and becomes a virtual desktop service that can provide external services. It migrates computing power and storage to the cloud, weakens local needs and capabilities, and only provides input and output information. Through a specific transmission protocol, the cloud and local are connected to achieve interaction.
[0003] The cloud desktop clipboard is mainly to facilitate users to transfer data between local devices and remote desktops. When using the cloud desktop, users may need to copy text, pictures and other data from the local device to the remote desktop, or copy data from the remote desktop to the local device. At this time, the cloud desktop clipboard can play a very good role, which can make the data transmission between the local device and the remote desktop more convenient and efficient. Through the cloud desktop clipboard, users can freely copy and paste data between the local device and the remote desktop, thereby improving work efficiency and convenience.
[0004] The cloud desktop clipboard may be limited in actual application and face some performance issues. If users use the clipboard to transfer text or files between devices in different regions or with poor network environments, the transmission efficiency may be low due to network delay. Especially when copying large files between the cloud desktop and the local terminal, such as files larger than 100KB, large bandwidth is required to transfer large files, and the network bandwidth between the cloud desktop and the local terminal may be limited, resulting in slow transmission speed. At the same time, the network delay between the cloud desktop and the local terminal may be high, especially for cross-regional or cross-national transmission, which will increase the transmission time. Large files need to be split and reassembled. When transmitting between the cloud desktop and the local terminal, file splitting and reassembly operations are required, which increases the complexity and transmission time. In addition, due to network instability or other factors, file transmission may be interrupted, resulting in transmission failure or the need for retransmission. Transmitting the original data of the clipboard may result in data leakage or illegal access, so file transmission security needs to be considered. In order to improve transmission efficiency, it is necessary to adopt appropriate transmission protocols, compression algorithms, and parallel transmission technologies to optimize the transmission process of large files. Therefore, there are some challenges in copying large files between the cloud desktop and the local terminal, which need to be solved through reasonable technical selection and optimization. Summary of the invention
[0005] In view of this, the present invention provides a method for processing cloud desktop clipboard data to solve the problem of slow clipboard compression speed in the prior art.
[0006] In a first aspect, the present invention provides a method for processing cloud desktop clipboard data, including: obtaining data of a clipboard target file and initializing a dictionary and a data processing state; determining the size of the target file data, marking a target file greater than or equal to a preset size as a large file, and marking a target file less than a preset size as a small file; performing string matching and compression encoding on the data in the small file in turn based on the dictionary, updating the dictionary content and the data processing state, until all the data has been traversed; processing the data of the large file in blocks, and using multi-threading to process the block data at the same time, performing string matching and compression encoding on the data in each block in turn, until all the input data of the current block has been traversed and the data processing state has been updated; until it is determined based on the data processing state that all the blocks have been traversed.
[0007] The method for processing cloud desktop clipboard data provided by the present invention divides the target file into large files and small files according to the file data size, adopts different processing strategies for large files and small files, directly compresses small files and transmits them, thereby improving transmission efficiency; large files are first divided into blocks, and then each block is multi-threaded compressed and encoded and then transmitted independently, thereby reducing compression time, improving data processing efficiency, and ensuring the stability of data transmission.
[0008] In an optional embodiment, the process of sequentially performing string matching and compression encoding on data in a small file based on a dictionary includes: after obtaining the first character in the small file data, searching the dictionary for the longest string that matches the character; defining the position and length encoding of the longest matched string as an integer within a preset range, outputting the integer to a compressed data stream and encoding it using Huffman coding; after updating the dictionary and obtaining the next character in the small file data, returning to the step of "searching the dictionary for the longest string that matches the character"; and outputting unmatched characters to the compressed data stream.
[0009] The method for processing cloud desktop clipboard data provided by the present invention reduces the amount of transmitted data through compression processing, reduces the transmission error rate, and improves transmission efficiency and data integrity; reducing the amount of data can also reduce transmission delays during the transmission process and improve transmission speed.
[0010] In an optional implementation, the process of dividing the data of a large file into blocks includes: dividing the data of the large file into multiple blocks and independently compressing each block; and dividing the corresponding area of each block in the dictionary based on the dictionary.
[0011] In an optional embodiment, the process of performing string matching and compression encoding on the data in each block in turn includes: after obtaining the block data of the current block, searching the dictionary corresponding to the current block for the longest string that matches the block data; defining the position and length encoding of the longest matched string as an integer within a preset range, and outputting the integer to the compressed data stream; after updating the dictionary and obtaining the block data of the next block, returning to the step of "searching the dictionary corresponding to the current block for the longest string that matches the block data"; and outputting the unmatched characters to the compressed data stream.
[0012] The method for processing cloud desktop clipboard data provided by the present invention processes large file data in blocks and adopts a compression algorithm to save network bandwidth resources, so that other network activities are not affected by large file transmission, reduce the transmission delay of shared network resources between the cloud desktop and the terminal local, and improve the transmission speed.
[0013] In an optional embodiment, the method for processing cloud desktop clipboard data also includes: obtaining compressed data of a small file and initializing a dictionary and data processing status; reading the encoded matching position and length of the compressed data of the small file based on the dictionary; decoding each matching position and length in turn, and outputting the matching string based on the dictionary after reconstruction; updating the dictionary and data processing status after outputting unmatched characters, until the decompression of the small file data is completed after traversing all compressed data based on the data processing status.
[0014] In an optional embodiment, the method for processing cloud desktop clipboard data also includes: obtaining compressed data of a large file and initializing a dictionary and data processing status; reading the encoded matching position and length of the compressed data of the large file based on the dictionary; decoding each matching position and length in turn, and reconstructing the matching string based on the dictionary; after constructing corresponding blocks based on the string respectively, decompressing multiple blocks in parallel and outputting them; updating the dictionary and data processing status after outputting unmatched characters, until the decompression of the large file data is completed after traversing all compressed data based on the data processing status.
[0015] In a second aspect, the present invention provides a cloud desktop clipboard data processing device, including: an acquisition module, used to acquire the data of the clipboard target file and initialize the dictionary and data processing status; a marking module, used to determine the size of the data of the target file, mark the target file greater than or equal to the preset size as a large file, and mark the target file less than the preset size as a small file; a small file compression module, used to perform string matching and compression encoding on the data in the small file in turn based on the dictionary, update the dictionary content and data processing status, until all data are traversed; a large file compression module, used to process the data of the large file in blocks, and use multi-threading to process the block data at the same time, and perform string matching and compression encoding on the data in each block in turn, until all input data of the current block is traversed and the data processing status is updated; a termination module, used to determine that all blocks have been traversed based on the data processing status.
[0016] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for processing cloud desktop clipboard data of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0017] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for processing cloud desktop clipboard data according to the first aspect or any corresponding embodiment thereof.
[0018] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, which are used to enable a computer to execute the method for processing cloud desktop clipboard data in the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flowchart of a method for processing cloud desktop clipboard data according to an embodiment of the present invention;
[0021] Figure 2 It is a flowchart of a method for processing small file data on a cloud desktop clipboard according to an embodiment of the present invention;
[0022] Figure 3It is a flowchart of a method for processing large file data on a cloud desktop clipboard according to an embodiment of the present invention;
[0023] Figure 4 It is a flowchart of another method for processing large file data on a cloud desktop clipboard according to an embodiment of the present invention;
[0024] Figure 5 is a schematic flow chart of a small file decompression method according to an embodiment of the present invention;
[0025] Figure 6 is a flow chart of a large file decompression method according to an embodiment of the present invention;
[0026] Figure 7 is a schematic diagram of a specific process of a cloud desktop clipboard data compression method according to an embodiment of the present invention;
[0027] Figure 8 is a timing diagram of a cloud desktop clipboard data processing process according to an embodiment of the present invention;
[0028] Fig. 9 is a structural block diagram of a cloud desktop clipboard data processing device according to an embodiment of the present invention;
[0029] Fig.10 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0032] The cloud desktop clipboard is mainly to facilitate users to freely copy and paste data between local devices and remote desktops. In order to make data transmission between local devices and remote desktops more convenient and efficient, it is necessary to adopt appropriate transmission protocols, compression algorithms and parallel transmission technologies to optimize the transmission process of large files. The compression algorithm can compress the size of the file and reduce the bandwidth and transmission time required for transmission. The compressed file size is smaller, and the time and network resources required for the transmission process are also reduced accordingly, thereby increasing the transmission speed. The compression algorithm can reduce the bandwidth required for file transmission, save network resources, and keep other network activities unaffected. When storing large files on the cloud desktop, the compression algorithm can reduce the file size, thereby reducing storage costs, reducing the amount of data transmitted, reducing the transmission error rate, and improving transmission efficiency and data integrity. At the same time, compressing files through the compression algorithm can improve data security and reduce the risk of data leakage and illegal access.
[0033] Therefore, by using a suitable compression algorithm, the above objectives can be achieved when copying large files between the cloud desktop and the local terminal, thereby improving transmission efficiency and performance.
[0034] To this end, this embodiment provides a method for processing cloud desktop clipboard data, such as Figure 1 As shown, including:
[0035] Step S1: Get the data of the clipboard target file and initialize the dictionary and data processing state.
[0036] Specifically, the cloud desktop or local client monitors the clipboard in real time to see if any files are copied. When a file copy operation is detected, the file information is synchronized to the local client or cloud desktop, while waiting for the paste operation. Once the paste operation is triggered, the data of the clipboard target file is immediately obtained and the dictionary and data processing status are initialized, preparing for clipboard data compression and data transmission.
[0037] Step S2: Determine the size of the data of the target file, mark the target file that is greater than or equal to the preset size as a large file, and mark the target file that is less than the preset size as a small file.
[0038] Exemplarily, before data compression, the data size of the clipboard target file will be judged, and different strategies will be adopted for large files and small files. For example, files smaller than 100KB are marked as small files, and files greater than or equal to 100KB are marked as large files. Technical personnel in this field can freely formulate the division criteria between large files and small files according to actual needs, and no restrictions are made here.
[0039] Step S3: Based on the dictionary, string matching and compression encoding are performed on the data in the small file in turn, and the dictionary content and data processing status are updated until all the data are traversed.
[0040] Specifically, before compressing the data of small files by matching and encoding repeated strings, a fixed-size circular dictionary is used to store the most recent input data, and a state machine is used to track the status of the compression process.
[0041] Alternatively, if Figure 2 As shown in the figure, the process of sequentially matching strings and compressing the data in the small file based on the dictionary includes:
[0042] Step S31: After obtaining the first character in the small file data, search the dictionary for the longest character string that matches the character.
[0043] Specifically, the first character is read from all the data of the input small file, and the longest string matching it is searched in the dictionary. The matching process is accelerated using a hash table, and the compressed data is verified using a hash algorithm to ensure data integrity during transmission.
[0044] Step S32: After defining the position and length of the longest matched character string as an integer within a preset range, the integer is output to the compressed data stream and encoded using Huffman coding.
[0045] Step S33: After updating the dictionary and obtaining the next character in the small file data, return to the step of "searching the dictionary for the longest character string that matches the character".
[0046] Step S34: Output the unmatched characters into the compressed data stream.
[0047] Specifically, the content in the dictionary is updated according to the position and length of the longest string currently matched, and the state machine is transferred to the next state, the longest string matching the next character is searched in the dictionary, and steps S32 to S34 are repeated until all input data is traversed, and an end mark is output at the end of the compressed data, indicating that the compression process is over.
[0048] Step S4: The data of the large file is processed in blocks, and multi-threaded processing is used to process the block data. The data in each block is matched with strings and compressed in turn until all input data of the current block is traversed and the data processing status is updated.
[0049] Specifically, before compressing large file data, a fixed-size circular dictionary is used to store the most recent input data, and a state machine is used to track the status of the compression process. The compression process of large file data adopts block processing and multi-threading processing to make full use of system resources and improve transmission efficiency.
[0050] Alternatively, if Figure 3 As shown in FIG. 1 , the process of processing the data of a large file in blocks includes:
[0051] Step S41: Divide the data of the large file into multiple blocks, and compress each block independently.
[0052] Step S42: Divide the corresponding area of each block in the dictionary based on the dictionary.
[0053] Specifically, the block compression of large files uses intra-block compression, inter-block compression, and multi-threaded processing technology to improve efficiency. According to the total file size, the appropriate block size is adaptively selected to split the original large file. The data of the large file is randomly divided into multiple blocks, each block is compressed independently, and the corresponding area of the data in each block in the dictionary is divided based on the dictionary. At the same time, the state machine uses multi-threading to synchronously process different block data, so that each block has its own dictionary and state, improving the efficiency of block compression.
[0054] Alternatively, if Figure 4 As shown, the process of sequentially matching and compressing the data in each block includes:
[0055] Step S43: After obtaining the block data of the current block, search the dictionary corresponding to the current block for the longest character string that matches the block data.
[0056] Step S44: After defining the position and length of the longest matched character string as an integer within a preset range, the integer is output to the compressed data stream.
[0057] Specifically, the longest string matching the input data is searched in the dictionary of the current block, and the matching position and length are encoded as integers in a predefined range and output to the compressed data stream, and the unmatched characters are output to the compressed data stream. For each block, a sliding window and a dictionary are used to find the matching string, and the matching position and matching length are generated. The repeated pattern in the data is used to represent the repeated data as a pointer to the previously appeared position. A Huffman tree is constructed based on frequency statistics, and a unique code is assigned to each character. Characters with high frequency use shorter codes, and characters with low frequency use longer codes.
[0058] Step S45: After updating the dictionary and obtaining the block data of the next block, return to the step of "searching for the longest character string matching the block data in the dictionary corresponding to the current block".
[0059] Step S46: Output the unmatched characters into the compressed data stream.
[0060] Specifically, according to the current matching position and length, the content in the dictionary is updated, and the state machine is transferred to the next state. For each compressed block, its position, size and other necessary information in the entire data stream are recorded, and this information is recorded in the form of an index table. The compressed blocks are connected in sequence to form an overall compressed data stream. Steps S43 to S46 are repeated until all data in the current block are traversed, and an end mark is output at the end of the compressed data, indicating the end of compression of the current block.
[0061] Step S5: until all blocks are traversed based on the data processing status.
[0062] Specifically, steps S42 to S46 are repeated, and the state machine is used to track the position of the current block, so that after each block is compressed, the state machine determines that all blocks have been traversed, and the compression process of the large file ends.
[0063] In the method for processing cloud desktop clipboard data provided in this embodiment, the compression algorithm can reduce the amount of transmitted data, reduce the transmission error rate, and improve the transmission efficiency and data integrity. Reducing the amount of data can also reduce the transmission delay during the transmission process and increase the transmission speed. The compression algorithm can also improve the security of data. By compressing the file, the risk of data leakage and illegal access can be reduced.
[0064] The method for processing cloud desktop clipboard data provided in this embodiment divides the target file into large files and small files according to the file data size, and then adopts different processing strategies for large files and small files. Small files are directly compressed and then transmitted to improve transmission efficiency; large files are first divided into blocks, and then each block is simultaneously multi-threaded synchronously compressed and transmitted independently, which reduces compression time, improves data processing efficiency, and ensures the stability of data transmission.
[0065] In some optional embodiments, such as Figure 5 As shown, the method for processing cloud desktop clipboard data also includes:
[0066] Step S6: Obtain the compressed data of the small file and initialize the dictionary and data processing state.
[0067] Step S7: Read the matching position and length of the encoding of the compressed data of the small file based on the dictionary.
[0068] Step S8: Decode each matching position and length in turn, and reconstruct the matching string based on the dictionary and then output it.
[0069] Step S9: after outputting the unmatched characters, the dictionary and the data processing status are updated until the decompression of the small file data is completed after all the compressed data are traversed based on the data processing status.
[0070] Specifically, the small file data decompression process is the opposite of the small file data compression process described above. When the paste operation is triggered, the cloud desktop performs the clipboard data compression and data transmission described above in real time, while the local client receives and decompresses the data in real time on the other side, ensuring the integrity and correctness of the file, improving the efficiency of data processing, and completing the entire process of the copy and paste operation.
[0071] In some optional embodiments, such as Figure 6 As shown, the method for processing cloud desktop clipboard data also includes:
[0072] Step S10: Obtain the compressed data of the large file and initialize the dictionary and data processing state.
[0073] Step S11: Read the encoded matching position and length of the compressed data of the large file based on the dictionary; decode each matching position and length in turn, and reconstruct the matching character string based on the dictionary.
[0074] Step S12: After corresponding blocks are constructed based on the character strings respectively, multiple blocks are decompressed in parallel and then output.
[0075] Step S13: after outputting the unmatched characters, the dictionary and the data processing status are updated until the decompression of the large file data is completed after all the compressed data are traversed based on the data processing status.
[0076] Specifically, the large file data decompression process is the opposite of the large file data compression process described above. When the paste operation is triggered, the cloud desktop performs the clipboard data compression and data transmission described above in real time, while the local client receives and decompresses the data in real time on the other side, ensuring the integrity and correctness of the file, improving the efficiency of data processing, and completing the entire process of the copy and paste operation.
[0077] For example, Figure 7 As shown in the figure, the process of cloud desktop clipboard data compression specifically includes:
[0078] (1) Obtain the data of the target file on the clipboard and determine the data size of the target file;
[0079] (2) When it is determined to be a small file, the storage content in the circular dictionary is initialized;
[0080] (3) Find the longest string that matches the first data based on the dictionary content, and use a hash table to speed up the output.
[0081] (4) Huffman coding is used to encode and output the longest string, and the unmatched characters are output and the dictionary content is updated, switching to search for the next data in the small file;
[0082] (5) Repeat steps (3) to (4) until every data in the small file is traversed and the end mark is output to complete the compression of the small file data.
[0083] (6) When it is determined to be a large file, the storage content in the circular dictionary is initialized.
[0084] (7) Compress the data in large files into blocks and perform multi-threaded processing.
[0085] (8) Based on the dictionary content, search for the longest string that matches each data in the first block, and use the hash table to accelerate the output.
[0086] (9) Huffman coding is used to encode and output the longest string. At the same time, the unmatched characters are output and the dictionary content is updated, switching to search for each data in the next block in the large file.
[0087] (10) Repeat steps (8) to (9) until each block in the large file and the data in each block are traversed, and an end mark is output to complete the compression of the large file data.
[0088] For example, Figure 8 As shown, this embodiment also provides a method of optimizing the file transmission process by using a suitable transmission protocol, compression algorithm, and parallel transmission technology. Taking copying a local file to a cloud desktop as an example, the transmission process is as follows:
[0089] (1) The local client monitors the clipboard in real time to see if any files are copied. When a file is detected (i.e., the user has copied the file locally), after processing the file path to be copied, a reminder message NOTICE of the total number of files, total file size, and file name list is sent to the cloud desktop.
[0090] (2) After receiving the NOTICE, the cloud desktop adds a new thread waiting for pasting. When it finds that the user has performed a pasting operation on the cloud desktop, it immediately sends a confirmation message CONFIRM to notify the local client.
[0091] (3) After receiving CONFIRM, the local client starts to send the file information FILE to be copied, first sending FILE (including file size and file name information) to the cloud desktop. After receiving the message, the cloud desktop creates a file in the corresponding path of the cloud desktop.
[0092] (4) The local client judges the clipboard data, adopts different strategies for large files and small files, and continuously sends DATA messages containing file data to the cloud desktop.
[0093] (5) For small file data, data compression is achieved by matching and encoding repeated character strings, and sliding window matching is used to find repeated fragments. Huffman coding is then used to achieve data compression and encapsulate the data into DATA messages for transmission to the cloud desktop.
[0094] (6) The compression processing of large file data adopts block processing and multi-thread processing, making full use of system resources, dividing the clipboard data into blocks, multi-threaded compression processing, each block is transmitted independently, and concurrent transmission is supported to improve efficiency. After data compression, the data is encapsulated into DATA messages and transmitted to the cloud desktop.
[0095] (7) After receiving the file data, the cloud desktop decompresses it, restores the original file, and generates a corresponding file in the corresponding path.
[0096] (8) If the user clicks Cancel during the process of sending data to the cloud desktop in step (4), the local client will send a clear message CANCEL to the cloud desktop and notify the cloud desktop to cancel writing the file. If there is no cancellation, the process will be skipped.
[0097] (9) After the local client has sent all file data to the cloud desktop, it finally sends a termination message FINISH to the cloud desktop to notify the cloud desktop that the file has been sent and the process ends.
[0098] In this embodiment, a cloud desktop clipboard data processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0099] This embodiment provides a cloud desktop clipboard data processing device, such as Fig. 9 As shown, including:
[0100] The acquisition module 901 is used to acquire the data of the clipboard target file and initialize the dictionary and data processing state.
[0101] The marking module 902 is used to determine the size of the data of the target file, mark the target file that is greater than or equal to the preset size as a large file, and mark the target file that is less than the preset size as a small file.
[0102] The small file compression module 903 is used to perform string matching and compression encoding on the data in the small file in sequence based on the dictionary, and update the dictionary content and data processing status until all the data are traversed.
[0103] The large file compression module 904 is used to process the data of the large file in blocks, and use multi-threading to process the block data, and perform string matching and compression encoding on the data in each block in turn until all input data of the current block is traversed and the data processing status is updated.
[0104] The termination module 905 is used to determine whether all blocks have been traversed based on the data processing status.
[0105] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0106] The cloud desktop clipboard data processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0107] The embodiment of the present invention also provides a computer device having the above Fig. 9 The cloud desktop clipboard data processing device shown.
[0108] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.10 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.
[0109] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0110] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0111] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0112] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0113] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0114] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0115] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0116] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for processing cloud desktop clipboard data, characterized in that: include: Get the data of the clipboard target file and initialize the dictionary and data processing status; Determine the size of the target file data, mark the target file that is larger than or equal to the preset size as a large file, and mark the target file that is smaller than the preset size as a small file; Based on the dictionary, string matching and compression encoding are performed on the data in the small file in sequence, and the dictionary content and data processing status are updated until all the data are traversed; The data of the large file is processed in blocks, and multi-threaded processing is used to process the block data, and string matching and compression encoding are performed on the data in each block in turn until all input data of the current block is traversed and the data processing status is updated; Until all blocks are traversed based on the data processing status.
2. The method according to claim 1, characterized in that The process of sequentially performing string matching and compression encoding on the data in the small file based on the dictionary includes: After obtaining the first character in the small file data, searching the dictionary for the longest character string matching the character; After defining the position and length of the longest matched string as an integer within a preset range, the integer is output to a compressed data stream and encoded using Huffman coding; After updating the dictionary and obtaining the next character in the small file data, return to the step of "searching for the longest character string matching the character in the dictionary"; Output unmatched characters to the compressed data stream.
3. The method according to claim 1, characterized in that The process of processing the data of the large file in blocks includes: Dividing the data of the large file into multiple blocks, and independently compressing each block; The corresponding area of each block in the dictionary is divided based on the dictionary.
4. The method according to claim 1 or 3, characterized in that: The process of sequentially performing string matching and compression encoding on the data in each block includes: After obtaining the block data of the current block, search the dictionary corresponding to the current block for the longest string that matches the block data; After defining the position and length encoding of the longest matched string as an integer within a preset range, the integer is output to the compressed data stream; After updating the dictionary and obtaining the block data of the next block, return to the step of "searching for the longest string matching the block data in the dictionary corresponding to the current block"; Output unmatched characters to the compressed data stream.
5. The method according to claim 2, characterized in that: Also includes: Get the compressed data of the small file and initialize the dictionary and data processing status; Read the matching position and length of the encoding of the compressed data of the small file based on the dictionary; Decode each matching position and length in turn, and reconstruct the matching string based on the dictionary and then output it; After the unmatched characters are output, the dictionary and the data processing state are updated until the decompression of the small file data is completed after all the compressed data are traversed based on the data processing state.
6. The method according to claim 4, characterized in that Also includes: Get the compressed data of the large file and initialize the dictionary and data processing status; Read the matching position and length of the encoding of the compressed data of the large file based on the dictionary; Decode each matching position and length in turn, and reconstruct the matching string based on the dictionary; After constructing corresponding blocks based on the character strings respectively, multiple blocks are decompressed in parallel and then output; After the unmatched characters are output, the dictionary and the data processing state are updated until the decompression of the large file data is completed after all the compressed data are traversed based on the data processing state.
7. A cloud desktop clipboard data processing device, characterized in that: include: The acquisition module is used to obtain the data of the clipboard target file and initialize the dictionary and data processing status; A marking module, used for determining the size of the target file data, marking a target file that is larger than or equal to a preset size as a large file, and marking a target file that is smaller than a preset size as a small file; A small file compression module, used to perform string matching and compression encoding on the data in the small file in sequence based on the dictionary, and update the dictionary content and data processing status until all the data are traversed; A large file compression module is used to process the data of the large file in blocks, and use multi-threading to process the block data, and perform string matching and compression encoding on the data in each block in turn, until all input data of the current block is traversed and the data processing status is updated; A termination module is used to determine whether all blocks have been traversed based on the data processing status.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method for processing cloud desktop clipboard data as described in any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for processing cloud desktop clipboard data as described in any one of claims 1 to 6.
10. A computer program product, characterized in that It includes computer instructions, which are used to enable a computer to execute the method for processing cloud desktop clipboard data as described in any one of claims 1 to 6.