File reorganization method, device, electronic device and storage medium

By sorting and reorganizing data blocks, the problems of resource waste and cost increase in the existing technology are solved, more efficient file reorganization is achieved, the number of reorganized files is reduced, and processing costs are reduced.

CN113849468BActive Publication Date: 2025-09-30NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111151187.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-09-30
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

In the prior art, there are problems of resource waste and cost increase in the data file reorganization process, mainly because data blocks that occupy storage space far below a preset limit are reorganized separately, resulting in an excessive number of reorganized files.

Method used

By sorting multiple data blocks, obtaining the unreorganized data blocks at both ends and reorganizing them according to a preset threshold, it is ensured that the storage space of the reorganized file is close to but does not exceed the preset threshold, thereby reducing the number of reorganized files.

Benefits of technology

This effectively reduces the number of reorganized files, saves resources, and reduces processing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113849468B_ABST
    Figure CN113849468B_ABST
Patent Text Reader

Abstract

The present application discloses a file reorganization method, apparatus, electronic device, and storage medium, comprising: obtaining a plurality of data blocks; sorting the plurality of data blocks to obtain a sorted data block sequence, wherein the traversal direction of the data block sequence includes a first direction and a second direction; and reorganizing the plurality of data blocks according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold value to obtain a plurality of reorganized files. The method is performed by sorting the plurality of data blocks to obtain a data block sequence, then obtaining at least one data block from each end of the data block sequence, and comparing the data blocks obtained from each end of the data block sequence with a preset threshold value, so that the storage space occupied by the reorganized file is as close as possible to and does not exceed the preset threshold value. This method can reduce the number of reorganized files, save resources, and reduce costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a file reorganization method, device, electronic device, and storage medium. Background Art

[0002] In the prior art, data files are scanned or identified. Since one scan or identification process can process limited information, the data files are usually segmented and reorganized, and the reorganized data files are scanned or identified.

[0003] After a data file is segmented into multiple data blocks, the prior art often reassembles the data blocks directly according to the order in which the data blocks were segmented. The storage space occupied by each data block is added together, starting from the beginning and ending in the order in which they were segmented, until the total storage space just exceeds a preset limit. At this point, the data blocks that cause the storage space to exceed the preset limit are removed, and the remaining data blocks are reassembled. Subsequently, the aforementioned addition process and comparison with the preset limit are continued, starting with the data block that was just removed, until the last data block in the multiple data blocks is reassembled.

[0004] In existing file reorganization methods, a situation often occurs: data blocks that occupy storage space far below a preset limit are reorganized separately. This results in a large number of reorganized files, resulting in a waste of resources and an increase in costs. Summary of the Invention

[0005] The embodiments of the present application provide a file reorganization method, device, electronic device, and storage medium, which can improve the problems of waste of resources and high cost in the prior art.

[0006] The present invention provides a method for file reorganization, comprising:

[0007] Acquire multiple data blocks, wherein the multiple data blocks are obtained by segmenting a data file;

[0008] Sorting the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, and the first direction is opposite to the second direction;

[0009] The plurality of data blocks are reorganized to obtain a plurality of reorganized files according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold, wherein the preset threshold is an upper limit value of the amount of data that can be processed by a single scanning process or recognition process.

[0010] The present application also provides a file reorganization device, comprising:

[0011] A data block acquisition unit, configured to acquire a plurality of data blocks, wherein the plurality of data blocks are obtained by segmenting a data file;

[0012] a sequence acquisition unit, configured to sort the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, the first direction being opposite to the second direction;

[0013] A data block reassembly unit is configured to reassemble the plurality of data blocks to obtain a plurality of reassembled files based on the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold, wherein the preset threshold is an upper limit of the amount of data that can be processed by a single scanning process or recognition process.

[0014] In some embodiments, the data block reassembly unit is specifically configured to obtain, for the data block sequence, a first unreassembled first direction data block obtained by traversing along the first direction, and obtain a first unreassembled second direction data block obtained by traversing along the second direction;

[0015] Calculating a sum of storage space occupancy values ​​of the first first-direction data block and the first second-direction data block, and comparing the sum of the storage space occupancy values ​​with a preset threshold;

[0016] If the sum of the storage space occupancy values ​​does not exceed the preset threshold, obtaining the next unreorganized second direction data block obtained by traversing along the second direction;

[0017] Accumulating the storage space occupancy value of the data block in the second direction and the sum of the storage space occupancy values ​​to obtain a new sum of the storage space occupancy value, and performing the step of "comparing the sum of the storage space occupancy values ​​with a preset threshold value" until the accumulated sum of the storage space occupancy values ​​exceeds the preset threshold value;

[0018] When the sum of the accumulated storage space occupancy values ​​exceeds the preset threshold, the most recently accumulated storage space occupancy value in the current sum of the storage space occupancy values ​​is deleted to obtain a critical value of the sum of the storage space occupancy values;

[0019] The first direction data blocks and the second direction data blocks corresponding to the added critical value are recombined to obtain a recombined file.

[0020] In some embodiments, the apparatus further comprises:

[0021] an occupancy value deleting unit, configured to delete the storage space occupancy value of the first second direction data block in the sum of the storage space occupancy values ​​when the sum of the storage space occupancy values ​​exceeds the preset threshold value, to obtain a critical value of the storage space occupancy value;

[0022] The reorganization file setting unit is configured to use the first first-direction data block as a reorganization file, wherein the storage space occupation value of the first first-direction data block is the critical value.

[0023] In some embodiments, the first direction is a direction in which the storage space occupancy values ​​of the multiple data blocks are from large to small, and the second direction is a direction in which the storage space occupancy values ​​of the multiple data blocks are from small to large.

[0024] In some embodiments, the apparatus further comprises:

