File processing method and device, electronic equipment and storage medium

By performing word segmentation on the files and calculating the variance contribution value, a word frequency library is constructed and a Bloom filter is used to store the files. This solves the problems of inaccurate retrieval and high storage capacity in hash table storage, and achieves efficient and secure file storage and retrieval.

CN115204165BActive Publication Date: 2025-12-09LIAONING MOBILE COMM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110394761.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-13
Publication Date
2025-12-09
Estimated Expiration
2041-04-13

AI Technical Summary

Technical Problem

In existing technologies, using hash tables to store files results in inaccurate retrieval and high storage capacity, leading to slow retrieval speeds and making it difficult to meet the high-efficiency retrieval requirements of the big data era.

Method used

By performing word segmentation on the files to be stored, calculating the variance contribution value of the word segmentation to determine the target word segmentation, building a word frequency library, and using a Bloom filter to store the files, the key attributes of the files are automatically constructed, reducing manual costs and improving data security.

Benefits of technology

It achieves efficient and secure file storage and retrieval, reduces storage costs, improves retrieval accuracy and speed, and meets the high-efficiency retrieval needs of the big data era.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115204165B_ABST
    Figure CN115204165B_ABST
Patent Text Reader

Abstract

The application discloses a file processing method and device, electronic equipment and a storage medium. The file processing method comprises the following steps: acquiring at least one to-be-stored file; performing word segmentation processing on each to-be-stored file respectively, and determining a word segmentation set corresponding to each to-be-stored file; determining a target word based on the variance contribution value of each word in the word segmentation set corresponding to the to-be-stored file; constructing a word frequency library based on the target word; and storing the to-be-stored file corresponding to the target word in the word frequency library based on the target word. The file processing method provided by the application can efficiently and safely store the to-be-stored file.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to information security technology, in particular to a file processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the big data era, large enterprises and even individuals will use cloud storage, that is, important file information is stored in a server for centralized storage. In order to ensure data security, many applications use ciphertext storage to store files.

[0003] The existing ciphertext storage method for the to-be-stored file is to set a corresponding key attribute for the to-be-stored file, and store the to-be-stored file based on the hash table data structure using the key attribute. In this way, if the search condition input by the user is different from the key attribute when the to-be-stored file is stored, the user's search file may not be accurately found, and the hash table data structure is used to store the to-be-stored file. The storage capacity of this data structure is high, and if the space occupation of a server is too full, it will cause slow retrieval and other problems, which is difficult to meet the requirements of efficient retrieval in the big data era. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a file processing method, device, electronic equipment and storage medium, so as to realize the effect of efficient and safe storage of to-be-stored files.

[0005] The technical solutions of the present application are as follows:

[0006] In a first aspect, a file processing method is provided, which includes:

[0007] Obtaining at least one to-be-stored file;

[0008] Performing word segmentation processing on each to-be-stored file respectively, and determining a word segmentation set corresponding to each to-be-stored file;

[0009] Determining a target word based on the variance contribution value of each word in the word segmentation set corresponding to the to-be-stored file;

[0010] Based on the target word, a word frequency library is constructed;

[0011] Based on the target word, the to-be-stored file corresponding to the target word is stored in the word frequency library.

[0012] In a second aspect, a file processing method is provided, which includes:

[0013] Receiving a search condition for searching a target file;

[0014] encoding the search condition to obtain a search vector corresponding to the search condition;

[0015] calculating the search vector, and inserting a calculation result into a second preset Bloom filter to obtain a second security shield corresponding to the search condition;

[0016] determining the target file based on the second security shield;

[0017] returning the target file to a client.

[0018] In a third aspect, a file processing apparatus is provided, and the apparatus includes:

[0019] a to-be-stored file obtaining module configured to obtain at least one to-be-stored file;

[0020] a word segmentation processing module configured to perform word segmentation processing on each to-be-stored file respectively, and determine a word segmentation set corresponding to each to-be-stored file;

[0021] a target word segmentation determining module configured to determine a target word segmentation corresponding to the to-be-stored file based on a variance contribution value of each word segmentation in the word segmentation set;

[0022] a term frequency library constructing module configured to construct a term frequency library based on the target word segmentation;

[0023] a to-be-stored file storing module configured to store the to-be-stored file corresponding to the target word segmentation in the term frequency library based on the target word segmentation.

[0024] In a fourth aspect, a file processing apparatus is provided, and the apparatus includes:

[0025] a search condition receiving module configured to receive a search condition for searching a target file;

[0026] a search vector determining module configured to encode the search condition to obtain a search vector corresponding to the search condition;

[0027] a security shield determining module configured to calculate the search vector, and insert a calculation result into a second preset Bloom filter to obtain a second security shield corresponding to the search condition;

[0028] a target file determining module configured to determine the target file based on the second security shield;

[0029] a target file feedback module configured to return the target file to a client.

[0030] In a fifth aspect, an electronic device is provided, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the file processing method according to any of the embodiments of the present application.

[0031] In a sixth aspect, a readable storage medium is provided, which stores a program or instructions, and the program or instructions, when executed by a processor, implement the steps of the file processing method according to any of the embodiments of the present application.

[0032] The technical solutions provided by the embodiments of the present application at least have the following beneficial effects:

[0033] The file storage method provided by the embodiments of the present application automatically constructs the target keywords of the to-be-stored file by calculating the variance contribution value, realizes the automatic construction of the key attributes of the to-be-stored file, and does not need to manually set the key attributes of the to-be-stored file in advance. The embodiments of the present application reduce the labor cost, efficiently construct the key attributes of the to-be-stored file, reduce the local storage cost, improve the data security, and realize the effect of efficiently and safely storing the to-be-stored file.

[0034] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0035] The accompanying drawings incorporated in the specification and forming a part of the specification illustrate the embodiments consistent with the present application, and together with the specification serve to explain the principles of the present application, and do not limit the present application.

[0036] Figure 1 is a flowchart of a file processing method provided by an embodiment of the present application Figure 1 ;

[0037] Figure 2 is a flowchart of a file processing method provided by an embodiment of the present application Figure 2

[0038] Figure 3 is a flowchart of a file processing method provided by an embodiment of the present application Figure 3 ;

[0039] Figure 4 is a structural diagram of a file processing device method provided by an embodiment of the present applicationFigure 1 ;

[0040] Figure 2 is a structural schematic diagram of a file processing device provided by an embodiment of the present application Figure 6 ;

[0041] Figure 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application DETAILED DESCRIPTION

[0042] In order to make the ordinary person skilled in the art better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings. It should be understood that the specific embodiments described herein are only intended to explain the present application, not to limit the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.

