An online transmission method and system based on block data variable compression
By using client-side compression and secondary compression in the cache block, the problem of low efficiency in blockchain data transmission is solved, enabling efficient transmission of cross-regional block data. This method is suitable for online transmission of large files and saves transmission space costs.
Patent Information
- Application Number
- CN202411074604.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-08-07
AI Technical Summary
Existing blockchain data transmission technologies are inefficient when processing large-scale block data, and cannot meet real-time requirements while ensuring security and stability. Especially in cross-regional block data interaction, existing compression technologies require additional time and computing resources, and their bandwidth throughput efficiency is insufficient.
An online transmission method based on variable compression of block data is adopted. After the client compresses the data, it selects a cache block for secondary compression or direct transmission according to the transmission request, thereby changing the data storage format to improve transmission efficiency.
It saves space costs and improves data transmission efficiency during transmission, especially when transmitting between users, it can improve efficiency by 13% to 31%, adapting to the data transmission needs of different scenarios.
Smart Images

Figure CN119135674B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of block data transmission, and particularly relates to an online transmission method and system based on variable compression of block data. BACKGROUND
[0002] With the rapid development of information technology, efficient and secure data transmission has become one of the core challenges in the field of blockchain technology and many network applications. In the blockchain ecosystem, the transmission of data blocks not only concerns the response speed of the system, but also directly affects the stability and scalability of the entire network. At present, although there are various data transmission technologies, such as online file transmission and face-to-face transmission, these technologies still face a series of significant limitations when applied to block data transmission.
[0003] Firstly, as a widely used data transmission method, online file transmission provides a convenient way for data exchange in the Internet environment, but when dealing with a large number of high-frequency data block transmissions in the blockchain, its efficiency is often restricted by multiple factors such as data size, network bandwidth, and server load. Especially in scenarios with high real-time requirements, large data block transmission may increase network latency, affecting user experience and system performance.
[0004] Secondly, face-to-face transmission (such as through USB, Bluetooth, and other short-range wireless technologies) can ensure the security of data transmission to a certain extent, but its application scenarios are limited and not suitable for widespread and cross-regional block data interaction in the blockchain network. In addition, the face-to-face transmission method is difficult to match the efficiency of online transmission in high-speed network environments, especially when dealing with large-scale data blocks, its inefficiency and inconvenience are particularly prominent.
[0005] Moreover, existing blockchain data transmission involves multiple key links: fast transmission of known block files, efficient data interaction between blocks, and real-time transmission links established between blocks and users. These links together form the core framework of the blockchain data transmission system. However, existing technologies generally face the problem of data transmission efficiency being restricted by data status (such as compression or not) and bandwidth throughput efficiency between users / blocks when implementing these functions.
[0006] Specifically, although data compression technology can reduce the amount of data transmitted to a certain extent and improve transmission efficiency, it requires additional time and computing resources in the processing process, and the compression effect is limited by data type and compression algorithm. At the same time, the bandwidth throughput efficiency between users and blocks is also a key factor affecting data transmission speed. In the case of complex and variable network environment, how to ensure the stability and efficiency of data transmission has become a problem to be solved in the development of blockchain technology. SUMMARY
[0007] The technical problem solved by the present application is to provide an online transmission method and system based on block data variable compression, which can save transmission space cost and improve data transmission efficiency during online transmission of large files.
[0008] To solve the above technical problems, the technical solution adopted by the present application is:
[0009] An online transmission method based on block data variable compression, comprising the steps of:
[0010] The first client obtains user data and compresses the user data;
[0011] The first client responds to an online transmission request, and if the online transmission request is inter-user data transmission, the compressed user data is transmitted to a cache block, the cache block converts the compressed user data into dynamic data, and the data in the cache block is compressed again and then transmitted to the second client;
[0012] If the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client.
[0013] To solve the above technical problems, another technical solution adopted by the present application is:
[0014] An online transmission system based on block data variable compression, comprising a first client, a second client and a cache block:
[0015] The first client obtains user data and compresses the user data;
[0016] The first client responds to an online transmission request, and if the online transmission request is inter-user data transmission, the compressed user data is transmitted to a cache block, the cache block converts the compressed user data into dynamic data, and the data in the cache block is compressed again and then transmitted to the second client;
[0017] If the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client.
[0018] The beneficial effect of the present application is that the first client compresses the user data after obtaining the user data, and after responding to the online transmission request of the data, if the online transmission request is inter-user data transmission, the compressed user data is transmitted to the cache block, the cache block can convert the compressed user data into dynamic data, and the data in the cache block is compressed again and transmitted to the second client; if the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client. In this way, when large file online transmission is performed between users, the storage form of the data can be changed during the transmission process, and the data can be compressed while being transmitted, thereby saving transmission space cost and improving data transmission efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A flow chart of an online transmission method based on variable compression of block data according to an embodiment of the present application;
[0020] Figure 2 A schematic diagram of an online transmission system based on variable compression of block data according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] To explain the technical content, purposes and effects of the present application in detail, the following will be described in combination with embodiments and the accompanying drawings.
[0022] Please refer to Figure 1 The embodiment of the present application provides an online transmission method based on variable compression of block data, which comprises the following steps:
[0023] The first client obtains user data, and compresses the user data;
[0024] The first client responds to the online transmission request, and if the online transmission request is inter-user data transmission, the compressed user data is transmitted to the cache block, the cache block converts the compressed user data into dynamic data, and the data in the cache block is compressed again and transmitted to the second client;
[0025] If the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client.
[0026] From the above description, the beneficial effects of the present application are that: the first client obtains user data and compresses it, and after responding to the online transmission request of the data, if the online transmission request is inter-user data transmission, the compressed user data is transmitted to the cache block, the cache block can convert the compressed user data into dynamic data, and the data in the cache block is compressed again and transmitted to the second client; if the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client. In this way, when large file online transmission is performed between users, the storage form of the data can be changed during the transmission process, and the data can be compressed while being transmitted, saving transmission space cost and improving data transmission efficiency.
[0027] Further, the first client obtains user data, and compresses the user data, including:
[0028] If the user data obtained by the first client is dynamic data, the user data is segmented, the data of each segment is compressed, and it is judged whether the compression ratio of each segment is greater than a preset ratio, if yes, the compressed data is used for transmission, otherwise, the uncompressed data is used for transmission;
[0029] If the user data obtained by the first client is a storage file, the storage file is compressed in the memory of the first client.
[0030] From the above description, the user data includes dynamic data type and storage file type, so for dynamic data, since the size of the data in the memory is known, the dynamic data is segmented and processed, the multi-segment filling of the data can be realized, and the transmission efficiency of the dynamic data is improved; and for the storage file, the file can also be compressed and transmitted, reducing the data transmission amount and improving the transmission efficiency.
[0031] Further, the cache block converts the compressed user data into dynamic data, including:
[0032] If the compressed user data is compressed dynamic data, the cache block caches the compressed user data into a memory block, and marks the original data state of the compressed user data in the memory block;
[0033] If the compressed user data is a compressed storage file, the cache block caches the compressed user data into a memory block to convert the compressed user data into memory storage data, and marks the original data state of the compressed user data in the memory block.
[0034] As can be known from the above description, in the cache block, the data of the file type is converted into the dynamic data type of dynamic storage, the data storage form can be changed during transmission, and efficient transmission is performed; and the memory block storing the data in the cache block is marked with the original data state of the compressed user data, so that the data is conveniently decompressed and restored by the second client.
[0035] Further, the data in the cache block is secondarily compressed, including:
[0036] The cache block performs segmented compression on the data in the memory block, releases the secondarily compressed data into the buffer area after generating the buffer area, and configures the corresponding original data state for the secondarily compressed data.
[0037] As can be known from the above description, by the method of segmented compression on the data, the data originally stored in the file can be secondarily compressed according to the segmented compression method of the dynamic data, the effect of large file transmission and compression at the same time is realized, and the method of secondary compression can further reduce the transmission amount to improve the transmission efficiency.
[0038] Further, the method further includes:
[0039] The second client receives the compressed data and the original data state thereof, if the original data state of the received compressed data is dynamic data, creates a data space, and fills the segmented decompressed compressed data into the data space;
[0040] If the original data state of the received compressed data is a storage file, the compressed data is decompressed and stored in the disk space.
[0041] As can be known from the above description, after the second client receives the compressed data, for the compressed data with the original data state of dynamic data, the data is segmented and decompressed and filled into the data space, and for the compressed data with the original data state of a storage file, the data is decompressed and stored in the disk space, so that the transmission efficiency of the data is improved.
[0042] Please refer to Figure 2 Another embodiment of the present application provides an online transmission system based on block data variable compression, including a first client, a second client and a cache block:
[0043] The first client obtains user data, and compresses the user data;
[0044] The first client transmits the compressed user data to the cache block in response to the online transmission request, if the online transmission request is inter-user data transmission, the cache block converts the compressed user data into dynamic data, and transmits the data in the cache block to the second client after secondary compression.
[0045] If the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client.
[0046] From the above description, the beneficial effects of the present application are that the first client obtains user data and compresses it, and in response to the online transmission request, if the online transmission request is inter-user data transmission, the compressed user data is transmitted to the cache block, the cache block can convert the compressed user data into dynamic data, and the data in the cache block is transmitted to the second client after secondary compression; if the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client. In this way, when large files are transmitted online between users, the storage form of the data can be changed during transmission, and the data can be compressed while being transmitted, saving transmission space and improving data transmission efficiency.
[0047] Further, the first client obtains user data and compresses the user data, including:
[0048] If the user data obtained by the first client is dynamic data, the user data is segmented, the data of each segment is compressed, and it is judged whether the compression ratio of each segment is greater than a preset ratio, if yes, the compressed data is used for transmission, otherwise, the uncompressed data is used for transmission;
[0049] If the user data obtained by the first client is a storage file, the storage file is compressed in the memory of the first client.
[0050] From the above description, the user data includes dynamic data type and storage file type, so for dynamic data, since the size of the data in the memory is known, segmenting the dynamic data can realize multi-segment filling of the data and improve the transmission efficiency of the dynamic data; and for the storage file, the file can also be compressed and transmitted to reduce the data transmission amount and improve the transmission efficiency.
[0051] Further, the cache block converts the compressed user data into dynamic data, including:
[0052] If the compressed user data is compressed dynamic data, the cache block caches the compressed user data in the memory block, and marks the original data state of the compressed user data in the memory block.
[0053] If the compressed user data is a compressed storage file, the cache block caches the compressed user data into a memory block, converts the compressed user data into memory storage data, and marks the original data state of the compressed user data in the memory block.
[0054] As described above, in the cache block, the data of the storage file type is converted into the dynamic data type of dynamic storage, which can change the data storage form during transmission and perform efficient transmission; and the memory block storing the data in the cache block is marked with the original data state of the compressed user data, which facilitates subsequent decompression and restoration of the data by the second client.
[0055] Further, the data in the cache block is secondarily compressed, including:
[0056] The cache block performs segmented compression on the data in the memory block, releases the secondarily compressed data to the buffer area after generating the buffer area, and configures the corresponding original data state for the secondarily compressed data.
[0057] As described above, by the method of segmented compression of the data, the data originally in the storage file can be secondarily compressed according to the segmented compression method of the dynamic data, which can realize the effect of large file transmission and compression at the same time, and the method of secondary compression can further reduce the transmission amount to improve the transmission efficiency.
[0058] Further, it further includes:
[0059] The second client receives the compressed data and its original data state, and if the original data state of the received compressed data is dynamic data, creates a data space, and fills the segmented decompressed compressed data into the data space;
[0060] If the original data state of the received compressed data is a storage file, the compressed data is decompressed and stored in a disk space.
[0061] As described above, after the second client receives the compressed data, for the compressed data with the original data state of dynamic data, the data is segmented and decompressed and filled into the data space, and for the compressed data with the original data state of the storage file, the data is decompressed and stored in the disk space, which can improve the transmission efficiency of the data.
[0062] The above-mentioned online transmission method and system based on block data variable compression of the application are particularly suitable for saving transmission space cost and improving data transmission efficiency during online transmission of large files, and the following will be described through specific embodiments:
[0063] Embodiment one
[0064] Please refer to Figure 1 An online transmission system based on block data variable compression, comprising the steps of:
[0065] S1, the first client acquires user data, and compresses the user data.
[0066] If the user data acquired by the first client is dynamic data, the user data is segmented, the data of each segment is compressed, and it is judged whether the compression ratio of each segment is greater than a preset proportion. If yes, the compressed data is used for transmission, otherwise, the uncompressed data is used for transmission.
[0067] Specifically, the number of segments of dynamic data can be calculated first: segment number = dynamic data size / 1024, then the current segment data is compressed into RAR, ZIP or RAR5 format, and then it is judged whether the size of the current segment compressed data and the original data changes. The compression ratio is calculated by (original data size-compressed data size after compression) / original data size. When the compression ratio>20%, it is considered as effective compression, and the size of the compressed data is recorded at the same time. Otherwise, the uncompressed current segment data is directly transmitted in real time.
[0068] If the user data acquired by the first client is a storage file, the storage file is compressed in the memory of the first client.
[0069] Specifically, the storage file is read into the memory, compressed in the memory and the size of the data compressed in the memory is calculated, and the size of the data compressed in the memory is recorded at the same time.
[0070] Among them, the dynamic data is already known in the memory, and the data is already prepared, so only the memory data space size needs to be calculated, and segmented processing is needed. The purpose is: segmented transmission is more efficient, and since the position after segmentation is known, multi-segment padding data operation can be performed.
[0071] And for the storage file, (user data to user data transmission target time / bandwidth)<(user data compression data to user data transmission target time / bandwidth). If the efficiency of direct transmission of the storage file is higher than that of the compressed transmission, real-time transmission is used.
[0072] In this embodiment, please refer to Figure 2 For the compressed data, the different compression data of the same user data can also be compared, and the data with smaller data size after compression is preferentially selected as the new compression data.
[0073] S2, the first client transmits the compressed user data to the cache block in response to the online transmission request, if the online transmission request is inter-user data transmission, the cache block converts the compressed user data into dynamic data, and transmits the secondary compressed data in the cache block to the second client.
[0074] If the compressed user data is compressed dynamic data, the cache block caches the compressed user data in the memory block and marks the original data state of the compressed user data in the memory block.
[0075] Specifically, when transmitting between users, a cache block needs to be set between users. The transmission efficiency from user to block is greater than that from user to user, that is, the efficiency of "user 1-> cache block-> user 2" is greater than that of "user 1-> user 2", which can effectively improve the transmission efficiency.
[0076] The role of the cache block is to perform secondary processing on the data and the data method: for dynamic data, after obtaining the data size, the compressed user data is cached in the cache memory block, and the original data state of the memory block is marked, and the data in the memory block is compressed and released to the buffer.
[0077] If the compressed user data is a compressed storage file, the cache block caches the compressed user data in the memory block to convert the compressed user data into memory storage data, and marks the original data state of the compressed user data in the memory block.
[0078] Specifically, for a storage file, the compressed user data is converted into memory storage data during transmission, so that the storage form of the data is converted into dynamic data existing in the cache memory block, and the original data state of the memory block is marked. At this time, secondary compression can be performed according to the segmented compression method of dynamic data, which can realize the effect of large file transmission and compression at the same time, and the data in the memory block is compressed and released to the buffer.
[0079] S3, if the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client.
[0080] Among them, the second client receives compressed data and its original data state, if the original data state of the received compressed data is dynamic data, a data space is created, and the compressed data is segmented and decompressed and filled into the data space; if the original data state of the received compressed data is a storage file, the compressed data is decompressed and stored in the disk space.
[0081] Specifically, for the compressed data of which the original data state is dynamic data, the number of segments of the compressed data is acquired to calculate the total size of the dynamic data: total size = segment number * 1024; a data space is created, the corresponding compressed form (RAR / ZIP / RAR5) is decompressed, and the space is filled; and the data is filled into the data space in the order.
[0082] For the compressed data of which the original data state is a storage file, the compressed data is decompressed to the disk space.
[0083] Embodiment two
[0084] Please refer to Figure 2 An online transmission system based on block data variable compression, comprising a first client, a second client and a cache block:
[0085] The first client acquires user data, and compresses the user data: if the user data acquired by the first client is dynamic data, the user data is segmented, each segment of data is compressed, and it is determined whether the compression ratio of each segment is greater than a preset ratio; if yes, the compressed data is used for transmission; otherwise, the uncompressed data is used for transmission; if the user data acquired by the first client is a storage file, the storage file is compressed in the memory of the first client.
[0086] The first client responds to an online transmission request: if the online transmission request is inter-user data transmission, the compressed user data is transmitted to the cache block; the cache block converts the compressed user data into dynamic data, and transmits the data in the cache block to the second client after secondary compression: if the compressed user data is compressed dynamic data, the cache block caches the compressed user data in the memory block, and marks the original data state of the compressed user data in the memory block; if the compressed user data is a compressed storage file, the cache block caches the compressed user data in the memory block to convert the compressed user data into memory storage data, and marks the original data state of the compressed user data in the memory block. The secondary compression of the data in the cache block comprises: the cache block segments the data in the memory block for compression, generates a buffer area, releases the secondary compressed data to the buffer area, and configures the corresponding original data state for the secondary compressed data.
[0087] If the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client.
[0088] The second client receives the compressed data and its original data state, if the original data state of the received compressed data is dynamic data, a data space is created, the compressed data is segmented and decompressed and filled into the data space, if the original data state of the received compressed data is a storage file, the compressed data is decompressed and stored in a disk space.
[0089] In summary, the online transmission method and system based on block data variable compression provided by the application compress the user data obtained by the first client, and after responding to the online transmission request of the data, if the online transmission request is inter-user data transmission, the compressed user data is transmitted to the cache block, the cache block can convert the compressed user data into dynamic data, and the data in the cache block is segmented and compressed and then transmitted to the second client, so that the data storage form is changed during transmission, the transmission and compression are changed, and the transmission efficiency can be improved by 13-31%. If the online transmission request is block inter-user data transmission, the compressed user data is directly transmitted to the second client. Through the above transmission method, the data transmission of the two scenes can be adapted
[0090] In this way, the transmission of compressed data has high overall efficiency due to the reduction in data size, and since the data connection is a long connection, the number of long connection links is reduced in time due to the high efficiency, and the overall efficiency is improved. Too many long links with large data will cause the server to have a heavy data processing burden and increase the data processing and transmission time, and in this scheme, dynamic scenes are used to generate multiple transmission schemes in multiple situations, effectively saving transmission space costs and solving the transmission problem from the data size.
[0091] The above is only an embodiment of the application, and does not limit the patent scope of the application, any equivalent transformation or direct or indirect application in related technical fields using the content of the application specification and drawings is also included in the patent protection scope of the application.
Claims
1. An online transmission method based on variable compression of block data, characterized in that, Including the following steps: The first client obtains user data and compresses the user data; The first client responds to the online transmission request. If the online transmission request is data transmission between users, the compressed user data is transmitted to the cache block. The cache block converts the compressed user data into dynamic data and performs secondary compression on the data in the cache block before transmitting it to the second client. If the online transmission request is a data transmission between users in a block, then the compressed user data is directly transmitted to the second client; The cache block transforms the compressed user data into dynamic data, including: If the compressed user data is compressed dynamic data, the cache block caches the compressed user data in the memory block and marks the original data state of the compressed user data in the memory block; If the compressed user data is a compressed storage file, the cache block caches the compressed user data into a memory block to transform the compressed user data into memory storage data, and marks the original data state of the compressed user data in the memory block.
2. The online transmission method based on variable compression of block data according to claim 1, characterized in that, The first client obtains user data and compresses the user data, including: If the user data obtained by the first client is dynamic data, the user data is segmented, each segment is compressed, and it is determined whether the compression ratio of each segment is greater than a preset ratio. If so, the compressed data is used for transmission; otherwise, the uncompressed data is used for transmission. If the user data obtained by the first client is a storage file, then the storage file is compressed in the memory of the first client.
3. The online transmission method based on variable compression of block data according to claim 1, characterized in that, The data in the cache block is subjected to secondary compression, including: The cache block performs segmented compression on the data in the memory block, generates a buffer, releases the second-compressed data into the buffer, and configures the corresponding original data state for the second-compressed data.
4. The online transmission method based on variable compression of block data according to claim 3, characterized in that, Also includes: The second client receives the compressed data and its original data state. If the original data state of the received compressed data is dynamic data, a data space is created, and the compressed data is segmented, decompressed, and then filled into the data space. If the original data of the received compressed data is in the state of a storage file, then the compressed data will be decompressed and stored in the disk space.
5. An online transmission system based on variable compression of block data, characterized in that, Includes the first client, the second client, and the cache block: The first client obtains user data and compresses the user data; The first client responds to the online transmission request. If the online transmission request is data transmission between users, the compressed user data is transmitted to the cache block. The cache block converts the compressed user data into dynamic data and performs secondary compression on the data in the cache block before transmitting it to the second client. If the online transmission request is a data transmission between users in a block, then the compressed user data is directly transmitted to the second client; The cache block transforms the compressed user data into dynamic data, including: If the compressed user data is compressed dynamic data, the cache block caches the compressed user data in the memory block and marks the original data state of the compressed user data in the memory block; If the compressed user data is a compressed storage file, the cache block caches the compressed user data into a memory block to transform the compressed user data into memory storage data, and marks the original data state of the compressed user data in the memory block.
6. The online transmission system based on variable compression of block data according to claim 5, characterized in that, The first client obtains user data and compresses the user data, including: If the user data obtained by the first client is dynamic data, the user data is segmented, each segment is compressed, and it is determined whether the compression ratio of each segment is greater than a preset ratio. If so, the compressed data is used for transmission; otherwise, the uncompressed data is used for transmission. If the user data obtained by the first client is a storage file, then the storage file is compressed in the memory of the first client.
7. The online transmission system based on variable compression of block data according to claim 5, characterized in that, The data in the cache block is subjected to secondary compression, including: The cache block performs segmented compression on the data in the memory block, generates a buffer, releases the second-compressed data into the buffer, and configures the corresponding original data state for the second-compressed data.
8. An online transmission system based on variable compression of block data according to claim 7, characterized in that, Also includes: The second client receives the compressed data and its original data state. If the original data state of the received compressed data is dynamic data, a data space is created, and the compressed data is segmented, decompressed, and then filled into the data space. If the original data of the received compressed data is in the state of a storage file, then the compressed data will be decompressed and stored in the disk space.
Citation Information
Patent Citations
File uploading method and system
CN104426942A
Method and equipment for sharing cache region by network server
CN111182041A