[0025] The occupancy value determining unit is configured to determine that the storage space occupancy value of each data block in the plurality of data blocks is not greater than the preset threshold.

[0026] In some embodiments, the apparatus further comprises:

[0027] an occupancy value determining unit, configured to determine whether, among the plurality of data blocks, there is a data block whose storage space occupancy value is greater than the preset threshold;

[0028] A data block display unit is used to display data block information of data blocks whose storage space occupancy value is greater than the preset threshold when there are data blocks whose storage space occupancy value is greater than the preset threshold, so as to divide the data blocks whose storage space occupancy value is greater than the preset threshold into multiple data sub-blocks.

[0029] In some embodiments, the apparatus further comprises:

[0030] a data sub-block acquiring unit, configured to acquire the plurality of data sub-blocks;

[0031] The data block resetting unit is configured to use the data blocks whose storage space occupancy values ​​are not greater than the preset threshold value and the multiple data sub-blocks as new multiple data blocks.

[0032] In some embodiments, the apparatus further comprises:

[0033] The file segmentation unit is used to segment the data file according to target parameters of the data file to obtain multiple data blocks.

[0034] In some embodiments, the sequence acquisition unit is specifically configured to sort the multiple data blocks in descending order of storage space occupancy values.

[0035] An embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any one of the file reorganization methods provided in the embodiment of the present application.

[0036] In the file reorganization method provided in the embodiment of the present application, multiple data blocks obtained from a data file through segmentation processing can be obtained, and the multiple data blocks can be sorted to obtain a data block sequence; then two traversal directions of the data block sequence are obtained: a first direction and a second direction, and then the data block sequence is traversed according to the first direction and the second direction to obtain data blocks corresponding to the first direction and data blocks corresponding to the second direction, and then the multiple data blocks are reorganized based on the size relationship between the data blocks corresponding to the first direction and the data blocks corresponding to the second direction and a preset threshold.

[0037] In the present application, a data block sequence is obtained by sorting multiple data blocks, and then at least one data block is obtained from each end of the data block sequence. The data blocks obtained from both ends of the data block sequence are compared with a preset threshold value, so that the storage space occupied by the reorganized file is as close as possible to and does not exceed the preset threshold value. This situation can reduce the number of reorganized files, save resources, and reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1a A schematic diagram showing a process of a file reorganization method in the prior art is shown;

[0040] Figure 1b Schematic diagram of a scenario of a file reorganization method provided in an embodiment of the present application;

[0041] Figure 1c This is a flowchart of a file reorganization method provided in one embodiment of the present application;

[0042] Figure 1d This is a process diagram of the file reorganization method provided in an embodiment of the present application;

[0043] Figure 2 is a flowchart of a file reorganization method provided by another embodiment of the present application;

[0044] Figure 3 This is a structural diagram of a file reorganization device provided by an embodiment of the present application;

[0045] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] See Figure 1a , Figure 1a The figure shows an application scenario of an existing file reorganization method. In the prior art, for a Portable Document Format (PDF) file, the PDF file can be divided into multiple data blocks with the PDF page length as a fixed size, and each data block occupies a different storage space.

[0047] For more details, please see Figure 1a (1) The PDF file consists of 5 pages. Since each page contains different document contents, the storage space occupied by each page is different. The PDF file is split into 5 data blocks with the length of one page as the fixed size: data block a, data block b, data block c, data block d, and data block e. For details, see Figure 1a (2) Let us assume that the storage space occupied by data block a is 6, the storage space occupied by data block b is 4, the storage space occupied by data block c is 5, the storage space occupied by data block d is 3, the storage space occupied by data block e is 1, and the preset limit value is 8. The specific process of the existing file reorganization method is as follows:

[0048] In order from data block a to data block e, the values ​​of the storage space occupied by the data blocks are added together. The value of the storage space occupied by data block a: 6 and the value of the storage space occupied by data block b: 4 are added together, and the sum is 10. Since the sum 10 exceeds the preset limit value 8, the data block (i.e., data block b) that causes the storage space value to exceed the preset limit value is removed, and the remaining data block (i.e., data block a) is reorganized. At this time, data block a is the reorganized data block, and data blocks b, data blocks c, data blocks d, and data blocks e are the data blocks that have not been reorganized. Figure 1a (3) shown.

[0049] Then, starting from the last removed data block (i.e. data block b):

[0050] The value of the storage space occupied by data block b: 4 and the value of the storage space occupied by data block c: 5 are added together, and the sum is 9. Since the sum 9 exceeds the preset limit value 8, the data block (i.e., data block c) that causes the storage space value to exceed the preset limit value is removed, and the remaining data block (i.e., data block b) is reassembled. At this time, data blocks a and data block b are respectively reassembled data blocks, and data blocks c, data blocks d, and data blocks e are not reassembled data blocks. Figure 1a (4) shown.

[0051] Then, starting from the last removed data block (i.e. data block c):

[0052] The value of the storage space occupied by data block c: 5 and the value of the storage space occupied by data block d: 3 are added to obtain a sum of 8; since the sum 8 does not exceed the preset limit value 8, the value of the storage space occupied by the next data block (i.e., data block e): 1 is added to the above sum 8 to obtain a new sum of (5+3+1=)9; since the new sum 9 exceeds the preset limit value 8, the data block (i.e., data block e) that causes the value of the storage space to exceed the preset limit value is removed, and the remaining data blocks (i.e., data block c and data block d) are reorganized. At this time, data block a, data block b, data block c, and data block d are data blocks that have been reorganized, and the obtained reorganized files are: a reorganized file consisting of data block a alone, a reorganized file consisting of data block b alone, and a reorganized file consisting of data block c and data block d together; data block e is a data block that has not been reorganized, as shown in FIG. Figure 1a As shown in (5), since data block e is the only data block that has not been reassembled and there are no other data blocks that can be reassembled, data block e alone constitutes a reassembled file.