[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present application. Rather, they are only examples consistent with some aspects of the present application as detailed in the appended claims.

[0044] The prior art stores the file to be stored in the form of ciphertext, that is, manually sets the corresponding key attribute for the file to be stored, and stores the file to be stored based on the hash table data structure using the key attribute. However, this method may not accurately find the file to be searched by the user if the search formula input by the user is different from the key attribute when the file to be stored is stored or the search condition is not clear. In addition, the hash table data structure is used to store the file to be stored, and the storage capacity of the data structure is high. If the space occupation of a server is too full, it will cause slow retrieval and other problems, which is difficult to meet the requirements of efficient retrieval in the big data era.

[0045] To solve the above problems, the embodiment of the present application provides a file processing method, which comprises the following steps: obtaining each storage file, respectively performing word segmentation processing on the obtained each storage file to obtain a word segmentation set, calculating a variance contribution value of each word segmentation in the word segmentation set, determining a target word segmentation corresponding to each to-be-stored file according to the variance contribution value, and finally storing the to-be-stored file by using the target word segmentation. In this way, the target word segmentation of the to-be-stored file is automatically constructed by calculating the variance contribution value, the automatic construction of the key attribute of the to-be-stored file is realized, and the key attribute of the to-be-stored file does not need to be manually set in advance. The embodiment of the present application reduces the labor cost, efficiently constructs the key attribute of the to-be-stored file, reduces the local storage cost, improves the data security, and realizes the effect of efficiently and safely storing the to-be-stored file. In the embodiment of the present application, the target word segmentation can be a plurality of key attribute words representing the to-be-stored file, so that even if the search formula input by the user is not accurate, the file to be searched by the user can be accurately found.

[0046] In one example, in order to efficiently store the to-be-stored file and efficiently search the stored file, the present application provides a file processing method, which can be divided into two parts, one is a file storage process, and the other is a file search process. In order to more clearly understand the file processing method provided by the embodiment of the present application, the following embodiments can be referred to.

[0047] In order to efficiently store the to-be-stored file, as one of the embodiments of the present application, the embodiment of the present application mainly describes the process of storing the file. The following implementation steps can be referred to.

[0048] Referring to Figure 2 In order to efficiently store the to-be-stored file, the embodiment of the present application provides a file processing method, which comprises the following steps:

[0049] S110, obtaining at least one to-be-stored file.

[0050] The to-be-stored file can be a file to be stored.

[0051] In one example, the to-be-stored file can be uploaded by a user, specifically, the user can upload the to-be-stored file through a terminal held by the user.

[0052] S120, respectively performing word segmentation processing on each to-be-stored file to determine a word segmentation set corresponding to each to-be-stored file.

[0053] After obtaining each to-be-stored file, word segmentation processing is performed on each to-be-stored file to obtain a word segmentation set corresponding to each to-be-stored file.

[0054] In an example, the tokenization of each to-be-stored file can be implemented by using a neural model based on deep learning. Specifically, each to-be-stored file can be input into the neural model based on deep learning, and each token in the to-be-stored file can be obtained based on the neural model based on deep learning. In this way, each token of each to-be-stored file can be quickly and accurately obtained, and the tokenization of each to-be-stored file by using artificial labor can be avoided, thereby reducing the labor cost and avoiding tokenization errors caused by artificial errors.

[0055] After obtaining each token of each to-be-stored file, the tokens are collected to form a token set.

[0056] It should be noted that the tokenization of each to-be-stored file by using the neural model based on deep learning is only an example of the tokenization of each to-be-stored file in the embodiments of the present application. Those skilled in the art should know that other methods can also be used to tokenize each to-be-stored file, for example, a natural language processing method can be used to tokenize each to-be-stored file, and any method that can be used to tokenize each to-be-stored file is within the protection scope of the embodiments of the present application.

[0057] S130, determining a target token corresponding to the to-be-stored file based on the variance contribution value of each token in the token set.

[0058] The variance contribution value can represent the importance of the token to the to-be-stored file.

[0059] In an example, for a certain to-be-stored file, for a certain token of the to-be-stored file, the greater the variance contribution value of the token, the more important the token is to the to-be-stored file, and the more the token can represent the to-be-stored file, i.e., the token can be used as a key attribute of the to-be-stored file.

[0060] The target token can be a token that can represent the to-be-stored file and is determined based on the variance contribution value of each token in the token set. That is, the target token is a key attribute of the to-be-stored file.

[0061] In an example, tokens with large variance contribution values can be selected as target tokens.

[0062] S140, constructing a term frequency library based on the target token.

[0063] According to the obtained target token, each target token can be stored to construct a term frequency library.

[0064] S150, storing the to-be-stored file corresponding to the target token in the term frequency library based on the target token.

[0065] After the word frequency library is constructed, the target segmented word and the to-be-stored file corresponding to the target segmented word can be stored in the word frequency library. In the word frequency library, the target segmented word and the to-be-stored file corresponding to the target segmented word are stored correspondingly.

[0066] The technical solution of the embodiment of the present application can obtain a segmented word set by performing segmented word processing on each of the obtained storage files, calculate a variance contribution value of each segmented word in the segmented word set, determine the target segmented word corresponding to each to-be-stored file according to the variance contribution value, and finally store the to-be-stored file by using the target segmented word. In this way, the target segmented word of the to-be-stored file is automatically constructed by calculating the variance contribution value, the automatic construction of the key attribute of the to-be-stored file is realized, and the key attribute of the to-be-stored file does not need to be manually set in advance. The embodiment of the present application reduces the labor cost, efficiently constructs the key attribute of the to-be-stored file, and realizes the effect of efficiently and safely storing the to-be-stored file.

[0067] In the above embodiment, the target segmented word corresponding to the to-be-stored file is determined based on the variance contribution value of each segmented word in the segmented word set. In an example, in order to describe the process of determining the target segmented word corresponding to the to-be-stored file based on the variance contribution value of each segmented word in the segmented word set in detail, step S130 can include the following steps.

[0068] In the embodiment of the present application, one of the to-be-stored files is taken as an example for description. The to-be-stored file can be taken as a to-be-processed to-be-stored file, which can be defined as a current to-be-stored file. The current to-be-stored file has a plurality of segmented words. For any one of the segmented words in the current to-be-stored file, whether the current segmented word is the target segmented word of the current to-be-stored file can be determined to determine the target segmented word of each to-be-stored file. Whether the current segmented word is the target segmented word of the current to-be-stored file can be determined by performing steps S1301-S1303.

[0069] S1301, obtaining the frequency of the current segmented word in the current to-be-stored file.

[0070] The current to-be-stored file can be the to-be-processed to-be-stored file.

[0071] The current segmented word can be the segmented word in the to-be-processed current to-be-stored file.

[0072] In an example, for the current segmented word in the current to-be-stored file, the frequency of the current segmented word in the current to-be-stored file is first obtained.

[0073] It can be understood that, for a bias file, the higher the frequency of a word appearing in the file, the more important the word is for the file. Therefore, whether the current segmentation can be used as the target segmentation of the current to-be-stored file can be determined according to the frequency of the current segmentation appearing in the current to-be-stored file.

[0074] In S1302, the variance contribution value of the current segmentation is determined based on the frequency.

[0075] In an example, the importance of the current segmentation to the current to-be-stored file can be determined by using the variance contribution value.

[0076] Specifically, the variance contribution value of the current segmentation can be determined according to the probability of the current segmentation appearing in the current to-be-stored file.

[0077] In an example, the variance contribution value of the current segmentation can be determined by using the following formula.

[0078]

[0079] wherein, A=(a i ) p*m ;

[0080] S is the variance contribution value of the current segmentation; λ i is the frequency of the current segmentation appearing in the current to-be-stored file; a i is the vector corresponding to the current segmentation, which is a p*m-dimensional matrix; is the inverse of the vector corresponding to the current segmentation; i is the number of segmentations in the current to-be-stored file, i=1, 2, 3, …, P; A is the segmentation set; is the hash reference value corresponding to a to-be-stored file, which is a one-dimensional numerical value predefined; s ii is the numerical value obtained by taking the absolute value of a i ; diag means taking the absolute value.

[0081] In an example, a i is the vector corresponding to the current segmentation. For each current segmentation, the vector conversion can be performed on the current segmentation according to a preset conversion algorithm to obtain the vector corresponding to the current segmentation.

[0082] It should be noted that the preset conversion algorithm can be any algorithm that can convert the current word into a vector to obtain the vector corresponding to the current word, for example, binary vector conversion can be performed on the current word. Those skilled in the art should understand that any algorithm that can convert the current word into a vector to obtain the vector corresponding to the current word belongs to the protection of the embodiments of the present application.

[0083] In S1303, the target word corresponding to the current file to be stored is determined based on the variance contribution value.

[0084] After determining the variance contribution value of the current word, the target word corresponding to the current file to be stored can be determined based on the variance contribution value.

[0085] In one example, the variance contribution value of the current word can be compared with a preset variance contribution threshold. If the variance contribution value of the current word is greater than or equal to the preset variance contribution threshold, the current word can be determined as the target word of the current file to be stored.

[0086] It should be noted that the preset variance contribution value can be a threshold value of the preset variance contribution value. The value can be set according to user demand, which is not limited here.

[0087] In another example, the variance contribution values of all words of the current file to be stored can be sorted without comparing the variance contribution value of the current word with a preset variance contribution threshold. Specifically, the variance contribution values of all words of the current file to be stored can be sorted in descending order, and then the first n (n can be set according to user demand, which is not limited here) words in the sorted order can be determined as the target words of the current file to be stored.

[0088] It should be noted that the above two ways of determining the target word can be implemented. Specifically, which way to take can be selected according to user demand, which is not limited here.

[0089] According to the above method, the target word corresponding to the file to be stored can be accurately determined, so that the target word and the file to be stored corresponding to the target word can be stored based on the target word in the subsequent process, so that the corresponding file to be stored can be accurately searched based on the target word in the subsequent file searching process.

[0090] In the prior art, after the key attributes of the file to be stored are determined, the hash table structure is used to store the file to be stored according to the key attributes. Since the storage capacity is high when the file to be stored is stored in this structure, if the space occupation of a server is too full, the subsequent retrieval speed will be slow, which is difficult to meet the requirements of efficient retrieval in the big data era.

[0091] To solve this problem, the embodiments of the present application can use a Bloom probability storage structure when storing the to-be-stored file. This form can filter out the high-probability correspondence between the to-be-stored file and the target word segmentation, and store it, without storing the low-probability correspondence between the to-be-stored file and the target word segmentation, so as to save storage space and not cause the problem of slow subsequent retrieval speed.

[0092] In one example, in order to store the target word segmentation and the to-be-stored file corresponding to the target word segmentation in a Bloom probability storage structure, it is necessary to first construct the Bloom probability storage structure. The specific construction method can refer to the following embodiments.

[0093] In one example, in order to construct the Bloom probability storage structure, the embodiments of the present application refine step S150 and describe the process of step S150 in detail. Step S150 can specifically include the following steps:

[0094] S1501, obtaining a first preset parameter corresponding to the to-be-stored file.

[0095] The first preset parameter can be a parameter corresponding to the to-be-stored file set in advance. Specifically, the parameter can be randomly set.

[0096] In one example, the to-be-stored file can be input into a random vector machine. Based on the random vector machine, a parameter corresponding to the to-be-stored file, i.e., the first preset parameter, can be randomly output.

[0097] S1502, constructing a first preset matrix vector of the to-be-stored file based on the first preset parameter.

[0098] The first preset matrix vector can be a matrix vector corresponding to the to-be-stored file folder constructed based on the first preset parameter.

[0099] According to the first preset parameter, the first preset matrix vector of the to-be-stored file can be constructed. The first preset matrix vector can be a k-dimensional vector, where k is the first preset parameter.

[0100] In one example, the first preset matrix vector can be in the following form: S = {0, 1} k .

[0101] For the first preset matrix vector, in order to maximize the randomness of the first preset matrix vector, the number of 0 and 1 in S needs to be approximately the same.

[0102] S1503, performing vector conversion on the first preset matrix vector to obtain a target vector matrix corresponding to the to-be-stored file.

[0103] The target vector matrix can be obtained by performing vector conversion on the first preset matrix vector.

[0104] After obtaining the first preset matrix vector, vector conversion is performed on the first preset matrix vector, and specifically, the first preset matrix vector can be converted by using a dual encoding function to obtain a target vector matrix corresponding to the file to be stored.

[0105] In an example, the first preset matrix vector is S = {0, 1} k For example, after performing vector conversion on the first preset matrix vector by using the dual encoding function, a target vector matrix V i = {v i ,..., v t} is obtained, where each vector v ∈ {0, 1} 676 For each vector v, it is a vector of 676 rows and 1 column.

[0106] It should be noted that in the above vector v, 676 rows are only a specific example of the embodiments of the present application, and do not represent that the vector v can only be 676. Those skilled in the art should know that the value can be set by the user according to the user's needs, which is not limited here.

[0107] S1504, calculating the target vector matrix, and constructing a first target Bloom filter based on the calculation result.

[0108] The first target Bloom filter can be an adjusted Bloom filter obtained by adjusting the Bloom filter based on the calculation result of the target vector matrix.

[0109] After obtaining the target vector matrix, the target vector matrix is calculated, and specifically, each vector v in the target vector matrix V i = {v i ,..., v t} can be calculated by using a position-sensitive hash function {H i ,..., H t}, to obtain {H1(v),..., H t (v)}, and the obtained result is inserted into a Bloom filter (the Bloom filter is a k-dimensional Bloom filter, where k is a first preset parameter), to generate a final Bloom filter. The Bloom filter is used to filter the target word segmentation and the file to be stored corresponding to the target word segmentation, to obtain the target word segmentation of the Bloom probability structure to be stored in the word frequency library and the file to be stored corresponding to the target word segmentation.

[0110] S1505, based on the first target Bloom filter, the target word segmentation and the to-be-stored file corresponding to the target word segmentation are stored according to the storage structure of the first target Bloom filter.

[0111] After obtaining the first target Bloom filter, based on the first target Bloom filter, the target word segmentation and the to-be-stored file corresponding to the target word segmentation are stored according to the storage structure of the first target Bloom filter, that is, stored according to the Bloom probability structure. In this way, the target word segmentation stored by the Bloom probability structure and the to-be-stored file corresponding to the target word segmentation can be obtained.

[0112] In the embodiment of the present application, the storage structure of the first target Bloom filter is used to store the target word segmentation and the to-be-stored file corresponding to the target word segmentation. In this way, based on the storage structure of the Bloom filter, the storage space can be saved, and the problem of slow subsequent retrieval speed will not occur.

[0113] In the embodiment of the present application, the first target Bloom filter is obtained by using the first preset parameter corresponding to the to-be-stored file. Based on the first target Bloom filter, the target word segmentation and the to-be-stored file corresponding to the target word segmentation are stored according to the storage structure of the first target Bloom filter. In this way, the storage space is saved, and the problem of slow subsequent retrieval speed will not occur. The problem of slow subsequent retrieval speed caused by the fact that the space of a server is occupied too much when the target word segmentation and the to-be-stored file corresponding to the target word segmentation are stored by using the structure of the hash table in the prior art is solved, and the requirement of efficient retrieval in the big data era is difficult to meet.

[0114] The above embodiment is the storage process of the to-be-stored file. The user does not need to set the key attribute (target word segmentation) of each to-be-stored file in advance. The word frequency library is constructed by calculating the variance contribution value to realize the automatic construction of the key attribute of the to-be-stored file. At the same time, the target word segmentation and the to-be-stored file corresponding to the target word segmentation are stored by using the Bloom probability structure, which reduces the storage cost, saves the storage space, improves the security of data, and realizes the effect of efficient and safe storage of the to-be-stored file.

[0115] In the embodiment of the present application, the to-be-stored file is stored by using the above embodiment, so that the to-be-stored file can be retrieved by using the retrieval condition for subsequent retrieval, so as to quickly and accurately find the file that the user wants.

[0116] In one example, in order to quickly and accurately find the file that the user wants, as another implementation manner of the present application, the present application further provides another implementation manner of file processing, which can be referred to the following embodiment.

[0117] In one example, the embodiment is an embodiment of the process of file retrieval.

[0118] See Figure 3 Another implementation of the document processing method provided in this application may include the following steps:

[0119] S210, Receive the search criteria for searching the target file.

[0120] The target file can be the file that the user wants to retrieve.

[0121] In one example, the target file can be a file to be stored in the word frequency database using the file storage method described in the above embodiments.

[0122] When searching for a target file, the first step is to obtain the search criteria for that target file.

[0123] In one example, the search criteria can be entered by the user making the search on their terminal.

[0124] S220. Encode the search criteria to obtain the search vector corresponding to the search criteria.

[0125] A retrieval vector can be a vector obtained by encoding retrieval criteria.

[0126] In one example, the search criteria are encoded, specifically by using a dual encoding function to encode the search.

[0127] In one example, the search criteria are Q = {q1, ..., q} t The retrieval is encoded using a dual coding function, and then transformed into a vector to obtain the retrieval vector W. i ={w i , ......, w t}, where each vector w∈{0,1} 676 For each vector w, it is a vector with 676 rows and 1 column.

[0128] It should be noted that in the above vector w, row 676 is only a specific example of an embodiment of this application, and does not mean that the vector w can only be 676. Those skilled in the art should know that this value can be set by the user according to their needs, and there is no limitation here.

[0129] In one example, after obtaining the search criteria, the preset parameters corresponding to the search criteria are obtained based on the search criteria. Based on the preset parameters, a preset matrix vector is constructed, wherein the dimension of the preset matrix vector is the preset parameters corresponding to the search criteria.

[0130] After the preset matrix vector is constructed, the preset matrix vector is encoded, and specifically, the search can be encoded by using a dual encoding function.

[0131] It should be noted that in the embodiments of the present application, the preset parameter corresponding to the search condition is obtained based on the search condition, and a preset matrix vector is constructed based on the preset parameter. The implementation manner of the above step is consistent with the implementation manner of constructing the first preset matrix vector of the to-be-stored file based on the first preset parameter when the to-be-stored file is stored, and thus will not be explained in detail here.

[0132] In S230, the search vector is calculated, the calculation result is inserted into the second preset Bloom filter, and the first security shield corresponding to the search condition is obtained.

[0133] The second preset Bloom filter can be a Bloom filter set in advance.

[0134] In an example, the second preset Bloom filter can be a k-dimensional Bloom filter, where k is the first preset parameter in the above embodiments. The second preset Bloom filter has a plurality of small filters, and the number of small filters is consistent with the calculation result of the search vector corresponding to the subsequent search condition.

[0135] The first security shield can be a security shield corresponding to the search condition obtained after the search vector is calculated and the calculation result is inserted into the second preset Bloom filter.

[0136] After the search vector is obtained, the search vector is calculated, and specifically, the search vector can be calculated by using a location-sensitive hash function.

[0137] In an example, the search vector is W i ={w i ,......,w t} for example, for each vector w in the search vector, a location-sensitive hash function {H i ,......,H t} is used for calculation, and {H1(w),......,H t (w)} is obtained, and the obtained result is inserted into the second preset Bloom filter. For each small filter (denoted by b j ) in the second preset Bloom filter (denoted by B), distance recoverable encryption algorithm is used for encryption to form the first security shield, and specifically, if S j =0, b′ j is set as b″ j =b j ; if S j= 1, set (here, r' is a preset value, which is related to the number of the word pieces in the word piece set), thus, B' = (b'1,..., b'k), B" = (b"1,..., b"k), and the first security shield t = (t', t") can be calculated according to the above results, where t' = (b'1,..., b'k), t" = (b"1,..., b"k). k ), B" = (b"1,..., b" k ), and the first security shield t = (t', t") can be calculated according to the above results, where t' = (b'1,..., b'k), t" = (b"1,..., b"k).

[0138] In the above formula, S is a preset matrix vector corresponding to the search condition; M is two vector matrices established based on a preset parameter corresponding to the search condition, and the specific establishment manner of the vector matrices can refer to the establishment manner of the vector matrices in the establishment process of the second security shield; and k is the preset parameter corresponding to the search condition.

[0139] S240, determining the target file based on the first security shield.

[0140] After obtaining the first security shield, the target file can be determined based on the first security shield. Specifically, a search can be performed in the word frequency library based on the first security shield, and after a security shield corresponding to the first security shield is found, the file corresponding to the security shield is taken as the target file.

[0141] S250, returning the target file to the client.

[0142] After obtaining the target file, the target file can be fed back to the client for downloading, browsing, etc. by the user on the client.

[0143] In the embodiments of the present application, based on the search condition for searching the target file, the search condition is encoded and calculated to obtain the first security shield, and based on the first security shield, the target file corresponding to the search condition can be found in the word frequency library, and the target file is fed back to the client. In this way, based on the Bloom filter, the Bloom probability structure is constructed for the search condition, and the distance recoverable encryption algorithm is used for encryption, so that when the search condition is not clear or the search condition is wrong, the target file can still be quickly located.

[0144] In one example, after obtaining the first security shield, the first security shield can be used to search in the word frequency library to see whether a security shield corresponding to the first security shield can be found, and according to the search result, the target file can be determined. In order to further describe the process of determining the target file based on the first security shield, the step S204 is refined, and specifically, the S240 can further include the following steps:

[0145] S2401, in the case of retrieving the second security shield corresponding to the first security shield, determining the storage file corresponding to the first security shield as the target file, wherein the second security shield is the security shield constructed based on the secret key corresponding to the target file when the target file is stored.

[0146] The second security shield is the security shield stored in the word frequency library, which is the security shield corresponding to the to-be-stored file generated when the to-be-stored file is stored in the word frequency library.

[0147] When searching in the word frequency library by using the first security shield, if the second security shield corresponding to the first security shield is retrieved in the word frequency library, it is proved that there is the target file corresponding to the first security shield in the word frequency library.

[0148] S2402, in the case of not retrieving the second security shield corresponding to the first security shield, calculating the quantity product of the first security shield and each segmented word in the word frequency library; sorting the quantity products in descending order of the values of the quantity products, screening the quantity products, and obtaining a preset number of segmented words in the front of the order; determining the storage file corresponding to the preset number of segmented words as the target file.

[0149] The preset number can be a preset number of segmented words to be selected, for example, 5.

[0150] When searching in the word frequency library by using the first security shield, if the first security shield corresponding to the first security shield is not retrieved in the word frequency library, the quantity product of the first security shield and each segmented word in the word frequency library can be calculated, the values of the quantity products are sorted in descending order after the quantity products are obtained, the quantity products are screened, a preset number of segmented words in the front of the order are obtained, and the storage file corresponding to the preset number of segmented words is determined as the target file.

[0151] In one example, if the first security shield corresponding to the first security shield is not retrieved in the word frequency library, an empty file set F R can be established, and the quantity product R I of the first security shield and each segmented word in the word frequency library is calculated, R i =I′ i *t′+I″ i *t″, wherein t′ is the retrieval index corresponding to each file in the word frequency library, i.e., the position index of each file in the word frequency library. I′ i, which represents the position index of each file in the word frequency library. Then, the product is sorted according to a sorting algorithm, which can be, for example, in descending order. The top pre-set number (for example, the top 5) of the product is filtered out, and the segmented words corresponding to the 5 products are determined. Then, the storage file corresponding to the determined segmented words is determined as the target file, and the target file is put into the pre-established empty file set F R R and fed back to the client.

[0152] It should be noted that the above steps S2401 and S2402 are not the order of execution, but the parallel order. When the second security shield corresponding to the first security shield can be retrieved, step S2401 is executed, and when the second security shield corresponding to the first security shield cannot be retrieved, step S2402 is executed.

[0153] In one example, after obtaining the first security shield, the first security shield can also be binary transformed to obtain the binary first security shield. Then, the binary first security shield is searched in the word frequency library to see if the binary second security shield can be searched.

[0154] It should be noted that after obtaining the first security shield, the first security shield can be directly searched in the word frequency library, or the first security shield can be binary transformed and searched in the word frequency library using the binary transformed first security shield. Both of the above methods can be implemented, and the specific method can be selected according to user demand.

[0155] In the embodiment of the application, whether the second security shield corresponding to the first security shield exists in the word frequency library is determined by searching the first security shield in the word frequency library. According to the search result, the target file is determined, which realizes the effect that the target file can be accurately positioned whether the second security shield corresponding to the first security shield exists or not.

[0156] In one example, after obtaining the first security shield, the first security shield is searched in the word frequency library to see if the second security shield corresponding to the first security shield can be searched. The second security shield here is the security shield corresponding to the to-be-stored file generated when the to-be-stored file is stored in the word frequency library.

[0157] In order to facilitate the understanding of the second security shield, the generation process of the second security shield is introduced as follows:

[0158] ​After obtaining the to-be-stored file to be stored, a first preset parameter corresponding to the to-be-stored file is determined, two matrix vectors are constructed according to the first preset parameter. Then the two matrix vectors and a first preset matrix vector corresponding to the to-be-stored file are multiplied to obtain a secret key of the to-be-stored file, and a second security shield can be obtained according to the secret key. The implementation of obtaining the security shield according to the secret key belongs to the prior art and will not be described in detail here.

[0159] In one example, taking k as the first preset parameter, two k*k matrix vectors, such as M1 and M2, are randomly constructed, where M1, M2 ∈ R k*k , the first preset matrix vector of the to-be-stored file is S = {0, 1} k , M1, M2 and S are multiplied to obtain a secret key SK = (M1, M2, S), and then a second security shield is obtained according to the secret key.

[0160] In the embodiments of the present application, the first preset parameter of the to-be-stored file can be used to obtain the security shield (second security shield) corresponding to the to-be-stored file, so that the target file corresponding to the retrieval condition can be located and retrieved based on the second security shield.

[0161] In the above embodiments, the first security shield can be used to find the target file corresponding to the retrieval condition in the word frequency library. In order to quickly find the target file corresponding to the retrieval condition, when the retrieval condition is not the first time, the target file can be quickly located based on the first retrieval result. In this way, it is not necessary to determine whether there is a second security shield corresponding to the first security shield every time, and the target file is determined according to the determination result.

[0162] In one example, when the retrieval condition is not the first time, in order to quickly locate the target file, the embodiments of the present application also provide another implementation, which can be specifically referred to in the following embodiments.

[0163] When the retrieval condition is not the first time, in order to quickly locate the target file, after the target file is determined, the method can further include the following steps:

[0164] S260, in the case where the first security shield appears for the first time, a mapping relationship between the first security shield and the target file corresponding to the first security shield is established; in the case where the first security shield does not appear for the first time, the storage file under the mapping relationship is taken as the target file.

[0165] When the corresponding target file is found based on the first security shield, if the first security shield is found for the first time, a mapping relationship between the determined first security shield and the target file corresponding to the first security shield can be established, that is, a mapping relationship between the first security shield in step S2401 and the corresponding target file is established, or a mapping relationship between the selected preset number of segmented words and the first security shield in S2402 is established. When the first security shield is received for the second time, the storage file under the mapping relationship can be directly fed back to the client as the target file, so that the target file can be quickly located without the need for further judgment, and the search speed is improved.

[0166] The embodiment of the application determines whether the first security shield is found for the first time, and if so, a mapping relationship between the first security shield and the target file corresponding to the first security shield is established. When the same first security shield is received for the second time, the storage file under the mapping relationship can be directly fed back to the client as the target file, so that the target file can be quickly located without the need for further judgment, and the search speed is improved.

[0167] The above embodiment separately and in detail describes the implementation of the file storage process and the file search process in the application. In order to facilitate a clearer understanding of the scheme, the file storage process and the file search process can be combined together below, so that the implementation process of the entire file processing method can be more intuitively understood.

[0168] Referring to Figure 4 Another implementation of the file processing method of the application is as follows:

[0169] 1. The file owner uploads at least one to-be-stored file.

[0170] 2. After the file center in the cloud center receives each to-be-stored file, the first preset parameter of the to-be-stored file is obtained, and based on the first preset parameter, the key of the to-be-stored file is generated.

[0171] 3. The word frequency library of the cloud center performs segmentation processing on each to-be-stored file in the file center to obtain a segmentation set, determines a target segmentation based on the variance contribution value of each segmentation in the segmentation set, and stores the target segmentation and the to-be-stored file corresponding to the target segmentation in the word frequency library.

[0172] 4. The shield center receives a search condition input by the file search.

[0173] 5. The shield center processes the search condition to obtain a first security shield.

[0174] 6. The word frequency library is searched for a second security shield corresponding to the first security shield.

[0175] 7. According to the search result, finding the file corresponding to the first security shield in the file center.

[0176] 8. Feeding the searched file as a target file to the file searcher.

[0177] It should be noted that in the embodiments of the present application, the implementation process of each step (steps 1-3) of file storage is the same as the implementation manner in the above file storage embodiments, which will not be explained and described here. Correspondingly, the process of each step (steps 4-8) of file search and the implementation manner in the above file search embodiments are the same, which will not be explained and described here.

[0178] The technical solution of the embodiments of the present application can make the reader more clearly understand the implementation process of the entire file processing method by placing the file storage process and the file search process together, so as to more intuitively understand the scheme.

[0179] Based on the file processing method provided in the above embodiments, the present application also provides a specific implementation manner of a file processing device, please see the following embodiments.

[0180] First, see Figure 5 The file processing device provided in the embodiments of the present application corresponds to the method embodiments of the above file storage process. The file processing device provided in the embodiments of the present application includes the following modules:

[0181] The file storage device 400 includes the following modules:

[0182] The word segmentation processing module 420 is configured to perform word segmentation processing on each of the at least one file to be stored respectively, and determine a word segmentation set corresponding to each of the at least one file to be stored.

[0183] The target word segmentation determination module 430 is configured to determine a target word segmentation corresponding to the at least one file to be stored based on the variance contribution value of each word segmentation in the word segmentation set.

[0184] The word frequency library construction module 440 is configured to construct a word frequency library based on the target word segmentation.

[0185] The file storage module 450 is configured to store the at least one file to be stored corresponding to the target word segmentation in the word frequency library based on the target word segmentation.

[0186] The technical scheme of the embodiment of the application is characterized in that the word segmentation processing module is used to perform word segmentation processing on each storage file obtained by the to-be-stored file acquisition module, to obtain a word segmentation set, the target word segmentation determination module is used to calculate the variance contribution value of each word segmentation in the word segmentation set, the target word segmentation corresponding to each to-be-stored file is determined according to the variance contribution value, and finally the target word segmentation and the to-be-stored file are stored by the to-be-stored file storage module. In this way, the target word segmentation of the to-be-stored file is automatically constructed by calculating the variance contribution value, the automatic construction of the key attribute of the to-be-stored file is realized, and the key attribute of the to-be-stored file does not need to be manually set in advance. The embodiment of the application reduces the labor cost, efficiently constructs the key attribute of the to-be-stored file, reduces the local storage cost, improves the security of data, and realizes the effect of efficiently and safely storing the to-be-stored file.

[0187] As an implementation manner of the application, in order to describe the determination process of the target word segmentation in detail, the target word segmentation determination module 430 can further specifically include:

[0188] a frequency acquisition unit, configured to acquire the frequency of occurrence of any current word segmentation in any current to-be-stored file;

[0189] a variance contribution value determination unit, configured to determine the variance contribution value of the current word segmentation based on the frequency for any current to-be-stored file and any current word segmentation in the current to-be-stored file;

[0190] a target word segmentation determination unit, configured to determine the target word segmentation corresponding to the current to-be-stored file based on the variance contribution value for any current to-be-stored file and any current word segmentation in the current to-be-stored file.

[0191] As an implementation manner of the application, in order to describe the storage of the target word segmentation and the to-be-stored file corresponding to the target word segmentation in the word frequency library in detail, the to-be-stored file storage module 450 can further specifically include:

[0192] a first preset parameter acquisition unit, configured to acquire a first preset parameter corresponding to the to-be-stored file;

[0193] a first preset matrix vector construction unit, configured to construct a first preset matrix vector of the to-be-stored file based on the first preset parameter;

[0194] a target vector matrix determination unit, configured to perform vector conversion on the first preset matrix vector to obtain a target vector matrix corresponding to the to-be-stored file;

[0195] The first target Bloom filter construction unit is configured to perform calculation on the target vector matrix, and construct a first target Bloom filter based on a calculation result.

[0196] The file to be stored storage unit is configured to store the target segmented word and the file to be stored corresponding to the target segmented word in accordance with a storage structure of the first target Bloom filter based on the first target Bloom filter.

[0197] The file processing apparatus provided by the embodiments of the present application can be used to perform the method provided by the file storage process embodiment of the file processing method, and has similar implementation principles and technical effects. For brevity, details are not described herein again.

[0198] Referring to Figure 6 The file processing apparatus provided by the embodiments of the present application corresponds to the method embodiments of the file retrieval process. The file processing apparatus provided by the embodiments of the present application includes the following modules:

[0199] The retrieval condition receiving module 510 is configured to receive a retrieval condition for retrieving a target file.

[0200] The retrieval vector determining module 520 is configured to encode the retrieval condition to obtain a retrieval vector corresponding to the retrieval condition.

[0201] The security shield determining module 530 is configured to perform calculation on the retrieval vector, insert a calculation result into a second preset Bloom filter, and obtain a first security shield corresponding to the retrieval condition.

[0202] The target file determining module 540 is configured to determine the target file based on the first security shield.

[0203] The target file feedback module 550 is configured to return the target file to a client.

[0204] In the embodiments of the present application, based on the retrieval condition for retrieving a target file obtained by the retrieval condition receiving module, the retrieval vector determining module encodes the retrieval condition, the security shield determining module performs calculation on the encoded retrieval condition to obtain a first security shield, the target file determining module can find the target file corresponding to the retrieval condition in a word frequency library based on the first security shield, and the target file feedback module feeds back the target file to a client. In this way, based on the Bloom filter, the Bloom probability structure is constructed for the retrieval condition, and the distance recoverable encryption algorithm is used for encryption, so that the target file can be quickly located when the retrieval condition is not clear or the retrieval condition is wrong.

[0205] As an implementation form of the present application, in order to describe the implementation process of determining the target file in detail, the target file determining module 540 can further specifically include:

[0206] The first target file determining unit is configured to determine the storage file corresponding to the first security shield as the target file when it is searched that the second security shield corresponding to the first security shield exists, wherein the second security shield is a security shield constructed based on the secret key corresponding to the target file when the target file is stored.

[0207] The second target file determining unit is configured to calculate the quantity product of the first security shield and each divided word in the word frequency library when it is not searched that the second security shield corresponding to the first security shield exists, sort the quantity products in descending order according to the values of the quantity products, filter the quantity products, and obtain a preset number of divided words in the front of the sorting; and determine the storage file corresponding to the preset number of divided words as the target file.

[0208] As an implementation form of the present application, in order to quickly locate the target file when the file is searched before the second security shield appears, the file processing apparatus can further include:

[0209] The mapping relationship establishing module is configured to establish a mapping relationship between the first security shield and the target file corresponding to the first security shield when it is determined that the first security shield appears for the first time; and determine the storage file under the mapping relationship as the target file when it is determined that the first security shield does not appear for the first time.

[0210] The file processing apparatus provided by the embodiments of the present application can be used to execute the method provided by the file searching process embodiment in the file processing method, and the implementation principle and technical effects are similar, and thus are not described herein again for the sake of brevity.

[0211] Based on the same inventive concept, the embodiments of the present application further provide an electronic device.

[0212] Figure 6 FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in FIG. 1, the electronic device can include a processor 601 and a memory 602 in which a computer program or instruction is stored. Figure 6

[0213] Specifically, the processor 601 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits implementing the embodiments of the present application.

[0214] ​The memory 602 can include mass storage for data or instructions. As an example and not by way of limitation, the memory 602 can include a hard disk drive (HDD), floppy disk drive, flash memory, compact disk (CD) or digital versatile disk (DVD) drive, or any combination of two or more of these. The memory 602 can include removable or non-removable (or fixed) media, where appropriate. The memory 602 can be considered a computer-readable medium, where appropriate. The memory 602 can be internal or external to the integrated gateway disaster recovery appliance, where appropriate. In particular embodiments, the memory 602 is nonvolatile, solid-state memory. In particular embodiments, the memory 602 includes read-only memory (ROM). Where appropriate, this ROM can be mask programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), electrically alterable ROM (EAROM), or flash memory or any combination of two or more of these. The processor 601 can be responsible for managing the bus 610 and general processing, including the execution of software stored on the memory 602. The processor 601 can be responsible for

