File processing method and device, equipment, medium and product
By scanning, semantic analysis and matching cloud storage files, and isolating abnormal files, the challenges of cloud storage data security management are solved and higher file processing accuracy and security are achieved.
Patent Information
- Application Number
- CN202311355825.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2025-04-25
AI Technical Summary
How to effectively manage cloud-stored files to ensure data security and prevent file leakage.
In response to the trigger of the scanning task, the files in the storage space are scanned, the text content is obtained and semantic analysis is performed, the keywords and text content are matched, and if the matching is done, the source processing is performed and the target file is isolated.
Improve the accuracy and security of file processing, effectively isolate potential abnormal files, and enhance data security.
Smart Images

Figure CN119884040A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file processing method, a file processing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the continuous evolution of Internet technology, cloud storage services have become the preferred data storage method for many individuals and enterprises. However, with this comes an urgent need for cloud storage data security. Taking the use of cloud storage by enterprises as an example, employees store various types of files in the cloud. If timely file detection, identification, response and intelligent isolation are not implemented, file leakage may occur, thereby endangering the security of enterprise data. Therefore, how to effectively manage cloud storage files to ensure data security has become an urgent problem that needs to be solved. Summary of the invention
[0003] The embodiments of the present application provide a file processing method, a file processing device, an electronic device, a computer-readable storage medium, and a computer program product, which can improve the accuracy and security of scanning tasks, isolate potential abnormal files, and improve security.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a file processing method is provided, including: in response to the triggering of a scanning task, scanning files in a storage space to determine the scanned files corresponding to the scanning task; obtaining the text content corresponding to each scanned file, and obtaining the target scanning words corresponding to the scanning task; performing semantic analysis on the target scanning words to obtain keywords, and matching the keywords with the text content according to the target text matching strategy corresponding to the scanning task; if the text content contains target text content that matches the keyword, tracing the target text content to determine the target file to which the target text content belongs, and isolating the target file.
[0006] According to one aspect of an embodiment of the present application, a file processing device is provided, the device comprising: a scanning module, for scanning files in a storage space in response to the triggering of a scanning task, so as to determine the scanning files corresponding to the scanning task; an acquisition module, for acquiring text contents corresponding to each scanning file, and acquiring target scanning words corresponding to the scanning task; a matching module, for performing semantic analysis processing on the target scanning words to obtain keywords, and matching the keywords with the text contents according to the target text matching strategy corresponding to the scanning task; an isolation module, for tracing the target text contents to determine the target file to which the target text contents belong, and isolating the target file, if the text content contains target text contents matching the keywords.
[0007] In one embodiment of the present application, the device also includes a management and control module, which is used to obtain the management authority of the party to which the access operation belongs when an access operation to the scanning vocabulary library is detected; if the management authority includes access rights to the scanning vocabulary library, the scanning words in the scanning vocabulary library are updated according to the operation content corresponding to the access operation.
[0008] In one embodiment of the present application, the device also includes a determination module, which is used to obtain the word importance corresponding to the target scanning word based on the word index information of the target scanning word in the historical scanning task, and the word index information is used to describe the execution status of the target scanning word in the historical scanning task; obtain the mapping relationship between the preset word importance and the file matching strategy, and the word importance is positively correlated with the number of the file matching strategies; determine the target text matching strategy based on the mapping relationship and the word importance corresponding to the target scanning word.
[0009] In one embodiment of the present application, the determination module is further used to obtain the historical trigger times and historical trust times corresponding to the target scan word in the historical scan authentication within a preset historical time period; calculate the proportion of the historical trust times to the historical trigger times, and determine the word importance of the target scan word based on the proportion.
[0010] In one embodiment of the present application, the matching module is further used to perform word segmentation processing on the target scan word to obtain a first analysis word, and to perform derive processing on the first analysis word to obtain a second analysis word; to obtain a text word with similar semantics to the target scan word, and to obtain a third analysis word based on the text word whose semantic similarity is greater than a preset similarity threshold; and to obtain the keyword based on the first analysis word, the second analysis word and the third analysis word.
[0011] In one embodiment of the present application, the matching module is further used to compare each text word in the text content with the keyword, and use the text content to which the text word that is exactly the same as the keyword belongs as the target text content; for a first candidate text word that is partially identical to the keyword, calculate the similarity between the first candidate text word and the keyword, and use the text content to which the first candidate text word belongs whose similarity is greater than a first preset similarity threshold as the target text content.
[0012] In one embodiment of the present application, the matching module is further used to obtain the context information of the second candidate text word in the text content whose similarity is less than the first preset similarity threshold and greater than the second preset similarity threshold according to a preset context window size; calculate the matching score between the context information of the second candidate text word and the keyword, and search for a target candidate text word from the second candidate text words according to the matching score; and use the text content to which the target candidate text word belongs as the target text content.
[0013] In one embodiment of the present application, the storage space includes multiple file storage spaces; the scanning module is further used to obtain the account information of the scanning task triggering party, and verify the space permissions of each of the multiple file storage spaces based on the account information to determine the scanning space corresponding to the scanning task; scan the files in the scanning space, and use the files that meet the content extraction as the scanning files.
[0014] In one embodiment of the present application, the acquisition module is further used to obtain the scanning permissions of the scanning task triggering party and the file permissions of each scanned file; if the scanning permissions do not match the file permissions of the scanned file, the file name of the scanned file is used as the text content of the scanned file; if the scanning permissions match the file permissions of the scanned file, the file information of the scanned file is extracted, and the text information and the file name of the scanned file are used as the text content.
[0015] In one embodiment of the present application, the acquisition module is further used to obtain the file type of the scanned file; determine the target extraction strategy corresponding to the scanned file according to a preset mapping table between the file type and the extraction strategy; and extract the content of the scanned file according to the target extraction strategy to obtain the file information of the scanned file.
[0016] In one embodiment of the present application, the device also includes a viewing module for highlighting the text content in the target file that matches the target scanning word in response to a file viewing operation on the target file; obtaining the file information field of the target file, and displaying the processed target file in association with the file information field; trusting or deleting the target file in response to a processing operation on the target file; and if the target file is trusted, updating the trust count of the target scanning word corresponding to the target file.
[0017] According to one aspect of an embodiment of the present application, an embodiment of the present application provides an electronic device, comprising one or more processors; a storage device for storing one or more computer programs, when the one or more computer programs are executed by the one or more processors, the electronic device implements the file processing method as described above.
[0018] According to one aspect of an embodiment of the present application, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device executes the file processing method as described above.
[0019] According to one aspect of an embodiment of the present application, an embodiment of the present application provides a computer program product, including a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the file processing method as described above.
[0020] In the technical solution provided in the embodiments of the present application, in response to the triggering of a scanning task, by scanning the files in the storage space to determine the scanning files corresponding to the scanning task, the files required for the scanning task can be effectively identified; then, the text content corresponding to each scanning file is obtained, and the target scanning word corresponding to the scanning task is obtained; by performing semantic analysis on the target scanning word, keywords that better capture the meaning of the target scanning word can be obtained to ensure a higher matching accuracy, and then the keywords are matched with the text content according to the target text matching strategy corresponding to the scanning task, and the matching rules can be customized according to different scanning task requirements to make the matching more targeted and adapt to various needs; if the text content contains target text content that matches the keyword, the target file to which the text content belongs can be determined by tracing the target text content, thereby achieving isolation processing of the file, which helps to isolate potential abnormal files and improve security.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0023] Figure 2 is a flowchart of a file processing method shown in an exemplary embodiment of the present application;
[0024] Figure 3 is a schematic diagram of another file processing method shown in an exemplary embodiment of the present application;
[0025] Figure 4 is a schematic diagram of another file processing method shown in an exemplary embodiment of the present application;
[0026] Figure 5 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0027] Figure 6 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0028] Figure 7 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0029] Figure 8 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0030] Fig. 9 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0031] Fig.10 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0032] Fig.11 is a flowchart of another file processing method shown in an exemplary embodiment of the present application;
[0033] Fig.12 is a flowchart of a file processing method shown in another exemplary embodiment of the present application;
[0034] Fig.13 is a schematic diagram of an interface for highlight processing shown in another exemplary embodiment of the present application;
[0035] Fig.14 is a schematic diagram of an interface for scanning a vocabulary library according to another exemplary embodiment of the present application;
[0036] Fig.15is a schematic diagram of an interface for adding a scan word according to another exemplary embodiment of the present application;
[0037] Fig.16 is a schematic diagram of an interface for completing the addition of scanned words shown in another exemplary embodiment of the present application;
[0038] Fig.17 is a schematic diagram of an interface for displaying isolated files, shown in another exemplary embodiment of the present application;
[0039] Fig.18 is another schematic diagram of an interface for displaying isolated files according to an exemplary embodiment of the present application;
[0040] Fig.19 is a flowchart of file processing shown in another exemplary embodiment of the present application;
[0041] Fig. 20 is a flowchart of text extraction shown in another exemplary embodiment of the present application;
[0042] Fig.21 is a flowchart of text extraction of different file types shown in another exemplary embodiment of the present application;
[0043] Fig. 22 is a schematic diagram of uploading and saving text content shown in another exemplary embodiment of the present application;
[0044] Fig.23 is a schematic diagram of a full-text matching process shown in another exemplary embodiment of the present application;
[0045] Fig.24 is a schematic diagram of another full-text matching process shown in another exemplary embodiment of the present application;
[0046] Fig.25 is a structural block diagram of a file processing device shown in an exemplary embodiment of the present application;
[0047] Fig.26 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0048] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0049] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0050] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0051] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0052] The following is a detailed description of the technical solution of the embodiment of the present application in combination with the implementation environment:
[0053] See also Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a terminal 10, a server 20 and a network 30.
[0054] Terminal 10 is used to scan the files in the storage space in response to the triggering of the scanning task to determine the scanning files corresponding to the scanning task; obtain the text content corresponding to each scanning file, and obtain the target scanning word corresponding to the scanning task, and send the text content and the target scanning word to the server for processing.
[0055] The server 20 is used to perform semantic analysis on the target scan words to obtain keywords, and match the keywords with the text content according to the target text matching strategy corresponding to the scanning task; if the text content contains target text content that matches the keywords, the target text content is traced to determine the target file to which the target text content belongs, and the target file is isolated.
[0056] In other embodiments of the present application, the file processing method can also be executed only by the terminal or the server. For example, after the terminal or the server obtains the corresponding text content and the target scanning word, it performs semantic analysis on the target scanning word to obtain keywords, and matches the keywords with the text content according to the target text matching strategy corresponding to the scanning task, and isolates the target file containing the target text content matching the keyword.
[0057] Among them, the aforementioned terminal 10 can be any electronic device that can display content, such as a smart phone, a tablet, a laptop computer, a computer, an intelligent voice interaction device, a smart home appliance, a terminal specifically used in a vehicle, an aircraft, etc. The server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and intelligent platforms. There is no restriction on this here.
[0058] The terminal 10 and the server 20 establish a communication connection in advance through the network 30, so that the terminal 10 and the server 20 can communicate with each other through the network 30. The network 30 can be a wired network or a wireless network, which is not limited here.
[0059] It should be noted that in the specific implementation of this application, the files or scanned words are related to the use objects. When the embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the use objects, and the collection, use and processing of relevant data need to comply with the relevant laws and regulations and standards of the relevant countries and regions.
[0060] The following is a detailed description of various implementation details of the technical solution of the embodiment of the present application:
[0061] like Figure 2 As shown, Figure 2 is a flowchart of a file processing method shown in an embodiment of the present application, which can be applied to Figure 1 In the implementation environment shown, the method may be executed by a terminal, and the file processing method may include steps S210 to S240, which are described in detail as follows:
[0062] S210 . In response to triggering of a scan task, scan files in a storage space to determine scan files corresponding to the scan task.
[0063] In the embodiment of the present application, the scanning task is used to scan files in the storage space and quickly identify files that may be abnormal.
[0064] It is worth noting that before scanning files in a storage space, it is necessary to obtain authorization from the owner of the storage space in advance. When scanning files involving personal space, the owner of the personal space will be informed of the corresponding information processing rules, and the owner of the personal space will be asked for their separate consent. The relevant information will be processed in strict accordance with the requirements of laws and regulations and the personal information processing rules, and technical measures will be taken to ensure the security of relevant data.
[0065] In one example, the files in the storage space are scanned, and the files from which the text content can be extracted can be used as the scanned files corresponding to the scanning task. In one example, the scanning task carries the storage space to be scanned, so the files in the storage space to be scanned are scanned, and the files from which the text content can be extracted can be used as the scanned files corresponding to the scanning task. In another example, the corresponding file description to be scanned in the scanning task scans all the files in the storage space, and the files corresponding to the file description are used as the scanned files.
[0066] In the embodiment of the present application, the scanning task can be automatically triggered at a scheduled time, or it can be triggered after a scanning operation is detected, which is not limited here.
[0067] S220: Obtain text content corresponding to each scanned file, and obtain target scan words corresponding to the scan task.
[0068] In an embodiment of the present application, in order to identify files that may contain abnormalities, it is necessary to extract the text content corresponding to the file from the file, wherein the text content corresponding to the scanned file in the present application includes the file name of the scanned file, the text information recorded in the scanned file, etc.
[0069] The scanning word is a predefined group of words, phrases or terms used to find specific information or key information in text data; the target scanning word corresponding to the scanning task is the descriptive word related to the scanning task, for example, the target scanning word is the specified scanning word selected from the scanning word library when the scanning task is triggered; for example, the target scanning word is all predefined descriptive words.
[0070] S230: Perform semantic analysis on the target scan word to obtain keywords, and match the keywords with the text content according to the target text matching strategy corresponding to the scanning task.
[0071] In an embodiment of the present application, in order to provide matching accuracy, in an embodiment of the present application, semantic analysis is performed on the target scan word to obtain keywords, wherein semantic analysis is a natural language processing technology that aims to understand the meaning and context in the text, involving the understanding of word meanings, analysis of vocabulary and syntactic structure, so as to more accurately understand the text content, and then the keywords obtained by the semantic analysis can better capture the meaning of the target scan word, wherein the keyword includes the target scan word.
[0072] The target text matching strategy corresponding to the scanning task is used to describe the matching method between the corresponding words and the text content under the scanning task. When matching the keywords and the text content, the matching is performed according to the corresponding matching method. Different text matching strategies may be pre-assigned to different scanning tasks, and then the target file matching strategy corresponding to the scanning task is selected from multiple text matching strategies according to the scanning requirements of the scanning task. If the scanning requirement is high, at least two file matching strategies are selected from multiple text matching strategies as the target file matching strategies. If the scanning requirement is low, the default text matching strategy is used as the target file matching strategy. The higher the importance and confidentiality of the scanned text, the higher the scanning requirement. The target text matching strategy in the embodiment of the present application may be one or more, which is not limited here.
[0073] S240: If the text content contains target text content that matches the keyword, the target text content is traced to determine the target file to which the target text content belongs, and the target file is isolated.
[0074] In an embodiment of the present application, if the text content contains target text content that matches the keyword, it means that the target text content may be abnormal. At this time, the target text content is traced and the target file to which the target text content belongs is checked. The target file may contain abnormal files, so the target file needs to be isolated.
[0075] In one example, after obtaining the text content corresponding to each scanned file, the corresponding text content is classified and saved based on the file type of each scanned file. Once the text content matching the keyword is found, it is necessary to trace back to the source file, where each classified text content usually has a unique identifier, and the associated identifier is used to find the original target file.
[0076] In an embodiment of the present application, in response to the triggering of a scanning task, by scanning the files in the storage space to determine the scanning files corresponding to the scanning task, the files required for the scanning task can be effectively identified; then, the text content corresponding to each scanning file is obtained, and the target scanning word corresponding to the scanning task is obtained; by performing semantic analysis on the target scanning word, keywords that better capture the meaning of the target scanning word can be obtained to ensure a higher matching accuracy, and then the keywords are matched with the text content according to the target text matching strategy corresponding to the scanning task, and the matching rules can be customized according to different scanning task requirements to make the matching more targeted and adapt to various needs; if the text content contains target text content that matches the keyword, the target file to which the text content belongs can be determined by tracing the target text content, thereby achieving isolation processing of the file, which helps to isolate potential abnormal files and improve security.
[0077] In one embodiment of the present application, another file processing method is provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Figure 3 As shown, the file processing method is Figure 2 Based on S210 to S240 shown in Figure 2 Steps S310 to S320 are added before step S220 shown in FIG. 1 ; steps S310 to S320 are described in detail as follows:
[0078] S310: When an access operation to a scanning vocabulary is detected, the management authority of the party to which the access operation belongs is obtained.
[0079] In an embodiment of the present application, a scanning vocabulary library is preset, and the scanning vocabulary library includes multiple scanning words; wherein, one scanning vocabulary library may include multiple types of scanning words, or different scanning vocabulary libraries may correspond to different types of scanning words, such as scanning vocabulary library 1 corresponds to text scanning words, scanning vocabulary library 2 corresponds to digital scanning words, scanning vocabulary library 3 corresponds to symbol scanning words, and so on.
[0080] The terminal needs to detect access operations to the scanning vocabulary, which include but are not limited to viewing, querying, modifying, adding or deleting operations, and obtain the management authority of the party to which the access operation belongs. It can obtain the management authority from the account information of the party to which the access operation belongs. The management authority is used to indicate the control and modification authority of the scanning vocabulary.
[0081] S320: If the management authority includes access rights to the scanning word library, the scanning words in the scanning word library are updated according to the operation content corresponding to the access operation.
[0082] In an embodiment of the present application, access rights to the scanning vocabulary library include the permission to adjust the scanning words in the scanning vocabulary library, and the scanning words in the scanning vocabulary library are updated based on the access operation, such as adding new scanning words to expand the detection function, deleting words that are no longer needed, or modifying existing words to improve the accuracy of detection; for example, the access operation carries specific operation content for the scanning vocabulary library, such as adding the scanning vocabulary library "AB" to the scanning library.
[0083] In one example, management permissions also include the way the access operation party modifies the scanning vocabulary. Permission 1 indicates permission to only add scanning words in the scanning vocabulary, permission 2 indicates permission to only delete or modify scanning words in the scanning vocabulary, and so on.
[0084] In one example, after updating the scanning vocabulary library according to the access operation of the party to which the access operation belongs, the terminal can also record the update log, that is, who accessed the scanning vocabulary library and when, and what modifications were made to it, and then determine whether the access operation of the party to which the access operation belongs is an abnormal operation based on the update log, such as comparing the current access operation with the previous historical access operation in the update log. If the operation difference between the access operation and the historical access operation is too large, the update operation corresponding to the access operation is canceled. For example, if the current access operation is to delete all scanning words in the scanning vocabulary library, and the historical access operation is to delete a scanning word, the difference in the word deletion amount between the two is greater than the preset amount threshold, and all deleted scanning words are restored.
[0085] It should be noted that Figure 3 For more detailed description of steps S210 to S240 shown in Figure 2 The steps S210 to S240 shown are not described in detail here.
[0086] In the embodiment of the present application, it is ensured that access to and modification of the scanning vocabulary is subject to strict control and authority management, and only objects with management authority can make changes to the scanning vocabulary to prevent malicious operations, which helps to protect the integrity and security of the data.
[0087] The present application embodiment provides another file processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Figure 4 As shown, the file processing method is Figure 2 Based on the above, steps S410 to S430 are added. Steps S410 to S430 are described in detail as follows:
[0088] S410 , obtaining the word importance corresponding to the target scanning word according to the word index information of the target scanning word in the historical scanning task.
[0089] In an embodiment of the present application, word indicator information is used to describe the execution status of the target scanning word in the historical scanning task. The actual execution information of the target scanning word in the actual scanning task can be obtained through the word indicator information, and then the word indicator information can be used to accurately evaluate the word importance actually corresponding to the target scanning word. The word importance refers to the importance of the word in the matching text matching task.
[0090] S420: Obtain a preset mapping relationship between word importance and file matching strategies, where word importance is positively correlated with the number of file matching strategies.
[0091] In an embodiment of the present application, a mapping relationship between word importance and file matching strategies is preset in the terminal, and the word importance is positively correlated with the number of file matching strategies. For example, when the word importance is level one, the corresponding number of file matching strategies is 1, and when the word importance is level two, the corresponding number of file matching strategies is 2, and so on.
[0092] The mapping relationship includes multiple file matching strategies, including precise matching, fuzzy matching, semantic matching, etc.
[0093] In one example, word importance is negatively correlated with the matching strictness of the file matching strategy, that is, the greater the word importance, the smaller the matching strictness of the corresponding file matching strategy, where the matching strictness refers to the strictness of the matching conditions in the matching task, such as the matching strictness of exact matching is greater than the matching strictness of fuzzy matching.
[0094] S430: Determine a target text matching strategy according to the mapping relationship and the word importance corresponding to the target scan word.
[0095] In an embodiment of the present application, the word importance corresponding to the target scan word can be compared one by one with the importance of each word in the mapping relationship. If the word importance corresponding to the target scan word completely matches the word importance in the mapping relationship, the file matching strategy corresponding to the completely matching word importance in the mapping relationship will be used as the target file matching strategy.
[0096] It should be noted that Figure 4 For a detailed description of steps S210 to S240 shown in Figure 2 The steps S210 to S240 shown are not described in detail here.
[0097] In the embodiment of the present application, the word importance is accurately reflected according to the word index information of the target scan word, and then an appropriate matching strategy is selected based on the mapping of word importance and file matching strategy, so that the matching process is more accurate to meet the actual matching needs.
[0098] The present application also provides another file processing method, which can be applied to Figure 1In the implementation environment shown, the method can be executed by a terminal, such as Figure 5 As shown, in Figure 4 Based on the basis shown in Figure 4 The step S410 shown in FIG. 1 is expanded into steps S510 to S520. Steps S510 to S520 are described in detail as follows:
[0099] S510: Obtain the historical trigger times and historical trust times corresponding to the target scanning word within a preset historical time period.
[0100] In an embodiment of the present application, each time the target scanning word is triggered for text, the triggering number of the target scanning word is updated; when the scanning task triggers the trust operation of the target file corresponding to the target scanning word, the trust number is updated.
[0101] The preset historical time period can be flexibly adjusted according to actual needs. For example, in the embodiment of the present application, the preset historical time period is the day closest to the current time. The historical trigger times corresponding to the target scan word are used to characterize the frequency with which the target scan word has been triggered or matched in the past period of time. The historical trust times are used to characterize the trust of other relevant indicators in the target scan word within the historical time period. The trust times can be determined based on the trust operation of the triggering party or based on the expert score.
[0102] S520: Calculate the ratio of the historical trust times to the historical trigger times, and determine the word importance of the target scanning word according to the ratio.
[0103] It can be understood that the historical trust times should be less than or equal to the historical trigger times; the terminal can calculate the ratio of the historical trust times to the historical trigger times to obtain a percentage value, which reflects the trust of the target scanning word, that is, the degree of trust in the historical text matching task. If the target scanning word has a high triggering time but a low trust time, it means that the target scanning word is trusted to a low degree.
[0104] In one example, the calculated proportion is compared with a preset proportion range to determine the word importance, which is the importance of the word in the matching text matching task, wherein the larger the proportion, the lower the word importance of the target scan word, and they are more trusted in the historical text matching task.
[0105] It should be noted that Figure 5 For other detailed descriptions of steps S210 to S240 and S420 to S430 shown in Figure 4 Steps S210 to S240 and S420 to S430 shown in FIG. 1 are not described in detail here.
[0106] In the embodiment of the present application, the importance of a word can be accurately determined through the relationship between the number of triggers and the number of trusts of a target scan word in a specific historical time period, so as to facilitate the subsequent guidance of the accuracy and effectiveness of text matching.
[0107] It is worth noting that in one embodiment of the present application, another file processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Figure 6 As shown, the file processing method is Figure 2 Based on the above, step S230 is expanded to S610 to S630. Steps S610 to S630 are described in detail as follows:
[0108] S610: Perform word segmentation processing on the target scan word to obtain a first analysis word, and perform derivation processing on the first analysis word to obtain a second analysis word.
[0109] In an embodiment of the present application, the target scan word is segmented, wherein the target scan word can be segmented according to the language and actual needs, such as dividing the target scan word into multiple words according to spaces, punctuation marks or language-specific rules to obtain a first analysis word.
[0110] Derivation processing refers to the process of deriving another lexical form from one lexical form, and the derivation processing includes root changes, tense changes, plural changes, etc. The scope of keywords is expanded through derivation processing to include multiple forms of second analysis words related to the first analysis word. For example, a word in the target scanning word: "processing" can be derived into its variants through derivation processing, such as "processed", "processed", etc.
[0111] S620: Acquire text words that are semantically similar to the target scan word, and obtain a third analysis word based on text words whose semantic similarity is greater than a preset similarity threshold.
[0112] In an embodiment of the present application, text words that are semantically similar to the target scan word include synonyms, near-synonyms or related concepts that are relevant to the target scan word, and the semantic similarity between the target scan word and each text word is calculated. The semantic similarity can be determined by the distance between the word vector of the target scan word and the word vector of the text word.
[0113] In one example, text words with semantic similarity greater than a preset similarity threshold may be used as third analysis words, and the preset similarity threshold may be flexibly adjusted according to actual needs.
[0114] S630: Obtain keywords according to the first analysis word, the second analysis word, and the third analysis word, and match the keywords with the text content according to the target text matching strategy corresponding to the scanning task.
[0115] In the embodiment of the present application, repeated words in the first analysis word, the second analysis word and the third analysis word are first deleted to avoid the appearance of the same words, and then the first analysis word, the second analysis word and the third analysis word are all used as keywords.
[0116] In one example, after deleting duplicate words, the total word count of the first analysis word, the second analysis word, and the third analysis word can also be determined. If the total word count is too large, it will take more matching time. Therefore, when the total word count is greater than the preset word count threshold, the first analysis word, the second analysis word, and the third analysis word are screened for the second time, such as assigning different weights to semantic similarity processing, derivation processing, and word segmentation processing, filtering out analysis words with the lowest first specified weight values, and filtering out analysis words in the middle of the second specified weight values. For example, if the weight value of the word segmentation processing is the lowest and the weight value of the derivation processing is in the middle, two first analysis words are filtered out, one second analysis word is filtered out, and then the analysis words obtained after the secondary screening are used as keywords.
[0117] It should be noted that Figure 6 For other detailed descriptions of steps S210 to S220 and S240 shown in Figure 2 The steps S210 to S220 and S240 shown are not described in detail here.
[0118] In the embodiments of the present application, word segmentation processing, derivation processing and semantic similarity processing can better understand the meaning of the target scan word, comprehensively consider the matching intention, and provide more accurate search results, rather than simple text comparison.
[0119] In one embodiment of the present application, another file processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Figure 7 As shown, the file processing method is Figure 1 Based on the above, S230 is expanded to S710~S720. S710~S720 are described in detail as follows:
[0120] S710: Perform semantic analysis on the target scanned words to obtain keywords, compare each text word in the text content with the keywords, and use the text content to which the text words that are completely identical to the keywords belong as the target text content.
[0121] S720: For a first candidate text word that is partially identical to the keyword, calculate the similarity between the first candidate text word and the keyword, and use the text content to which the first candidate text word with a similarity greater than a first preset similarity threshold belongs as the target text content.
[0122] In an embodiment of the present application, each text word in any text content is obtained, and each text word in the text content is compared with a keyword. If a text word is exactly the same as the keyword, it means that the text word and the keyword are precisely matched, and then the text content to which the text word belongs is used as the target text content, wherein complete identity means that the text word and the keyword are completely consistent in spelling, capitalization, spaces, order, etc.
[0123] The text word that is identical to the keyword part is used as the first candidate text word, wherein the identical part between the first candidate text word and the keyword is greater than a preset threshold, such as the identical part accounts for more than 1 / 3 of the whole, such as the keyword includes 4 characters, the identical part between the first candidate text word and the keyword is 3 characters, and the identical part is 3 / 4. In the embodiment of the present application, the similarity between the first candidate text word and the keyword is calculated, and the similarity includes pronunciation similarity and semantic similarity, and then the text content to which the first candidate text word with a similarity greater than the first preset similarity threshold belongs is used as the target text content. The first preset similarity threshold can be flexibly adjusted according to actual needs, such as 80%.
[0124] It should be noted that Figure 7 For other detailed descriptions of steps S210 to S220 and S240 shown in Figure 2 The steps S210 to S220 and S240 shown are not described in detail here.
[0125] In one embodiment of the present application, another file processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Figure 8 As shown, the file processing method is Figure 7 Based on the above, S810 to S830 are added. S810 to S830 are described in detail as follows:
[0126] S810. For a second candidate text word whose similarity in the text content is less than a first preset similarity threshold and greater than a second preset similarity threshold, obtain context information of the second candidate text word according to a preset context window size.
[0127] In order to improve the accuracy and comprehensiveness of the matching, in the embodiment of the present application, a second matching may be performed on the text content whose similarity reaches the first preset similarity threshold.
[0128] In an embodiment of the present application, for a second candidate text word in the text content whose similarity is less than the first preset similarity threshold and the second preset similarity threshold, it is necessary to select the target text content from the second candidate text words, wherein the second preset similarity threshold is less than the first preset similarity threshold, such as the second preset similarity threshold is 60%.
[0129] Among them, the preset context window is a fixed number, which is used to describe the text environment around the candidate text word. For example, if the context window is 4, the 4 words before and after the candidate text word are obtained as context information; the size of the context window can be set according to specific application requirements.
[0130] S820: Calculate a matching score between the context information of the second candidate text word and the keyword, and search for a target candidate text word from the second candidate text words according to the matching score.
[0131] S830: Taking the text content to which the target candidate text word belongs as the target text content.
[0132] In an embodiment of the present application, the matching score between the context information of the second candidate text word and the keyword can be calculated based on multiple dimensions, such as calculating the matching score from three dimensions: vocabulary, grammar, and semantics. For example, the vocabulary matching is determined based on the similarity or correlation between the keyword and the context information of the second candidate text word; the grammatical matching is calculated based on the grammatical relationship between the keyword and the words in the context information of the second candidate text word, such as the dependency relationship; the semantic matching is calculated based on the semantic association between the keyword and the words in the context information of the second candidate text word, wherein the calculation is based on a pre-trained deep learning model (such as BERT). In addition, the position of the keyword in the context information of the second candidate text word can also be considered. It is usually more important to be located in the center of the context, and different weights can be assigned to words in different positions.
[0133] In one example, weights can be set for different matching factors to reflect their importance in the matching calculation, and then the scores of the various matching factors are combined to obtain a total matching score for the context information of the keyword and the second candidate text word. The total matching score is then compared with a preset threshold to determine whether to select the target candidate text word from the second candidate text words; for example, a second candidate text word with a total matching score higher than the preset threshold is selected as the target candidate text word, and then the text content to which the target candidate text word belongs is selected as the target text content.
[0134] It should be noted that Figure 8 For other detailed descriptions of steps S210-S220, S710-S720, and S240 shown in Figure 7 The steps S210 to S220, S710 to S720, and S240 shown are not repeated here.
[0135] In the embodiments of the present application, the combined use of semantic matching and context matching can more accurately determine the relevance between keywords and text content, thereby achieving more effective and comprehensive text matching.
[0136] In one embodiment of the present application, another file processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Fig. 9 As shown, the file processing method is Figure 2 Based on the information shown in , step S210 is expanded into steps S910 to S920. The storage space includes multiple file storage spaces, which are storage areas for storing various types of files. The multiple file storage spaces include enterprise space (for internal enterprise file storage), enterprise collaboration space (for project or collaboration team file storage), and personal space (personal cloud disk, personal folder, etc.). Steps S910 to S920 are described in detail as follows:
[0137] S910. In response to triggering of a scan task, obtain account information of a party triggering the scan task, and verify space permissions of each of a plurality of file storage spaces according to the account information to determine a scan space corresponding to the scan task.
[0138] S920: Scan the files in the scan space, and use the files that meet the requirements for content extraction as scanned files.
[0139] In the embodiment of the present application, different file storage spaces correspond to different space permissions. For example, the space permissions of the enterprise space are for enterprise employees to access, the enterprise collaboration space is for enterprise project employees to access, and the personal space is for individuals or authorized persons to access.
[0140] After triggering the scanning task, it is necessary to determine which space's files should be scanned. The terminal needs to first obtain the account information of the party that triggered the scanning task. The account information includes a unique account ID and an account password. Then, the space permissions of each file storage space are verified based on the account information to determine whether there is sufficient permission to enter the corresponding space. The space with permission to enter will be used as the scanning space corresponding to the scanning task.
[0141] In one example, the account role can be determined by the unique account identifier, and then it can be verified whether the account role corresponds to the space role of each file storage space. For example, if the account role is Employee 1 of the Marketing Department of Company A, it corresponds to the Company A Space, the Enterprise Collaboration Marketing Department Space, and the Personal 1 Space. The account password is then matched with the space password of each file storage space. If they correspond, it is determined that the account information has sufficient authority to enter the corresponding space.
[0142] In another example, different file storage spaces have different specific authentication methods. For example, for personal spaces, basic account and password authentication is used; for corporate spaces, in addition to basic account and password authentication, a second authentication factor, such as a dynamic verification code, can also be included; for corporate collaboration spaces, internal authentication can be used.
[0143] After determining the scanning space, the terminal may scan all files in the scanning space and take files from which text content can be extracted as scanned files.
[0144] It should be noted that Fig. 9 For more detailed information on steps S220 to S240 shown in Figure 2 Steps S220 to S240 are shown and will not be described in detail here.
[0145] In an embodiment of the present application, the corresponding scanning space is determined based on the account information of the scanning task triggering party and the verification of the space permissions of the storage space, which can ensure the compliance of the file scanning while ensuring the security of the file.
[0146] In one embodiment of the present application, another file processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Fig.10 As shown, the file processing method is Figure 2 Based on the information shown in , steps S1010 to S1030 are extended in S220, and steps S1010 to S1030 are described in detail as follows:
[0147] S1010: Obtain the scanning authority of the scanning task triggering party and the file authority of each scanned file.
[0148] In the embodiment of the present application, the scanned file can be all files in all storage spaces. The files have corresponding file permissions, which are used to characterize the importance of their text content. They are set by the file uploader or the file manager. Different scanned files have different corresponding file permissions. For example, the file permissions of company regulations files are smaller than the file permissions of company financial files. The scan permissions of the scan task triggering party are used to characterize the permissions of the scan task triggering party to process files, including the text content that can be viewed and the specific processing method for the text content. The scan permissions can be determined based on the account information of the scan task triggering party, which can be a scan permission assigned in advance by the manager.
[0149] S1020: If the scanning permission does not match the file permission of the scanned file, the file name of the scanned file is used as the text content of the scanned file, and a target scanning word corresponding to the scanning task is obtained.
[0150] S1030. If the scanning permission matches the file right of the scanned file, the file information of the scanned file is extracted, the text information and the file name of the scanned file are used as the text content, and the target scanning word corresponding to the scanning task is obtained.
[0151] In an embodiment of the present application, the scanning rights are matched with the file rights of the scanned file. If the scanning rights do not match the file rights of the scanned file, it means that the scanning task triggering party does not have the authority to process the scanned file. The scanning task triggering party can only obtain the currently known information of the scanned file, but cannot obtain the text content in the scanned file. Therefore, the file name of the scanned file is used as the text content of the scanned file.
[0152] In an embodiment of the present application, if the scan rights match the file rights of the scanned file, it means that the scanning task triggering party has the authority to process and obtain the text content in the scanned file. Therefore, the terminal can extract the text information recorded in the scanned file, and then use the text information and the file name of the scanned target as the text content.
[0153] It should be noted that Fig.10 For more detailed description of steps S210, S230 to S240 shown in Figure 2 The steps S210, S230-S240 shown are not described in detail here.
[0154] In an embodiment of the present application, for all determined scanned files, by matching the scan permissions with the file permissions, it is determined whether the scanning task triggering party has the right to obtain the content of the file, thereby ensuring the compliance and security of the content obtained from the file.
[0155] The present application embodiment provides another file processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Fig.11 As shown, the file processing method is Fig.10 Based on the information shown in , step S1030 is expanded into steps S1110 to S1130; wherein steps S1110 to S1130 are described in detail as follows:
[0156] S1110. Obtain the file type of the scanned file.
[0157] It is understandable that different file types record different text contents, so different extraction strategies are required to extract information from different files. The file type of the scanned file can be determined based on the suffix of the scanned file, such as .txt for text files, .jpg for image files, and .pdf for PDF files.
[0158] S1120. Determine a target extraction strategy corresponding to the scanned file according to a preset mapping table between file types and extraction strategies.
[0159] S1130. Extract the content of the scanned file according to the target extraction strategy to obtain file information of the scanned file, use the text information and the file name of the scanned file as the file content, and obtain the target scanning word corresponding to the scanning task.
[0160] In an embodiment of the present application, the terminal knows in advance how to handle different types of files and establishes a mapping table between file types and extraction strategies, associating file types with extraction strategies. After determining the scanned file, check the suffix of each scanned file and match it with the predefined mapping table. For example, if the scanned file is a file with the suffix ".doc", it will be identified as a text file, and the word-extractor-npm library configured by the terminal can be called to extract the text content; if the scanned file is a .jpg image file, the image file can be image recognized to determine the image content described by the image file; if the scanned file is .json, the built-in fs module of Node.js configured by the terminal can be called to read the JSON file, and then the JSON.parse method can be used to parse it into a JavaScript object.
[0161] In one example, after extracting file information from different types of description files, the different types of file information may be classified and saved to facilitate subsequent tracing processing.
[0162] It is understandable that the extraction process of S1010 to S1030 can also be directly applied to Figure 2 , can also be directly applied to Fig.10 .
[0163] It should be noted that Fig.11 For other detailed descriptions of steps S210, S1010-S1020, S230-S240 shown in Fig.10 The steps S210, S1010-S1020, S230-S240 shown are not repeated here.
[0164] In the embodiments of the present application, by rationally utilizing the file type and selecting an appropriate extraction strategy, the text content is automatically processed to ensure the accuracy and reliability of text information extraction.
[0165] The present application embodiment provides another file processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a terminal, such as Fig.12 As shown, the file processing method is Figure 2 Based on the results shown in Figure 2 Steps S1210 to S1240 are added after S240 shown in the figure. Steps S1210 to S1240 are described in detail as follows:
[0166] S1210 . In response to a file viewing operation on a target file, highlight text content in the target file that matches a target scan word.
[0167] In the embodiment of the present application, after isolating the target file, the scanning triggering party can search for the isolated target file, and the terminal will display a viewing interface, which includes a viewing control. When the terminal detects that the viewing control is triggered, it responds to the file viewing operation of the target file. In one example, when there are multiple target files, the file viewing operation can also specify the target file to be viewed.
[0168] The text content in the target file that matches the target scan word is abnormal content. In order to facilitate the scan trigger party to view the abnormal content, the terminal can highlight the abnormal content, that is, mark the abnormal content with color.
[0169] In one example, the text content in the target file that matches the target scan word is highlighted in a first color, and the text content in the target file that matches the keyword related to the target scan word is highlighted in a second color, and the second color highlight is marked as a keyword. Fig.13 As shown, the text content 1310 matched by the target scan word is processed with a first color brightness, and the text content 1320 matched by the keyword is processed with a second color brightness.
[0170] S1220. Obtain the file information field of the target file, and associate the processed target file with the file information field for display.
[0171] In the embodiment of the present application, the file information field of the target file is used to represent the file description information related to the target file, such as the file description information including target scanning word information, file name, file size, file update time, file path and file upload object, etc. In order to facilitate the management party to intuitively obtain relevant information, the processed target file is associated with the file information field and displayed.
[0172] S1230. In response to the processing operation of the target file, perform trust processing or deletion processing on the target file.
[0173] S1240: If the target file is trusted, the trust count of the target scanning word corresponding to the target file is updated.
[0174] In the embodiment of the present application, after the scanning trigger party obtains the relevant information of the target file, it can process the target file. The terminal can display the processing control, which includes the deletion control and the trust control. The terminal responds to the processing operation corresponding to the processing control and performs deletion processing or trust processing on the target file. The trust processing refers to canceling the isolation of the target file. If the target file is trusted, the trust number of the target scanning word corresponding to the target file is updated, that is, the trust number of the target scanning word corresponding to the target file is increased by 1.
[0175] It should be noted that Fig.12 For a detailed description of steps S210 to S240 shown in Figure 2 Steps S210 to S240 shown in FIG. 1 are not described in detail here.
[0176] In an embodiment of the present application, by highlighting the text content matching the target scan word and displaying the file information fields in association, the scanning task trigger can quickly obtain file-related information and provide the scanning task trigger with self-sufficient file processing rights.
[0177] For ease of understanding, an embodiment of the present application further provides a file processing method, which is illustrated by a file processing method in an enterprise environment. The file processing method can be applied to a terminal with an enterprise network disk.
[0178] Before performing text matching, the embodiment of the present application can customize the scanning vocabulary, allowing the administrator to customize the scanning vocabulary and add or modify scanning words according to actual needs and regulations; once set, the terminal will automatically scan the file packages in the network disk, and then identify and filter the content containing scanning words; wherein, the scanning words are words, phrases or slogans that are sensitive, prone to cause controversy, conflict or inappropriate in the current corporate environment.
[0179] This application strictly controls the management authority of the scanning word library. Only authorized administrators can access and modify the scanning word library to prevent malicious operations. Fig.14 As shown, the terminal displays a display interface of a scanning word library, which includes the triggering times and trust times of each scanning word, as well as the deletion or modification operations of the scanning word. Fig.15 As shown, in the modification interface of the scan library, you can use the "Add scan word" control to trigger the input of single or multiple scan words for marking, and click Submit after the input is completed.
[0180] After adding the post-scan word, you can directly trigger the scan task, such as Fig.16As shown, in the interface showing successful addition of the scan word, the file scanning task can be directly triggered by clicking "Confirm Scan"; wherein, triggering the scanning task can perform a full-disk file scan, that is, it will automatically scan the contents of all files (word, pdf, txt, etc.) and extract the matching between the scan word and the content of the file.
[0181] After the file matching is completed, the object can search for matching results, such as Fig.17 As shown, in the display interface of the scanning vocabulary, you can jump to the matching result viewing interface by clicking the "View" control on the right side of the scanning word, so that the target file corresponding to the specified scanning word in the specified file directory path can be displayed in the viewing interface, and the file path, file name and file upload object of the target file are also displayed in the search interface.
[0182] In the embodiment of the present application, all target files can also be viewed directly, such as Fig.18 As shown, in this viewing interface, you can view the isolation reason of the target file due to the hit scanning word details, the latest time of the file operation, the file size and other detailed information. For any target file, the task triggering party can manually determine whether to trust or delete the file.
[0183] like Fig.19 As shown, after the scanning task is triggered, the file processing method includes file text content extraction, full-text matching and file information pulling; the extraction is performed by using a background asynchronous task, and the text content extraction does not affect normal use. The extraction can also be performed in a streaming manner, which does not occupy too much system memory and has a higher extraction efficiency.
[0184] Among them, the file text extraction process: use the extraction tool to read the text content and convert the read text content into Fig. 20 As shown in the figure, there is a file scanning task in the network disk, which will scan the network disk files regularly. Once a file that meets the requirements for text extraction is found, the file text will be extracted and reported to the matching module. The file scanning task can set different scanning cycles, ranges, conditions and other parameters. For example, all PDF files in the network disk are scanned once a day, and check whether there are any newly uploaded or modified files; the scanned network disk includes the media library containing files and the file space.
[0185] When scanning a text task, the first step is to make a judgment based on the file extension and MIME type to match the corresponding extraction tool to extract the text content; for example, for a contract document, the extraction tool can read the text content such as terms, amounts, dates, etc., and report it to the matching module. For the file extension and MIME type, the terminal network disk can directly obtain the suffix and MIME type, or use the corresponding library to obtain them. The file extension indicates the format or type of the file. The MIME type refers to a standard for identifying text content, usually composed of two parts. The first part indicates the major category of the file, and the second part indicates the subcategory of the file, separated by a slash ( / ). For example, application / pdf indicates a PDF file, and image / jpeg indicates a JPEG image file. The MIME type can provide more detailed and accurate information to help the extraction tool choose the appropriate method to parse the text content.
[0186] In the embodiments of the present application, Fig.21 As shown in the figure, for different file extensions such as .txt, .doc, and .xlsx, different extraction tools are used to complete the task of extracting text content. For example:
[0187] For .doc and .docx files, the word-extractor-npm library is used to extract text content.
[0188] To extract text files (.txt), you can use the built-in fs module of Node.js to read and extract the contents of text files. You can use the fs.readFile method to read the contents of text files.
[0189] For extracting JSON files (.json), JSON is a common data exchange format. Processing JSON files in Node.js is very simple; you can use the fs module to read the JSON file, and then use the JSON.parse method to parse it into a JavaScript object.
[0190] For extracting CSV files (.csv), a CSV file is a text file with comma-separated fields, commonly used to store tabular data; you can use third-party libraries such as csv-parser or fast-csv to parse CSV files.
[0191] For extracting PDF files (.pdf): To extract the contents of PDF files in Node.js, you can use the third-party library pdfjs-dist, which is developed based on Mozilla's PDF.js project. It provides the function of parsing and extracting PDF text content in Node.js.
[0192] In the embodiments of the present application, Fig. 22 As shown, after the text content is extracted, the network disk will report the content to the matching module, and the text content can be queried and matched based on the powerful capabilities provided by the matching module. After obtaining the text content, the matching module classifies and saves the text content for subsequent tracing.
[0193] like Fig.23 As shown, the matching module performs matching processing based on the scanned word and the text content to obtain the target text content that hits the scanned word, and then highlights the target text content through the configured highlighting rules, and then outputs the highlighted matching result.
[0194] like Fig.24 As shown, the matching module includes Elasticsearch (ES), which supports precise matching and fuzzy matching. Precise matching refers to the operation similar to the = operation in SQL, where only the fields are strictly identical will the matching result be output; fuzzy matching is similar to the like operation in SQL, where the rules of fuzzy matching can be customized, for example, fuzzy matching takes into account synonyms and synonyms, that is, the words in the content may not be exactly the same as the keywords, but have a related semantic relationship. In fuzzy matching, a fuzzy search algorithm is usually used, such as Levenshtein distance, Jaccard similarity, or cosine similarity, etc. The fuzzy search algorithm calculates the similarity score between the text word and the keyword, and then the words with a similarity score higher than a threshold are considered to be fuzzy matches.
[0195] Partial matching and correction: Based on the similarity score, text words may be partially matched and the system can automatically correct spelling errors or identify synonyms.
[0196] In addition, the matching module also supports word segmentation matching: first segment the text (including segmenting the search keywords and text content), and then match the relevant content; in one example, when the matching module includes ES, the ES can accurately segment the text through the IK word segmenter; for example, if the search is for "sensitive words", it is split into two words, "sensitive" and "words" for search, which is exactly the function implemented by the IK word segmenter.
[0197] Based on fuzzy matching, the matching module supports context matching: context matching is performed on words with similarity scores below a threshold, such as obtaining the context window of a keyword and analyzing the text content in the window. Once the context window and related text content are determined, the matching score between the keyword and the context can be calculated, and context matching can be completed based on the matching score.
[0198] In the cloud disk custom sensitive word capability, file matching supports both fuzzy matching and precise matching, and meets comprehensive security protection needs through different matching rules. For example, the more important and confidential the scanned text is, the more matching rules can be selected.
[0199] like Fig.24 In the process of matching the input scan word with the text content, the exact match and fuzzy match are selected. After the target text content containing the scan word is hit, the target text content will be traced to determine the file to which it belongs. First, the media library where the file is located will be traced. The media library is used to store multimedia content, such as images, audio, video and other media files. If the file is not found in the media library, the space where the file is located will be traced. Since the target text content can include file information and file name, the file corresponding to the file name can be searched as the target file, or the file to which the file information belongs can be searched as the target file, and then the target file is processed according to the configured highlighting rules to obtain the matching result.
[0200] After hitting the target file, in order to facilitate the object to intuitively obtain file-related information, the terminal can pull the file information. First, after hitting the target file, the unique identification information of the target file is obtained, and the file field content is pulled according to the unique identification information, the file field content is matched with the target file information, and displayed in the corresponding interface.
[0201] File information field contents: file identification, scan word information, file name, file size, file update time (accurate to seconds), file path (including specific directories and hierarchical directories of enterprise space, specific directories and hierarchical directories of collaborative space), upload object name, etc.
[0202] In the embodiment of the present application, based on high-performance text parsing capabilities, keyword matching is performed in combination with full-text retrieval, abnormal content in the enterprise environment is marked and matched, possible data leakage situations are quickly identified and processed, and abnormal files are isolated; enterprise management members can quickly receive abnormal reminders and manually whitelist or delete files in the isolation area to ensure enterprise information security; enterprise management members can customize the scanning vocabulary according to their own needs, improve the accuracy and real-time performance of scanning word filtering, and further strengthen the management and protection of enterprise data.
[0203] Here, the device embodiment of the present application is introduced, which can be used to execute the file processing method in the above embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above embodiment of the file processing method of the present application.
[0204] The present application embodiment provides a file processing device, such as Fig.25 As shown, the device comprises:
[0205] The scanning module 2510 is used to scan the files in the storage space in response to the triggering of the scanning task to determine the scanning files corresponding to the scanning task;
[0206] The acquisition module 2520 is used to acquire the text content corresponding to each scanned file and acquire the target scan word corresponding to the scanning task;
[0207] A matching module 2530 is used to perform semantic analysis on the target scanning word to obtain a keyword, and match the keyword with the text content according to a target text matching strategy corresponding to the scanning task;
[0208] The isolation module 2540 is used to, if the text content contains target text content matching the keyword, trace the target text content to determine the target file to which the target text content belongs, and isolate the target file.
[0209] In one embodiment of the present application, based on the aforementioned scheme, the device also includes a management and control module, which is used to obtain the management authority of the party to which the access operation belongs when an access operation to the scanning vocabulary library is detected; if the management authority includes access rights to the scanning vocabulary library, the scanning words in the scanning vocabulary library are updated according to the operation content corresponding to the access operation.
[0210] In one embodiment of the present application, based on the aforementioned scheme, the device also includes a determination module, which is used to obtain the word importance corresponding to the target scanning word according to the word index information of the target scanning word in the historical scanning task, and the word index information is used to describe the execution status of the target scanning word in the historical scanning task; obtain the mapping relationship between the preset word importance and the file matching strategy, and the word importance is positively correlated with the number of the file matching strategies; determine the target text matching strategy according to the mapping relationship and the word importance corresponding to the target scanning word.
[0211] In one embodiment of the present application, based on the aforementioned scheme, the determination module is further used to obtain the historical trigger times and historical trust times corresponding to the target scanning word in the historical scanning authentication within a preset historical time period; calculate the proportion of the historical trust times to the historical trigger times, and determine the word importance of the target scanning word based on the proportion.
[0212] In one embodiment of the present application, based on the aforementioned scheme, the matching module is further used to perform word segmentation processing on the target scan word to obtain a first analysis word, and to perform derive processing on the first analysis word to obtain a second analysis word; to obtain a text word with similar semantics to the target scan word, and to obtain a third analysis word based on the text word whose semantic similarity is greater than a preset similarity threshold; and to obtain the keyword based on the first analysis word, the second analysis word and the third analysis word.
[0213] In one embodiment of the present application, based on the aforementioned scheme, the matching module is further used to compare each text word in the text content with the keyword, and use the text content to which the text word that is exactly the same as the keyword belongs as the target text content; for the first candidate text word that is partially identical to the keyword, calculate the similarity between the first candidate text word and the keyword, and use the text content to which the first candidate text word belongs whose similarity is greater than a first preset similarity threshold as the target text content.
[0214] In one embodiment of the present application, based on the aforementioned scheme, the matching module is further used to obtain the context information of the second candidate text word in the text content whose similarity is less than the first preset similarity threshold and greater than the second preset similarity threshold according to a preset context window size; calculate the matching score between the context information of the second candidate text word and the keyword, and search for a target candidate text word from the second candidate text word according to the matching score; and use the text content to which the target candidate text word belongs as the target text content.
[0215] In one embodiment of the present application, based on the aforementioned scheme, the storage space includes multiple file storage spaces; the scanning module is further used to obtain the account information of the scanning task triggering party, and verify the space permissions of each of the multiple file storage spaces according to the account information to determine the scanning space corresponding to the scanning task; scan the files in the scanning space, and use the files that meet the content extraction as the scanning files.
[0216] In one embodiment of the present application, based on the aforementioned scheme, the acquisition module is further used to obtain the scanning permissions of the scanning task triggering party and the file permissions of each scanned file; if the scanning permissions do not match the file permissions of the scanned file, the file name of the scanned file is used as the text content of the scanned file; if the scanning permissions match the file permissions of the scanned file, the file information of the scanned file is extracted, and the text information and the file name of the scanned file are used as the text content.
[0217] In one embodiment of the present application, based on the aforementioned scheme, the acquisition module is further used to obtain the file type of the scanned file; determine the target extraction strategy corresponding to the scanned file according to a preset mapping table between the file type and the extraction strategy; and extract the content of the scanned file according to the target extraction strategy to obtain the file information of the scanned file.
[0218] In one embodiment of the present application, based on the aforementioned scheme, the device also includes a viewing module for highlighting the text content in the target file that matches the target scanning word in response to a file viewing operation of the target file; obtaining the file information field of the target file, and displaying the processed target file in association with the file information field; trusting or deleting the target file in response to a processing operation on the target file; if the target file is trusted, updating the trust count of the target scanning word corresponding to the target file.
[0219] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0220] An embodiment of the present application also provides an electronic device, comprising one or more processors and a storage device, wherein the storage device is used to store one or more computer programs, and when the one or more computer programs are executed by the one or more processors, the electronic device implements the file processing method as described above.
[0221] Fig.26 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0222] It should be noted that Fig.26 The computer system 2600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0223] like Fig.26As shown, computer system 2600 includes a processor (Central Processing Unit, CPU) 2601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (Read-Only Memory, ROM) 2602 or the program loaded from the storage part 2608 to the random access memory (Random Access Memory, RAM) 2603, such as executing the method in the above embodiment. In RAM 2603, various programs and data required for system operation are also stored. CPU 2601, ROM 2602 and RAM 2603 are connected to each other through bus 2604. Input / output (Input / Output, I / O) interface 2605 is also connected to bus 2604.
[0224] In some embodiments, the following components are connected to the I / O interface 2605: an input section 2606 including a keyboard, a mouse, etc.; an output section 2607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 2608 including a hard disk, etc.; and a communication section 2609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 2609 performs communication processing via a network such as the Internet. A drive 2610 is also connected to the I / O interface 2605 as needed. A removable medium 2611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 2610 as needed, so that a computer program read therefrom is installed into the storage section 2608 as needed.
[0225] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 2609, and / or installed from the removable medium 2611. When the computer program is executed by the processor (CPU) 2601, various functions defined in the system of the present application are executed.
[0226] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0227] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0228] The units or modules involved in the embodiments described in this application may be implemented by software or hardware, and the units or modules described may also be set in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0229] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the file processing method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0230] Another aspect of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the file processing method as described above in the above embodiments.
[0231] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0232] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0233] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person of ordinary skill in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A file processing method, characterized in that: include: In response to triggering of a scanning task, scanning files in the storage space to determine a scanning file corresponding to the scanning task; Obtaining text content corresponding to each scanned file, and obtaining target scan words corresponding to the scanning task; Performing semantic analysis on the target scanning words to obtain keywords, and matching the keywords with the text content according to the target text matching strategy corresponding to the scanning task; If the text content contains target text content that matches the keyword, the target text content is traced to determine the target file to which the target text content belongs, and the target file is isolated.
2. The method according to claim 1, characterized in that Before obtaining the target scanning word corresponding to the scanning task, the method includes: When an access operation to the scanning vocabulary is detected, obtaining the management authority of the party to which the access operation belongs; If the management authority includes access rights to the scanning word library, the scanning words in the scanning word library are updated according to the operation content corresponding to the access operation.
3. The method according to claim 1, characterized in that The method further comprises: Acquire the word importance corresponding to the target scanning word according to the word index information of the target scanning word in the historical scanning task, wherein the word index information is used to describe the execution status of the target scanning word in the historical scanning task; Acquire a preset mapping relationship between word importance and file matching strategy, wherein the word importance is positively correlated with the number of file matching strategies; The target text matching strategy is determined according to the mapping relationship and the word importance corresponding to the target scan word.
4. The method according to claim 3, characterized in that Acquiring the word importance corresponding to the target scan word according to the historical information of the target scan word, including: Obtain the historical trigger count and historical trust count corresponding to the target scan word in the historical scan authentication within a preset historical time period; The ratio of the historical trust times to the historical trigger times is calculated, and the word importance of the target scanning word is determined according to the ratio.
5. The method according to claim 1, characterized in that The performing semantic analysis on the target scan word to obtain a keyword includes: Performing word segmentation processing on the target scan word to obtain a first analysis word, and performing derivation processing on the first analysis word to obtain a second analysis word; Acquire text words with semantics similar to the target scan word, and obtain third analysis words based on text words with semantic similarity greater than a preset similarity threshold; The keyword is obtained according to the first analysis word, the second analysis word and the third analysis word.
6. The method according to claim 1, characterized in that The matching of the keyword with the text content according to the target text matching strategy corresponding to the scanning task includes: Compare each text word in the text content with the keyword, and take the text content to which the text word that is completely identical to the keyword belongs as the target text content; For a first candidate text word that is partially identical to the keyword, the similarity between the first candidate text word and the keyword is calculated, and the text content to which the first candidate text word with a similarity greater than a first preset similarity threshold belongs is taken as the target text content.
7. The method according to claim 6, characterized in that The step of matching the keyword with the text content according to the target text matching strategy corresponding to the scanning task further includes: For a second candidate text word in the text content whose similarity is less than the first preset similarity threshold and greater than a second preset similarity threshold, acquiring context information of the second candidate text word according to a preset context window size; Calculating a matching score between the context information of the second candidate text word and the keyword, and searching for a target candidate text word from the second candidate text words according to the matching score; The text content to which the target candidate text word belongs is used as the target text content.
8. The method according to claim 1, characterized in that The storage space includes a plurality of file storage spaces; scanning the files in the storage space to determine the scanned files corresponding to the scanning task includes: Acquire the account information of the scanning task triggering party, and verify the space permissions of each of the multiple file storage spaces according to the account information to determine the scanning space corresponding to the scanning task; The files in the scanning space are scanned, and the files satisfying the content extraction are used as the scanned files.
9. The method according to claim 1, characterized in that: The obtaining of text content corresponding to each scanned file includes: Obtain the scanning authority of the scanning task triggering party and the file authority of each scanned file; If the scanning permission does not match the file permission of the scanned file, the file name of the scanned file is used as the text content of the scanned file; If the scanning permission matches the file permission of the scanned file, the file information of the scanned file is extracted, and the text information and the file name of the scanned file are used as the text content.
10. The method according to claim 9, characterized in that The extracting the file information of the scanned file comprises: Obtaining the file type of the scanned file; Determine a target extraction strategy corresponding to the scanned file according to a preset mapping table between file types and extraction strategies; Content extraction is performed on the scanned file according to the target extraction strategy to obtain file information of the scanned file.
11. The method according to any one of claims 1 to 10, characterized in that: After isolating the target file, the method further comprises: In response to a file viewing operation of the target file, highlighting text content in the target file that matches the target scan word; Acquire the file information field of the target file, and associate the processed target file with the file information field for display; In response to the processing operation of the target file, performing trust processing or deletion processing on the target file; If the target file is trusted, the trust count of the target scanning word corresponding to the target file is updated.
12. A file processing device, characterized in that: include: A scanning module, configured to scan files in the storage space in response to a triggering of a scanning task, so as to determine a scanning file corresponding to the scanning task; An acquisition module, used to acquire the text content corresponding to each scanned file and acquire the target scan word corresponding to the scanning task; A matching module, configured to perform semantic analysis on the target scanning word to obtain a keyword, and match the keyword with the text content according to a target text matching strategy corresponding to the scanning task; The isolation module is used to, if the text content contains target text content matching the keyword, trace the target text content to determine the target file to which the target text content belongs, and isolate the target file.
13. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to execute the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the method according to any one of claims 1 to 11.
Citation Information
Cited By
Unified aggregated text content extraction method and system for full-type files, medium and equipment
CN120578631A