[0053] As can be seen from the above description, in the existing file reorganization method, there may be a situation where the value of the storage space occupied by the individually reorganized data blocks is far lower than the preset limit value. For example, the reorganized file composed of data block b alone and the reorganized file composed of data block e alone, resulting in a large number of reorganized files. When scanning or identifying the reorganized files, each additional processing will increase the processing cost and take more processing time, resulting in a waste of resources and an increase in costs.

[0054] The problems existing in the above-mentioned existing file reorganization methods were discovered by the inventors after making creative efforts.

[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0056] Embodiments of the present application provide a file reorganization method, device, electronic device, and storage medium.

[0057] The file reorganization device can be integrated into an electronic device, such as a terminal, a server, or the like. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC); the server can be a single server or a server cluster consisting of multiple servers.

[0058] In some embodiments, the file reorganization device may also be integrated into multiple electronic devices. For example, the file reorganization device may be integrated into multiple servers, and the file reorganization method of the present application may be implemented by multiple servers.

[0059] In some embodiments, the server may also be implemented in the form of a terminal.

[0060] For example, reference Figure 1b , obtaining a plurality of data blocks, wherein the plurality of data blocks are obtained by segmenting a data file; sorting the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, and the first direction is opposite to the second direction; reorganizing the plurality of data blocks according to the first direction, the data blocks traversed in the first direction, the second direction, the data blocks traversed in the second direction, and a preset threshold value to obtain a plurality of reorganized files, wherein the preset threshold value is an upper limit value of the amount of data that can be processed by a single scanning process or recognition process.

[0061] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0062] In this embodiment, a file reorganization method is provided, such as Figure 1c As shown, the file reorganization method is applied in a terminal, and the specific process of the method may be as follows: Step 101 to Step 103:

[0063] 101. Acquire multiple data blocks, where the multiple data blocks are obtained by segmenting a data file.

[0064] A data file is an electronic file that can be displayed on a display screen of an electronic device. For example, a data file can be a PDF file, a Word document file, a PowerPoint file, etc. For ease of description, the following description will take the data file being a PDF file as an example.

[0065] A data file typically includes multiple pages of data content. The data file can be segmented based on the number of pages in the data file, thereby obtaining multiple data blocks. Alternatively, the data file can be segmented based on the size of a full page of the data file, thereby obtaining multiple data blocks, each corresponding to the content of a page in the data file. Alternatively, the data file can be segmented based on the size of a half page of the data file, thereby obtaining multiple data blocks, each corresponding to the content of a half page in the data file. It should be understood that the segmentation unit for segmenting the data file should not be construed as limiting the present application.

[0066] Although the data file is segmented according to the same segmentation unit to obtain multiple data blocks, since the amount of data presented on each page in the data file is different, the storage space occupied by each data block obtained by segmentation may be different, that is, the storage space occupancy value corresponding to each data block may be different.

[0067] Optionally, before step 101, the method provided in the embodiment of the present application may further include the following steps: segmenting the data file according to target parameters of the data file to obtain multiple data blocks.

[0068] The target parameter is a fixed size for dividing the above data file. As mentioned above, the fixed size can be a full page size of a data file or a half page size of a data file.

[0069] 102. Sort the multiple data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, and the first direction is opposite to the second direction.

[0070] The data blocks can be sorted according to a preset rule. The preset rule is a pre-set rule. The preset rule can be based on the descending order of the storage space occupied value corresponding to each data block, or it can be based on the ascending order of the storage space occupied value corresponding to each data block. For ease of description, the following may take the descending order of storage space occupied value as an example:

[0071] The data block sequence can be a sequence obtained by sorting the data blocks in descending order of storage space occupancy values. The data block sequence has two ends: a first end and a second end. When traversing the data block sequence, the traversal can be performed in the direction from the first end to the second end, or in the direction from the second end to the first end. Let the first end be the end with the largest storage space occupancy value in the data block sequence, and the second end be the end with the smallest storage space occupancy value in the data block sequence; and the direction from the first end to the second end is the first direction, and the direction from the second end to the first end is the second direction, then the first direction is the direction of the storage space occupancy values ​​of the multiple data blocks from large to small, and the second direction is the direction of the storage space occupancy values ​​of the multiple data blocks from small to large.

[0072] 103. Reorganize the multiple data blocks to obtain multiple reorganized files according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold.

[0073] The preset threshold is the upper limit of the reorganized file. Since the reorganized file will be subjected to subsequent operations such as scanning or recognition processing, the preset threshold here can specifically be the upper limit of the amount of data that can be processed by one scanning or recognition processing.

[0074] In an embodiment of the present application, after sorting multiple data blocks to obtain a data block sequence, traversal can be performed along both ends of the data block sequence to obtain at least one data block respectively, and the obtained data blocks are compared with a preset threshold value, so that the storage space occupied by the reorganized file is as close as possible to the preset threshold value and does not exceed the preset threshold value. Since the storage space occupied by the reorganized file can be made as close as possible to and does not exceed the preset threshold value, the number of reorganized files can be reduced, thereby reducing the number of reorganizations, saving resources and reducing costs. At the same time, since subsequent processing processes such as scanning processing or recognition processing require a subsequent processing time and consume a subsequent processing cost each time a subsequent processing process is performed, reducing the number of reorganized files can also reduce the number of subsequent processing times, further reducing costs.

[0075] Optionally, in a specific implementation, step 103 specifically includes the following steps 1031 to 1036:

[0076] 1031. For the data block sequence, obtain a first unreorganized first-direction data block obtained by traversing along the first direction, and obtain a first unreorganized second-direction data block obtained by traversing along the second direction.