[0215] The processor 601 can be responsible for managing the bus 610 and general processing, including the execution of software stored on the memory 602. The processor 601 can be responsible for

[0216] The electronic device can also include a communications interface 603 and a bus 610, where appropriate. As an example and not by way of limitation, the electronic device can include an internal bus system, such as a Figure 1 The bus 610 provides a communication path for the processor 601, the memory 602, and the communications interface 603, where appropriate. Examples of the bus 610 include a

[0217] The communications interface 603 can be used to enable wired or wireless communication for the transfer of data to, from, or between the various modules, devices, components, and / or devices of the present embodiments.

[0218] The bus 610 provides a communication path for the processor 601, the memory 602, and the communications interface 603, where appropriate. Examples of the bus 610 include a

[0219] The electronic device can execute the file processing method in the embodiments of the present application, thereby realizing the file processing method described in the embodiments of the present application. Figure 2 , Figure 3 and ​ The file processing method described in the embodiments of the present application.

[0220] In addition, in combination with the file processing method in the above embodiments, the embodiments of the present application can provide a readable storage medium for implementation. The readable storage medium has program instructions stored thereon; the program instructions are executed by a processor to implement any one of the file processing methods in the above embodiments.

[0221] It should be noted that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of well-known methods are omitted herein. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order of the steps, after understanding the spirit of the present application.

