A method for removing duplicates from derived data
By processing the target resource package and constructing the structure tree, the problem of low deduplication efficiency of derived data in the existing technology is solved, resource saving and malicious file identification are achieved, and data processing efficiency and storage space utilization are improved.
Patent Information
- Application Number
- CN202111657638.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-31
AI Technical Summary
When the existing technology processes derived data, the efficiency of dismantling duplicate files is low, resulting in a waste of storage space and difficulty in detecting malicious files. Especially when there are many layers of nested files, it results in a waste of resources and long detection time.
By processing the target resource package, obtain the initial file list and derived file list, calculate the identification vector and similarity list, determine whether the file needs to be further split, form a structure tree, avoid repeated splitting and resource occupation, and improve data processing efficiency.
It effectively avoids the waste of storage space, improves data processing efficiency, can identify malicious files in a timely manner, and monitors the data splitting system to alert of abnormal situations.
Smart Images

Figure CN114297653B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer security technology, and in particular to a method for deduplicating derivative data. Background Art
[0002] With the development of computer technology, electronic documents are very common in real life. Most offices adopt paperless office. Document files can be viewed directly on mobile phones or laptops. They are easy to carry and no longer require a large number of books. However, there are a large number of duplicate files in some documents, which leads to a waste of storage space. There are also malicious files in some files. Malicious files will occupy unlimited storage space during the parsing process, which brings a lot of trouble when viewing or processing files.
[0003] In the current method of processing duplicate derived data, files are continuously disassembled to obtain duplicate files. However, when the number of duplicate files is large or malicious files continue to occupy storage space, the efficiency of detecting duplicate files is reduced and a large amount of time is spent. When the disassembly time reaches the preset time, the file disassembly is stopped, resulting in the malicious files not being detected. If the number of nested layers of files is large, the number of files that increases exponentially is quite large, thereby wasting huge space resources. Summary of the invention
[0004] In view of the above technical problems, the technical solution adopted by the present invention is:
[0005] A method for deduplicating derived data includes the following steps:
[0006] S100, process the target resource package and obtain the initial file list A corresponding to the target resource package = {A1, A2, ..., A m}, A i It refers to the i-th initial file, i=1…m, m is the number of initial files;
[0007] S200, get A i The corresponding format and according to A i The corresponding format is to obtain A i Corresponding derivative file list A i '={A i1 , A i2 , ..., A in}, where A ij refers to the jth derivative file, j = 1...n, n is the number of derivative files;
[0008] S300, get A ij The corresponding identity vector (A 1 ij , A 2ij , ..., A s ij ), where A r ij A ij The rth bit value in the corresponding identification vector, r = 1...s, s is the number of bits in the identification vector;
[0009] S400, based on A ij The corresponding identification vector and any key identification vector in the key identification set, obtain A ij The corresponding similarity list F ij =(F 1 ij , F 2 ij , ..., F z ij ), F x ij A ij The similarity between the corresponding identification vector and the xth key identification vector, x=1...z, z=n-1;
[0010] S500, according to F x ij , get A i The corresponding first-class derivative files and A i The corresponding second type of derivative files and A ij The corresponding first-class derivative files and A ij The corresponding second-category derivative files are processed separately;
[0011] S600, repeat steps S200-S500 until A i All derivative files at any level in the corresponding data structure are second-class derivative files. i The corresponding target structure tree.
[0012] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the deduplication method of derivative data provided by the present invention can achieve considerable technical advancement and practicality, and has a wide range of utilization value, and has at least the following advantages:
[0013] The present invention provides a method for deduplicating derivative data. By comparing the similarity between any derivative file and other derivative files in each level of the structure tree, it is determined whether the derivative file needs to be further split. This can avoid the situation where a large number of duplicate derivative files are split into files, which affects the use of storage space and reduces the efficiency of space use.
[0014] At the same time, the total time required for data processing to any level in the structure tree is used to determine whether the file should be further split to avoid occupying more resources due to a large number of derivative files, improve data processing effects, and meet the processing needs of more files.
[0015] In addition, through the similarity judgment of derivative files, it is possible to count the duplicate derivative files. On the one hand, it avoids data omissions and directly reflects the characteristics of the files, which is convenient for identifying malicious files. For example, when there are many duplicate derivative files, the derivative files can be considered to be malicious files. On the other hand, the data splitting system can be monitored by counting the total amount to promptly alert abnormal situations.
[0016] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A flowchart of a method for deduplicating derivative data provided by an embodiment of the present invention.
[0019] Figure 2 A flowchart of another method for deduplicating derivative data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] like Figure 1 As shown, this embodiment provides a method for deduplicating derivative data, including the following steps:
[0022] S100, process the target resource package and obtain the initial file list A corresponding to the target resource package = {A1, A2, ..., A m}, A iIt refers to the i-th initial file, i=1…m, and m is the number of initial files.
[0023] Specifically, the target resource package in step S100 is processed by splitting; preferably, the format of the target resource package is obtained in step S100 and m initial files are split according to the format of the target resource package. Those skilled in the art can adopt any existing resource package splitting method, which will not be repeated here.
[0024] Specifically, the target resource package refers to a data package including several files. For example, the target resource package includes a script file, a mail file, a PE file, an encrypted file, a compressed package, and the like.
[0025] S200, get A i The corresponding format and according to A i The corresponding format is to obtain A i Corresponding derivative file list A i '={A i1 , A i2 , ..., A in}, where A ij It refers to the jth derivative file, j=1…n, and n is the number of derivative files.
[0026] Specifically, obtain A i The corresponding derivative files can refer to step S100, which will not be described in detail here.
[0027] S300, get A ij The corresponding identity vector (A 1 ij , A 2 ij , ..., A s ij ), where A r ij A ij The corresponding r-th bit value in the identification vector, r=1…s, s is the number of bits in the identification vector.
[0028] Specifically, in step S300, the identification vector is obtained by ij The corresponding identifier is obtained by hash encoding.
[0029] S400, based on A ij The corresponding identification vector and any key identification vector in the key identification set, obtain A ij The corresponding similarity list F ij =(F 1 ij , F 2 ij, ..., F z ij ), F x ij A ij The similarity between the corresponding identification vector and the x-th key identification vector, x=1...z, z=n-1.
[0030] Specifically, the key identification vector refers to A i 'Except A ij Any derivative file other than corresponds to the identification vector.
[0031] Specifically, step S400 also includes the following steps:
[0032] Get key identifier set B i = {B1, B2, ..., B z}, the xth key identification vector B x =(B x1 , B x2 , ..., B xz ), B xr It refers to the rth bit value in the xth key identification vector;
[0033] According to A ij The corresponding identity vector and B x , get F x ij , those skilled in the art can adopt any similarity acquisition method in the prior art, which will not be described in detail here.
[0034] Preferably, F x ij Meet the following conditions:
[0035]
[0036] S500, according to F x ij , get A i The corresponding first-class derivative files and A i The corresponding second type of derivative files and A ij The corresponding first-class derivative files and A ij The corresponding second type of derivative files are processed separately.
[0037] Specifically, step S500 also includes the following steps:
[0038] S501, traverse F ij And when each F x ij ≠0, A ij A i The corresponding first-category derivative files;
[0039] S503, traverse F ij And when any F x ij = 0, get F x ij The corresponding derivative files and each F x ij The corresponding derivative file is A i The corresponding second type of derivative files.
[0040] Specifically, in step S503, A ij Itself is A i The corresponding first-class derivative files.
[0041] S505, when A i The corresponding derivative file is A i For the first type of derivative file corresponding to A i The corresponding first-type derivative file executes steps S200-S500;
[0042] S507, when A i The corresponding derivative file is A i For the corresponding second type of derivative files, i The corresponding second type of derivative files stop being derived; the derivative of duplicate derivative files can be stopped to avoid disassembling duplicate derivative files, which results in a large amount of data occupying storage space and reduces the utilization rate of storage space.
[0043] S600, repeat steps S200-S500 until A i All derivative files at any level in the corresponding data structure are second-class derivative files. i The corresponding target structure tree.
[0044] Specifically, A i The corresponding structure tree includes: A i is the root node and A i The corresponding derivative files are used as leaf nodes.
[0045] In a specific embodiment, Figure 2 As shown, the method further includes the following steps:
[0046] S1. Traverse F ij And when any F x ij = 0, F x ij =0 as the count value C corresponding to Aij ij , can be understood as: each F xij = 0, at A ij The corresponding current count value is increased by 1, that is, C ij Meet the following conditions:
[0047] C ij =C ij +1.
[0048] Specifically, F ij Please refer to steps S100-S500, which will not be described in detail here.
[0049] S2, based on all C ij , get the total value C0 corresponding to A, C0 meets the following conditions:
[0050]
[0051] Specifically, A ij The corresponding count value starts at 0.
[0052] S3. When C0 is greater than the preset counting threshold, a prompt instruction is fed back to the administrator.
[0053] The above-mentioned embodiment can count the duplicate files, which can avoid data omissions and directly reflect the characteristics of the files, making it easier to identify malicious files. For example, when there are many duplicate derivative files, the derivative files can be considered malicious files. On the other hand, the data splitting system can be monitored by counting the total amount to promptly alert abnormal situations.
[0054] In another specific embodiment, the method further comprises the following steps:
[0055] Get A i The time list corresponding to the structure tree t=(t1,t2,……,t p ), where t q A i The data processing time of the qth level in the structure tree of A, q = 1...p, p is A i The number of levels in the structure tree.
[0056] Specifically, t q Meet the following conditions:
[0057] It refers to the deduplication time of the g-th derivative file in the q-th level in the structure tree of Ai. It can be understood as the time required to determine whether the g-th derivative file is the first-type derivative file corresponding to Ai or the second-type derivative file corresponding to Ai.
[0058] According to t, the target time Ty corresponding to Ai meets the following conditions:
[0059] Ty=t1+t2+…+ty, y=1…q.
[0060] When T y When the time is greater than the preset threshold T0, i The derivative files of the system stop being derived; technicians in this field can set T0 according to their needs, which will not be described in detail here.
[0061] The above embodiment can avoid occupying more resources due to a large number of derivative files, improve the data processing effect, and meet the processing needs of more files.
[0062] This embodiment provides a method for deduplicating derivative data, which determines whether a derivative file needs to be further split by comparing the similarity between any derivative file and other derivative files in each level of the structure tree, thereby avoiding the situation where a large number of duplicate derivative files are split into files, which affects the use of storage space and reduces the space utilization efficiency.
[0063] At the same time, the total time required to process data to any level in the structure tree can be used to determine whether the file should be further split, avoiding the large number of derivative files that occupy more resources, improving data processing results, and satisfying the processing of more files.
[0064] In addition, the similarity of the derived files is used to determine whether they are duplicate derived files and to count the duplicate derived files. This can avoid data omissions and directly reflect the characteristics of the files, making it easier to identify malicious files. For example, when there are many duplicate derived files, the derived files can be considered malicious files. On the other hand, the data splitting system can be monitored by counting the total amount to promptly alert abnormal situations.
[0065] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0066] An embodiment of the present invention further provides an electronic device, comprising a processor and the aforementioned non-transitory computer-readable storage medium.
[0067] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for deduplication of derivative data, It is characterized in that The steps include: S100, process the target resource package, and obtain the initial file list A corresponding to the target resource package = {A 1 , A 2 , ..., A m }, A i It refers to the i-th initial file, i=1…m, m is the number of initial files; S200, get A i The corresponding format and according to A i The corresponding format is to obtain A i Corresponding derivative file list A i '={A i1 , A i2 , ..., A in }, where A ij refers to the jth derivative file, j = 1...n, n is the number of derivative files; S300, get A ij The corresponding identity vector (A 1 ij , A 2 ij , ..., A s ij ), where A r ij A ij The rth bit value in the corresponding identification vector, r = 1...s, s is the number of bits in the identification vector; S400, based on A ij The corresponding identification vector and any key identification vector in the key identification set, obtain A ij The corresponding similarity list F ij =(F 1 ij , F 2 ij , ..., F z ij ), F x ij A ij The similarity between the corresponding identification vector and the xth key identification vector, x=1...z, z=n-1; S500, according to F x ij , get A i The corresponding first-class derivative files and A i The corresponding second type of derivative files and A ij The corresponding first-class derivative files and A ij The corresponding second-category derivative files are processed separately; S600, repeat steps S200-S500 until A i All derivative files at any level in the corresponding data structure are second-class derivative files. i The corresponding target structure tree.
2. A method for deduplicating derivative data according to claim 1, It is characterized in that The target resource package in step S100 is processed by splitting.
3. A method for deduplicating derivative data according to claim 1, It is characterized in that In step S300, the identification vector is obtained by ij The corresponding identifier is obtained by hash encoding.
4. A method for deduplicating derivative data according to claim 1, It is characterized in that The key identification vector is A i 'Except A ij Any derivative file other than corresponds to the identification vector.
5. A method for deduplicating derivative data according to claim 1, It is characterized in that The step S400 also includes the following steps: Get key identifier set B i = {B 1 , B 2 , ..., B z }, the xth key identification vector B x =(B x1 , B x2 , ..., B xz ), B xr It refers to the rth bit value in the xth key identification vector; According to A ij The corresponding identity vector and B x , get F x ij .
6. A method for deduplicating derivative data according to claim 5, It is characterized in that F x ij Meet the following conditions:
7. A method for deduplicating derivative data according to claim 1, It is characterized in that A i The corresponding structure tree includes: A i is the root node and A i The corresponding derivative files are used as leaf nodes.
8. A method for deduplicating derivative data according to claim 1, It is characterized in that The method further comprises the steps of: S1. Traverse F ij And when any F x ij = 0, F x ij =0 as the total number of derivative files A ij The corresponding count value C ij ; S2, based on all C ij , get the total value C corresponding to A 0 , C 0 Meet the following conditions: S3, when C 0 When the count is greater than the preset threshold, a prompt instruction is fed back to the administrator.
9. A non-transitory computer-readable storage medium, It is characterized in that The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.
10. An electronic device, It is characterized in that Comprising a processor and the non-transitory computer-readable storage medium of claim 9.
Citation Information
Patent Citations
Product feature structure tree construction method based on comment text mining
CN106649260A
Linear combiner based automatic product feature structure tree construction method
CN108319734A
Data processing method for text verification, electronic equipment and storage medium
CN113761880A