[0077] The first-direction data blocks are data blocks obtained by traversing the data block sequence along the first direction, and the second-direction data blocks are data blocks obtained by traversing the data block sequence along the second direction.

[0078] In the above steps, each time the first direction data block is obtained by traversing along the first direction, and each time the second direction data block is obtained by traversing along the second direction, the data blocks obtained are all unrecombined data blocks.

[0079] For example, when traversing the data block sequence along the first direction, if the obtained first direction data block is a reassembled data block, the data block is skipped and traversal continues along the first direction until an unreassembled first direction data block is traversed.

[0080] When traversing the data block sequence along the second direction, if the obtained second direction data block is a reassembled data block, skip the data block and continue traversing along the second direction until an unreassembled second direction data block is traversed.

[0081] 1032. Calculate a sum of storage space occupancy values ​​of the first first-direction data block and the first second-direction data block, and compare the sum of storage space occupancy values ​​with a preset threshold.

[0082] Continuing with the example above, the explanation is as follows: since the first direction is the direction of the storage space occupancy value of the data block sequence from large to small, and the second direction is the direction of the storage space occupancy value of the data block sequence from small to large, the first first-direction data block is the data block with the largest storage space occupancy value among the unreorganized data blocks of the current data block sequence, and the first second-direction data block is the data block with the smallest storage space occupancy value among the unreorganized data blocks of the current data block sequence.

[0083] The sum of the storage space occupancy values ​​of the first first-direction data block and the first second-direction data block is calculated and compared with a preset threshold to determine whether the first first-direction data block and the first second-direction data block can be reassembled. If the sum of the storage space occupancy values ​​exceeds the preset threshold, step 10321 is executed. If the sum of the storage space occupancy values ​​does not exceed the preset threshold, step 1033 is executed.

[0084] Step 10321: If the sum of the storage space occupancy values ​​exceeds the preset threshold, the storage space occupancy value of the first second direction data block in the sum of the storage space occupancy values ​​is deleted to obtain a critical value of the storage space occupancy value; the first first direction data block is used as a reorganized file, wherein the storage space occupancy value of the first first direction data block is the critical value.

[0085] If the first direction data block cannot be reassembled with the data block with the smallest storage space occupancy value among the unreassembled data blocks in the current data block sequence, it means that the first direction data block cannot be reassembled with other unreassembled data blocks in the current data block sequence.

[0086] Therefore, the first first-direction data block at this time can be used as a reorganized file alone, and the storage space occupancy value of the first first-direction data block is the critical value of the storage space occupancy value, that is, in the sum of the storage space occupancy values ​​of the first first-direction data block and the first second-direction data block, the storage space occupancy value of the first second-direction data block is deleted, and only the storage space occupancy value of the first first-direction data block is retained.

[0087] 1033. If the sum of the storage space occupancy values ​​does not exceed the preset threshold, obtain the next unreorganized second direction data block obtained by traversing along the second direction.

[0088] If the sum of the storage space occupancy values ​​does not exceed the preset threshold, it means that the first first-direction data block and the first second-direction data block that constitute the sum of the storage space occupancy values ​​can be reorganized. At this time, the next unreorganized second-direction data block can be obtained, so as to determine whether, under the premise that the first first-direction data block and the first second-direction data block can be reorganized, they can also be reorganized with the unreorganized second second-direction data block.

[0089] 1034. Accumulate the storage space occupancy value of the second direction data block and the sum of the storage space occupancy values ​​to obtain a new storage space occupancy value sum, and jump to the step of "comparing the storage space occupancy value sum with a preset threshold" in step 1032 until the accumulated storage space occupancy value sum exceeds the preset threshold.

[0090] Continue to traverse the second direction data blocks along the second direction, and add the storage space occupancy values ​​of the traversed second direction data blocks to the sum of the storage space occupancy values ​​to obtain a new sum of the storage space occupancy values, and jump to "comparing the sum of the storage space occupancy values ​​with the preset threshold" to determine whether the new sum of the storage space occupancy values ​​exceeds the preset threshold, so as to further determine whether the number of second direction data blocks contained in the reorganized file can be increased, until the accumulated sum of the storage space occupancy values ​​exceeds the preset threshold.

[0091] 1035. When the sum of the accumulated storage space occupancy values ​​exceeds the preset threshold, the most recently accumulated storage space occupancy value in the current sum of the storage space occupancy values ​​is deleted to obtain a critical value of the sum of the storage space occupancy values.

[0092] Each time the storage space occupancy value corresponding to a new second-direction data block is accumulated and the new storage space occupancy value is summed up, the storage space occupancy value sum will be compared with the preset threshold. Therefore, when the accumulated storage space occupancy value sum exceeds the preset threshold, it means that it is the accumulation of the storage space occupancy value corresponding to the latest second-direction data block that causes the storage space occupancy value sum to exceed the preset threshold.

[0093] Therefore, by deleting the latest accumulated storage space occupancy value in the sum of the current storage space occupancy values, a storage space occupancy value close to the preset threshold and not exceeding the preset threshold can be obtained, and this storage space occupancy value is recorded as the sum critical value.

[0094] 1036. Recombine the first direction data blocks and the second direction data blocks corresponding to the added critical value to obtain a recombined file.

[0095] The first direction data blocks and the second direction data blocks constituting the added critical value are data blocks that can be reassembled into a reassembled file.

[0096] See Figure 1d , let's take the preset threshold value of 8 as an example to illustrate the above steps 1031 to 1036:

[0097] Figure 1d (1) and Figure 1d (2) shows the process of dividing a PDF file into five data blocks: data block a, data block b, data block c, data block d, and data block e. This process is similar to Figure 1a (1) to Figure 1a The process of (2) is the same and will not be described here.

[0098] like Figure 1d As shown in (3), the five data blocks mentioned above can be sorted in descending order of storage space occupancy value, thereby obtaining a data block sequence: data block a - data block c - data block b - data block d - data block e.