[0222] The functional blocks shown in the structural block diagrams described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present application are program or code segments used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of the machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via a computer network such as the Internet, an intranet, etc.

[0223] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be executed simultaneously.

[0224] The above merely describes specific implementation of the present application, and those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, module and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.

Claims

1. A method of file processing, characterized by, The method comprises: acquiring at least one to be stored file; respectively performing word segmentation processing on each of the to be stored files to determine a word segmentation set corresponding to each of the to be stored files; determining a target word segmentation corresponding to the to be stored file based on a variance contribution value of each word segmentation in the word segmentation set; constructing a word frequency library based on the target word segmentation; storing the to be stored file corresponding to the target word segmentation in the word frequency library based on the target word segmentation; The method comprises: for any current to be stored file and any current word segmentation in the current to be stored file, the following steps are performed to determine a target word segmentation corresponding to the current to be stored file: acquiring a frequency of the current word segmentation appearing in the current to be stored file; determining a variance contribution value of the current word segmentation based on the frequency; comparing the current word segmentation in the word segmentation set with a preset variance contribution threshold to obtain a comparison result; in a case where the comparison result represents that the variance contribution value of the current word segmentation is greater than or equal to the preset variance contribution threshold, the current word segmentation is determined as the target word segmentation of the current to be stored file; The method comprises: acquiring a first preset parameter corresponding to the to be stored file; constructing a first preset matrix vector of the to be stored file based on the first preset parameter; performing vector conversion on the first preset matrix vector to obtain a target vector matrix corresponding to the to be stored file; performing calculation on the target vector matrix to construct a first target Bloom filter based on the calculation result; storing the target word segmentation and the to be stored file corresponding to the target word segmentation according to a storage structure of the first target Bloom filter based on the first target Bloom filter; The variance contribution value is expressed by the following formula: ; wherein ; ; ; Wherein, S is the variance contribution value of the word segmentation, is the frequency of the word segmentation in the file to be stored; is the vector corresponding to the word segmentation, which is a p*m dimensional matrix; is the inverse of the vector corresponding to the word segmentation; i is the number of word segmentation in the file to be stored, i=1, 2, 3, …P; A is the word segmentation set; is the hash reference value corresponding to a file to be stored, which is a one-dimensional numerical value defined in advance; is the numerical value obtained after taking the absolute value of diag represents taking the absolute value.