[0099] For the above data block sequence, traverse along the first direction to obtain the first unreorganized first direction data block: data block a, traverse along the second direction to obtain the first unreorganized second direction data block: data block e, and calculate the sum of the storage space occupancy values ​​of data block a and data block e to obtain the sum of the storage space occupancy values ​​6+1=7.

[0100] The sum of the storage space occupancy values ​​at this point, 7, is compared with the preset threshold value 8. If the sum is less than the preset threshold, it means that data blocks a and e can be reassembled. At this point, based on the assumption that data blocks a and e can be reassembled, traversal continues in the second direction to obtain the next unreassembled second-direction data block, data block d. The sum of the storage space occupancy values ​​of data blocks a and e is then added to the storage space occupancy value of data block d to obtain a new sum of storage space occupancy values ​​of (6 + 1) + 3 = 10.

[0101] The sum of the storage space usage values ​​at this time, 10, is compared with the preset threshold value of 8. If the sum of the storage space usage values ​​exceeds the preset threshold value, it means that the storage space usage value of the most recently accumulated data block, data block d, causes the sum of the storage space usage values ​​to exceed the preset threshold value. Therefore, the storage space usage value of data block d is deleted. The sum of the remaining storage space usage values, 6+1=7, is the sum critical value. The data blocks that constitute this sum critical value, data blocks a and e, can be reassembled to obtain the first reassembled file. For details, see Figure 1d (4).

[0102] Continue traversing along the first direction to obtain the first unreorganized first direction data block: data block c, continue traversing along the second direction to obtain the first unreorganized second direction data block: data block d, and calculate the sum of the storage space occupancy values ​​of data block c and data block d to obtain the sum of the storage space occupancy values ​​5+3=8.

[0103] The sum of the storage space occupancy values ​​at this point, 8, is compared with the preset threshold value 8. If the sum of the storage space occupancy values ​​is equal to the preset threshold value, i.e., the sum of the storage space occupancy values ​​does not exceed the preset threshold value, then data blocks c and d can be reassembled. At this point, based on the assumption that data blocks c and d can be reassembled, traversal continues in the second direction to obtain the next unreassembled second-direction data block: data block b. The sum of the storage space occupancy values ​​of data blocks c and d is then added to the storage space occupancy value of data block b, resulting in a new sum of the storage space occupancy values ​​(5 + 3) + 4 = 12.

[0104] The sum of the storage space usage values ​​at this time, 12, is compared with the preset threshold value of 8. If the sum of the storage space usage values ​​exceeds the preset threshold, it means that the storage space usage value of the most recently accumulated data block, data block b, has caused the sum of the storage space usage values ​​to exceed the preset threshold. Therefore, the storage space usage value of data block b is deleted. The sum of the remaining storage space usage values, 5+3=8, is the sum threshold value. The data blocks that form this sum threshold value, data blocks c and d, can be reassembled to obtain the second reassembled file. For details, see Figure 1d (5).

[0105] At this time, since there is only one data block left: data block b, data block b is reassembled as a reassembled file to obtain the third reassembled file. Figure 1d and Figure 1a By comparison, it can be clearly concluded that the file reorganization method provided by the embodiment of the present application can reduce the number of reorganized files.

[0106] In the above embodiment, after sorting a plurality of data blocks in descending order according to their storage space occupancy values, a data block sequence is obtained. For the unreorganized data blocks in the data block sequence, by traversing in two directions, the data block with the largest storage space occupancy value and the data block with the smallest storage space occupancy value in the unreorganized data blocks are obtained, and the sum of the two is calculated. If the sum of the two does not exceed the preset threshold, it means that the two can be reorganized; on this basis, the data block with the second smallest storage space occupancy value, the data block with the third smallest storage space occupancy value... can be accumulated until the sum of the multiple exceeds the preset threshold. When the sum exceeds the preset threshold, the storage space occupancy value of the most recently accumulated data block that causes the sum to exceed the preset threshold is deleted, and the remaining sum is the sum critical value that is close to and does not exceed the preset threshold, and the multiple data blocks that constitute the sum critical value can be reorganized into a reorganized file. The above embodiment can make the storage space occupancy value corresponding to the reorganized file as close to the preset threshold as possible and not exceed the preset threshold, thereby reducing the number of reorganized files.

[0107] Optionally, in a specific implementation, between step 101 and step 102, the method provided in the embodiment of the present application may further include: determining that the storage space occupancy value of each data block in the multiple data blocks is not greater than the preset threshold.

[0108] Before executing step 102, it can be determined that the storage space occupied by each data block is not greater than the preset threshold, so that it can be determined that a single data block does not exceed the preset threshold, avoiding data omission caused by a single data block exceeding the preset threshold.

[0109] Optionally, in another specific implementation, between step 101 and step 102, the method provided in the embodiment of the present application may further include the following steps S1 to S4:

[0110] S1. Determine whether there is a data block among the multiple data blocks whose storage space occupancy value is greater than the preset threshold. If so, execute step S2.

[0111] S2. Displaying data block information of data blocks whose storage space occupancy values ​​are greater than the preset threshold, so as to divide the data blocks whose storage space occupancy values ​​are greater than the preset threshold into multiple data sub-blocks.

[0112] After multiple data blocks are divided, the corresponding storage space occupancy value of each data block can be compared with a preset threshold; data blocks whose storage space occupancy values ​​are greater than the preset threshold are obtained from the multiple data blocks, and the data block information of these data blocks is displayed so that these data blocks can be manually or automatically divided, thereby obtaining multiple data sub-blocks.

[0113] S3. Acquire the multiple data sub-blocks.