2. A file processing method characterized by, The method is used for retrieving a target file, and the target file is obtained by using the method of claim 1, which comprises: receiving a retrieval condition for retrieving a target file; encoding the retrieval condition to obtain a retrieval vector corresponding to the retrieval condition; performing calculation on the retrieval vector and inserting the calculation result into a second preset Bloom filter to obtain a second security shield corresponding to the retrieval condition; determining the target file based on the second security shield; returning the target file to a client; the method comprises: in a case where a first security shield corresponding to the second security shield is retrieved, a stored file corresponding to the second security shield is determined as the target file, wherein the first security shield is a security shield constructed based on a secret key corresponding to the target file when the target file is stored. In the case that no first security shield corresponding to the second security shield is retrieved, a quantity product of the second security shield and each word segmentation in a word frequency library is calculated, wherein the word frequency library is established based on a word frequency matrix; the quantity products are sorted in descending order of the values of the quantity products, and the quantity products are filtered to obtain a preset number of word segmentations in the front of the sorting; and a storage file corresponding to the preset number of word segmentations is determined as the target file.

3. The method of claim 2, wherein, After the retrieval of whether there is a first security shield corresponding to the second security shield, the method further comprises: In the case that it is determined that the second security shield appears for the first time, a mapping relationship between a storage file corresponding to the preset number of word segmentations and the second security shield is established; In the case that it is determined that the second security shield does not appear for the first time, the storage file under the mapping relationship is taken as the target file.