[0114] S4. Take the data blocks whose storage space occupancy values ​​are not greater than the preset threshold among the multiple data blocks and the multiple data sub-blocks as new multiple data blocks.

[0115] The above-mentioned data sub-block is obtained, and the data sub-block and a data block whose storage space occupancy value is not greater than the preset threshold among the multiple data blocks are collectively used as a new data block.

[0116] Through the above steps S1 to S4, a data block whose storage space occupancy value is greater than the preset threshold can be processed into multiple data sub-blocks, and a data block whose storage space occupancy value is greater than the preset threshold in the multiple data blocks is replaced by the multiple data sub-blocks, thereby forming multiple new data blocks. The above method can avoid the occurrence of data blocks whose storage space occupancy value is greater than the preset threshold in the multiple data blocks, thereby improving the scope of application of the data reorganization method provided in the embodiment of the present application.

[0117] The method described in the above embodiment will be further described below.

[0118] In this embodiment, the method of the embodiment of the present application will be described in detail by taking the data file being a PDF file as an example.

[0119] like Figure 2 As shown, the specific process of a file reorganization method is as follows:

[0120] 201. According to the fixed page length of the PDF file, the PDF file is segmented to obtain multiple data blocks.

[0121] 202. Sort the multiple data blocks according to the order of storage space occupation values ​​corresponding to the data blocks from large to small to obtain a sorted data block sequence.

[0122] 203. For the data block sequence, obtain the first unreorganized descending data block obtained by traversing along the descending direction of the storage space occupancy value, and obtain the first unreorganized ascending data block obtained by traversing along the ascending direction of the storage space occupancy value.

[0123] 204. Calculate the sum of the storage space occupancy values ​​of the first descending data block and the first ascending data block, and compare the sum of the storage space occupancy values ​​with a preset threshold.

[0124] 205. If the sum of the storage space occupancy values ​​exceeds a preset threshold, the storage space occupancy value of the first ascending data block in the sum of the storage space occupancy values ​​is deleted to obtain a critical value of the storage space occupancy value; the first descending data block is used as a reorganized file, wherein the storage space occupancy value of the first descending data block is the above-mentioned critical value.

[0125] 206. If the sum of the storage space occupancy values ​​does not exceed the preset threshold, obtain the next unreorganized ascending data block obtained by traversing along the ascending direction.

[0126] 207. Accumulate the storage space occupancy value of the ascending data block and the sum of the storage space occupancy values ​​to obtain a new sum of the storage space occupancy value, and jump to the step of "comparing the sum of the storage space occupancy values ​​with a preset threshold" in step 204 until the accumulated sum of the storage space occupancy values ​​exceeds the preset threshold.

[0127] 208. When the sum of the accumulated storage space occupancy values ​​exceeds the preset threshold, the most recently accumulated storage space occupancy value in the current sum of the storage space occupancy values ​​is deleted to obtain a critical value of the sum of the storage space occupancy values.

[0128] 209. Reorganize the descending order data blocks and the ascending order data blocks corresponding to the added critical value to obtain a reorganized file.

[0129] As can be seen from the above, for the unreorganized data blocks in the data block sequence, by traversing in two directions, the data block with the largest storage space occupancy value and the data block with the smallest storage space occupancy value in the unreorganized data blocks are obtained, and the sum of the two is calculated. If the sum of the two does not exceed the preset threshold, it means that the two can be reorganized; on this basis, the data block with the second smallest storage space occupancy value, the data block with the third smallest storage space occupancy value... can be accumulated until the sum of the multiple exceeds the preset threshold. When the sum exceeds the preset threshold, the storage space occupancy value of the most recently accumulated data block that causes the sum to exceed the preset threshold will be deleted, and the remaining sum value is the sum critical value that is close to and does not exceed the preset threshold, and the multiple data blocks that make up the sum critical value can be reorganized into a reorganized file. The above embodiment can make the storage space occupancy value corresponding to the reorganized file as close to the preset threshold as possible and not exceed the preset threshold, thereby reducing the number of reorganized files.

[0130] To better implement the above method, the present application also provides a file reorganization device, which can be integrated into an electronic device, such as a terminal. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, or other device.

[0131] For example, in this embodiment, the method of the embodiment of the present application will be described in detail by taking the file reorganization device specifically integrated into the terminal as an example.

[0132] For example, Figure 3 As shown, the file reorganization device may include:

[0133] The data block acquisition unit 301 is configured to acquire a plurality of data blocks, wherein the plurality of data blocks are obtained by segmenting a data file.

[0134] The sequence acquisition unit 302 is configured to sort the multiple data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, and the first direction is opposite to the second direction.

[0135] The data block reassembly unit 303 is configured to reassemble the multiple data blocks to obtain multiple reassembled files according to the first direction, the data blocks traversed in the first direction, the second direction, the data blocks traversed in the second direction, and a preset threshold.

[0136] In some embodiments, the data block reassembling unit 303 is specifically configured to obtain, for the data block sequence, a first unreassembled first direction data block obtained by traversing along the first direction, and obtain a first unreassembled second direction data block obtained by traversing along the second direction;

[0137] Calculating a sum of storage space occupancy values ​​of the first first-direction data block and the first second-direction data block, and comparing the sum of the storage space occupancy values ​​with a preset threshold;

[0138] If the sum of the storage space occupancy values ​​does not exceed the preset threshold, obtaining the next unreorganized second direction data block obtained by traversing along the second direction;

[0139] Accumulating the storage space occupancy value of the data block in the second direction and the sum of the storage space occupancy values ​​to obtain a new sum of the storage space occupancy value, and performing the step of "comparing the sum of the storage space occupancy values ​​with a preset threshold value" until the accumulated sum of the storage space occupancy values ​​exceeds the preset threshold value;

[0140] When the sum of the accumulated storage space occupancy values ​​exceeds the preset threshold, the most recently accumulated storage space occupancy value in the current sum of the storage space occupancy values ​​is deleted to obtain a critical value of the sum of the storage space occupancy values;

[0141] The first direction data blocks and the second direction data blocks corresponding to the added critical value are recombined to obtain a recombined file.

[0142] In some embodiments, the apparatus further comprises:

[0143] an occupancy value deleting unit, configured to delete the storage space occupancy value of the first second direction data block in the sum of the storage space occupancy values ​​when the sum of the storage space occupancy values ​​exceeds the preset threshold value, to obtain a critical value of the storage space occupancy value;

[0144] The reorganization file setting unit is configured to use the first first-direction data block as a reorganization file, wherein the storage space occupation value of the first first-direction data block is the critical value.

[0145] In some embodiments, the first direction is a direction in which the storage space occupancy values ​​of the multiple data blocks are from large to small, and the second direction is a direction in which the storage space occupancy values ​​of the multiple data blocks are from small to large.

[0146] In some embodiments, the apparatus further comprises:

[0147] The occupancy value determining unit is configured to determine that the storage space occupancy value of each data block in the plurality of data blocks is not greater than the preset threshold.

[0148] In some embodiments, the apparatus further comprises:

[0149] an occupancy value determining unit, configured to determine whether, among the plurality of data blocks, there is a data block whose storage space occupancy value is greater than the preset threshold;

[0150] A data block display unit is used to display data block information of data blocks whose storage space occupancy value is greater than the preset threshold when there are data blocks whose storage space occupancy value is greater than the preset threshold, so as to divide the data blocks whose storage space occupancy value is greater than the preset threshold into multiple data sub-blocks.

[0151] In some embodiments, the apparatus further comprises:

[0152] a data sub-block acquiring unit, configured to acquire the plurality of data sub-blocks;

[0153] The data block resetting unit is configured to use the data blocks whose storage space occupancy values ​​are not greater than the preset threshold value and the multiple data sub-blocks as new multiple data blocks.

[0154] In some embodiments, the apparatus further comprises:

[0155] The file segmentation unit is used to segment the data file according to target parameters of the data file to obtain multiple data blocks.

[0156] In some embodiments, the sequence acquisition unit 302 is specifically configured to sort the multiple data blocks in descending order of storage space occupancy values.

[0157] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can be found in the previous method embodiments and will not be repeated here.

[0158] As can be seen from the above, this embodiment obtains a data block sequence after sorting multiple data blocks in descending order according to the storage space occupancy value. For the unreorganized data blocks in the data block sequence, by traversing in two directions, the data block with the largest storage space occupancy value and the data block with the smallest storage space occupancy value in the unreorganized data blocks are obtained, and the sum of the two is calculated. If the sum of the two does not exceed the preset threshold, it means that the two can be reorganized; on this basis, the data block with the second smallest storage space occupancy value, the data block with the third smallest storage space occupancy value... can be accumulated until the sum of the multiple exceeds the preset threshold. When the sum exceeds the preset threshold, the storage space occupancy value of the most recently accumulated data block that causes the sum to exceed the preset threshold will be deleted, and the remaining sum value is the sum critical value that is close to and does not exceed the preset threshold, and the multiple data blocks that make up the sum critical value can be reorganized into a reorganized file. The above embodiment can make the storage space occupancy value corresponding to the reorganized file as close to the preset threshold as possible and not exceed the preset threshold, thereby reducing the number of reorganized files.

[0159] The present application also provides an electronic device, which may be a terminal, a server, or the like. The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer, or the like; the server may be a single server or a server cluster consisting of multiple servers, or the like.

[0160] In some embodiments, the file reorganization device may also be integrated into multiple electronic devices. For example, the file reorganization device may be integrated into multiple servers, and the file reorganization method of the present application may be implemented by multiple servers.

[0161] In this embodiment, the electronic device of this embodiment is an electronic device as an example for detailed description, for example, Figure 4 , which shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0162] The electronic device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.

[0163] Processor 401 is the control center of the electronic device, connecting all components of the electronic device using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 402 and accessing data stored in memory 402, it performs various functions of the electronic device and processes data, thereby providing overall monitoring of the electronic device. In some embodiments, processor 401 may include one or more processing cores. In some embodiments, processor 401 may integrate an application processor and a modem processor, where the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.

[0164] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly 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 (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0165] The electronic device also includes a power supply 403 for supplying power to various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0166] The electronic device may further include an input module 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0167] The electronic device may further include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The electronic device may perform short-range wireless transmission via the wireless module of the communication module 405, thereby providing the user with wireless broadband Internet access. For example, the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.

[0168] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:

[0169] Acquire a plurality of data blocks, wherein the plurality of data blocks are obtained by segmenting a data file; sort the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, the first direction being opposite to the second direction; and reassemble the plurality of data blocks according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold value to obtain a plurality of reassembled files.

[0170] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0171] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0172] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute the steps of any of the file reorganization methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0173] Acquire a plurality of data blocks, wherein the plurality of data blocks are obtained by segmenting a data file; sort the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, the first direction being opposite to the second direction; and reassemble the plurality of data blocks according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold value to obtain a plurality of reassembled files.

[0174] The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0175] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations provided in the above embodiments.