4. An apparatus for processing a file, characterized by, The device comprises: A to-be-stored file acquisition module configured to acquire at least one to-be-stored file; A word segmentation processing module configured to perform word segmentation processing on each to-be-stored file respectively, and determine a word segmentation set corresponding to each to-be-stored file; A target word segmentation determination module configured to determine a target word segmentation corresponding to the to-be-stored file based on a variance contribution value of each word segmentation in the word segmentation set; A word frequency library construction module configured to construct a word frequency library based on the target word segmentation; A to-be-stored file storage module configured to store the to-be-stored file corresponding to the target word segmentation in the word frequency library based on the target word segmentation; The target word segmentation determination module is further configured to determine a target word segmentation corresponding to the to-be-stored file based on a variance contribution value of each word segmentation in the word segmentation set, comprising: For any current to-be-stored file and any current word segmentation in the current to-be-stored file, the following steps are performed to determine a target word segmentation corresponding to the current to-be-stored file: Acquire the frequency of the current word segmentation in the current to-be-stored file; Determine the variance contribution value of the current word segmentation based on the frequency; Compare the current word segmentation in the word segmentation set with a preset variance contribution threshold to obtain a comparison result; In the case that the comparison result represents that the variance contribution value of the current word segmentation is greater than or equal to the preset variance contribution threshold, the current word segmentation is determined as the target word segmentation of the current to-be-stored file; The to-be-stored file storage module is specifically configured to: Acquire a first preset parameter corresponding to the to-be-stored file; Construct a first preset matrix vector of the to-be-stored file based on the first preset parameter; Perform vector conversion on the first preset matrix vector to obtain a target vector matrix corresponding to the to-be-stored file; Perform calculation on the target vector matrix, and construct a first target Bloom filter based on the calculation result; Store the target word segmentation and the to-be-stored file corresponding to the target word segmentation according to the storage structure of the first target Bloom filter based on the first target Bloom filter; The variance contribution value is expressed by the following formula: ; wherein ; ; ; Wherein, S is the variance contribution value of the word segmentation, is the frequency of the word segmentation in the file to be stored; is the vector corresponding to the word segmentation, which is a p*m dimensional matrix; is the inverse of the vector corresponding to the word segmentation; i is the number of word segmentation in the file to be stored, i=1, 2, 3, …P; A is the word segmentation set; is the hash reference value corresponding to a file to be stored, which is a one-dimensional numerical value set in advance; is the numerical value obtained after taking the absolute value of diag represents taking the absolute value.

5. A file processing apparatus characterized by comprising: The device is used for retrieving a target file, and the target file is obtained by using the device of claim 4, which comprises: The retrieval condition receiving module is configured to receive a retrieval condition for retrieving a target file. The retrieval vector determining module is configured to encode the retrieval condition to obtain a retrieval vector corresponding to the retrieval condition. The security shield determining module is configured to calculate the retrieval vector, insert a calculation result into a second preset Bloom filter, and obtain a second security shield corresponding to the retrieval condition. The target file determining module is configured to determine the target file based on the second security shield. The target file feedback module is configured to return the target file to a client. The target file determining module is specifically configured to: In a case where a first security shield corresponding to the second security shield is retrieved, determine a storage file corresponding to the second security shield as the target file, wherein the first security shield is a security shield constructed based on a secret key corresponding to the target file when the target file is stored. In a case where the first security shield corresponding to the second security shield is not retrieved, calculate a quantity product of the second security shield and each segmented word in a word frequency library, wherein the word frequency library is established based on a word frequency matrix; sort the quantity products in a descending order of values of the quantity products, filter the quantity products, and obtain a preset number of segmented words in a front rank; and determine storage files corresponding to the segmented words as the target file.

6. An electronic device, comprising: The processor, the memory, and the program or instructions stored on the memory and executable on the processor are provided, and the program or instructions are executed by the processor to implement the steps of the file processing method of claim 1 and / or the steps of the file processing method of any one of claims 2-3.

7. A readable storage medium characterized by, The readable storage medium stores the program or instructions, and the program or instructions are executed by the processor to implement the steps of the file processing method of claim 1 and / or the steps of the file processing method of any one of claims 2-3.

Citation Information

Patent Citations

  • Searchable encryption method and system for supporting fuzzy retrieval of word morphology and word meaning in cloud environments

    CN108712366A

  • Electronic file processing method and device, electronic equipment and machine readable medium

    CN111782601A