[0176] Since the instructions stored in the storage medium can execute the steps in any file reorganization method provided in the embodiments of the present application, the beneficial effects that can be achieved by any file reorganization method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0177] The above is a detailed introduction to a file reorganization method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, based on the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A file reorganization method, characterized in that: The method comprises: Acquire multiple data blocks, wherein the multiple data blocks are obtained by segmenting a data file; Sorting the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, and the first direction is opposite to the second direction; Recombining the plurality of data blocks to obtain a plurality of recombined files according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold, wherein the preset threshold is an upper limit of the amount of data that can be processed by a single scanning process or recognition process; The data block sequence is a sequence obtained by sorting the data blocks in descending or ascending order of storage space occupancy values; The reorganizing the plurality of data blocks according to the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold comprises: For the data block sequence, sequentially accumulating a first unreorganized first-direction data block obtained by traversing along the first direction and a plurality of unreorganized second-direction data blocks obtained by traversing along the second direction to obtain a sum of a plurality of storage space occupancy values; Reorganize multiple data blocks corresponding to a critical sum value in the sum of the multiple storage space occupancy values ​​to obtain the reorganized file, wherein the critical sum value is the maximum sum of the storage space occupancy values ​​in the sum of the multiple storage space occupancy values ​​that does not exceed a preset threshold.

2. The method according to claim 1, wherein The step of reorganizing the plurality of data blocks corresponding to the critical sum of the sum of the plurality of storage space occupancy values ​​to obtain the reorganized file includes: For the data block sequence, obtaining a first unrecombined first direction data block obtained by traversing along the first direction, and obtaining a first unrecombined second direction data block obtained by traversing along the second direction; Calculating a sum of storage space occupancy values ​​of the first first-direction data block and the first second-direction data block, and comparing the sum of the storage space occupancy values ​​with a preset threshold; If the sum of the storage space occupancy values ​​does not exceed the preset threshold, obtaining the next unreorganized second direction data block obtained by traversing along the second direction; Accumulating the storage space occupancy value of the data block in the second direction and the sum of the storage space occupancy values ​​to obtain a new sum of the storage space occupancy values, and performing the step of "comparing the sum of the storage space occupancy values ​​with a preset threshold value" until the accumulated sum of the storage space occupancy values ​​exceeds the preset threshold value; When the sum of the accumulated storage space occupancy values ​​exceeds the preset threshold, the most recently accumulated storage space occupancy value in the current sum of the storage space occupancy values ​​is deleted to obtain a critical value of the sum of the storage space occupancy values; The first direction data blocks and the second direction data blocks corresponding to the added critical value are recombined to obtain a recombined file.

3. The method according to claim 2, wherein After calculating the sum of the storage space occupancy values ​​of the first first-direction data block and the first second-direction data block, and comparing the sum of the storage space occupancy values ​​with a preset threshold, the method further includes: If the sum of the storage space occupancy values ​​exceeds the preset threshold, deleting the storage space occupancy value of the first second direction data block in the sum of the storage space occupancy values ​​to obtain a critical value of the storage space occupancy value; The first first-directional data block is used as a reorganized file, wherein the storage space occupation value of the first first-directional data block is the critical value.

4. The method according to any one of claims 1 to 3, wherein The first direction is a direction in which the storage space occupancy values ​​of the multiple data blocks are from large to small, and the second direction is a direction in which the storage space occupancy values ​​of the multiple data blocks are from small to large.

5. The method according to claim 1, wherein After acquiring the plurality of data blocks and before sorting the plurality of data blocks to obtain a sorted data block sequence, the method further includes: It is determined that the storage space occupancy value of each data block in the plurality of data blocks is not greater than the preset threshold.

6. The method according to claim 1, wherein After acquiring the plurality of data blocks and before sorting the plurality of data blocks to obtain a sorted data block sequence, the method further includes: Determining whether there is a data block among the multiple data blocks whose storage space occupancy value is greater than the preset threshold; If so, data block information of the data blocks whose storage space occupancy value is greater than the preset threshold is displayed, so as to divide the data blocks whose storage space occupancy value is greater than the preset threshold into multiple data sub-blocks.

7. The method according to claim 6, wherein After displaying the data block information of the data blocks whose storage space occupancy value is greater than the preset threshold, the method further includes: Acquire the multiple data sub-blocks; The data blocks whose storage space occupancy values ​​are not greater than the preset threshold value among the multiple data blocks and the multiple data sub-blocks are collectively used as multiple new data blocks.

8. The method according to claim 1, wherein Before acquiring the plurality of data blocks, the method further includes: According to the target parameters of the data file, the data file is segmented to obtain a plurality of data blocks.

9. The method according to claim 1, wherein The sorting of the plurality of data blocks comprises: The multiple data blocks are sorted in descending order according to the storage space occupancy values.

10. A file reorganization device, characterized in that: The device comprises: A data block acquisition unit, configured to acquire a plurality of data blocks, wherein the plurality of data blocks are obtained by segmenting a data file; a sequence acquisition unit, configured to sort the plurality of data blocks to obtain a sorted data block sequence, wherein a traversal direction of the data block sequence includes a first direction and a second direction, the first direction being opposite to the second direction; a data block reassembly unit, configured to reassemble the plurality of data blocks to obtain a plurality of reassembled files based on the first direction, the data blocks obtained by traversing the first direction, the second direction, the data blocks obtained by traversing the second direction, and a preset threshold, wherein the preset threshold is an upper limit of the amount of data that can be processed by a single scanning process or recognition process; The data block sequence is a sequence obtained by sorting the data blocks in descending or ascending order of storage space occupancy values; The data block reassembly unit is further configured to: For the data block sequence, sequentially accumulating a first unreorganized first-direction data block obtained by traversing along the first direction and a plurality of unreorganized second-direction data blocks obtained by traversing along the second direction to obtain a sum of a plurality of storage space occupancy values; Reorganize multiple data blocks corresponding to a critical sum value in the sum of the multiple storage space occupancy values ​​to obtain the reorganized file, wherein the critical sum value is the maximum sum of the storage space occupancy values ​​in the sum of the multiple storage space occupancy values ​​that does not exceed a preset threshold.

11. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the file reorganization method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the file reorganization method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data processing method and device based on big data

    CN110321329A

  • File transmission method, device and equipment

    CN112291341A