File scanning method and device, electronic equipment and storage medium
By receiving file scanning tasks and loading a matching scanning policy list, the problem of inflexible file scanning policies in the existing technology is solved, file access permission control is realized in different time scenarios, and processing speed and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202410549129.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2024-09-10
AI Technical Summary
Existing file scanning technology lacks flexibility in setting scanning strategies, resulting in the possibility of missing confidential data or taking too long on the network, resulting in a waste of resources.
By receiving file scanning tasks, it obtains time information and loads a matching scanning policy list, matches files for scanning according to the policy, flexibly controls file access permissions, saves confidential data maintenance costs, and reduces processing time consumption.
It improves the flexibility and processing speed of file scanning, reduces unnecessary processing time consumption, and saves the maintenance cost of confidential data.
Smart Images

Figure CN118626449A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a file scanning method, a file scanning device, an electronic device and a storage medium. Background Art
[0002] File scanning technology is a technology that scans sensitive content in each file one by one by accessing the file list under the specified directory of the file system. At present, the scope of this technology is to count or intercept the interactive file data when transferring files on the network to ensure that confidential files will not be leaked through the network.
[0003] The file scanning technology currently used is relatively simple when setting scanning policies, and there is not much free setting space. When fewer scanning policies are set, there will be a small probability of omissions leading to confidential data leakage; when more scanning policies are set, the network will be occupied for a long time, resulting in a waste of resources. Summary of the invention
[0004] In view of the defects in the prior art, embodiments of the present invention provide a file scanning method, a file scanning device, an electronic device and a storage medium.
[0005] In a first aspect, an embodiment of the present invention provides a file scanning method, comprising:
[0006] Receive a file scanning task, and obtain time information and files to be scanned corresponding to the scanning task;
[0007] According to the policy time attribute, loading a scanning policy list that matches the time information;
[0008] According to the scanning strategies in the scanning strategy list, the strategies of the files to be scanned are matched in turn to determine the scanning results.
[0009] As in the above method, optionally, the obtaining of time information corresponding to the scanning task includes:
[0010] If the time information associated with the file scanning task is system time information, obtaining the current system time;
[0011] If the current system time is consistent with the system time information, the system time information is used as the time information corresponding to the scanning task.
[0012] As in the above method, optionally, the obtaining of time information corresponding to the scanning task includes:
[0013] If the time information associated with the file scanning task is file time information, obtaining file attribute information of the file to be scanned;
[0014] The file time attribute of the file to be scanned is searched from the file attribute information, and if the file time attribute is consistent with the file time information, the file time attribute is used as the time information corresponding to the scanning task.
[0015] As in the above method, optionally, before receiving the file scanning task, it also includes:
[0016] Create a scanning policy and set the policy time attribute corresponding to the scanning policy;
[0017] Scan policies with the same policy time attributes are saved in the same scan policy list.
[0018] As the above method, optionally, it also includes:
[0019] Add a scanning policy and set the policy time attribute corresponding to the scanning policy;
[0020] The scanning policy is added to a scanning policy list having the same time attribute as the policy.
[0021] As in the above method, optionally, the step of matching the to-be-scanned files with the scanning strategies in the scanning strategy list in turn to determine the scanning results includes:
[0022] Determining the scanning policy rules in the scanning policy list in sequence;
[0023] Calling the matching interface corresponding to the scanning policy rule to perform policy matching;
[0024] The information matching the scanning strategy is saved.
[0025] As the above method, optionally, it also includes:
[0026] Obtaining the user group authority corresponding to the file to be scanned;
[0027] Determine a user grouping strategy list according to the user grouping authority;
[0028] Determine a scanning strategy group according to the scanning strategy list and the user group strategy list;
[0029] Correspondingly, the scanning strategies in the scanning strategy list are sequentially matched to the files to be scanned to determine the scanning results, including:
[0030] According to the scanning strategies in the scanning strategy group, the strategies of the files to be scanned are matched in sequence to determine the scanning results.
[0031] In a second aspect, an embodiment of the present invention provides a file scanning device, comprising:
[0032] A receiving and obtaining module, used for receiving a file scanning task, and obtaining time information and a file to be scanned corresponding to the scanning task;
[0033] A loading module, used to load a scanning strategy list that matches the time information according to the strategy time attribute;
[0034] The scanning module is used to match the scanning strategies in the scanning strategy list with the files to be scanned in turn to determine the scanning results.
[0035] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0036] A memory and a processor, wherein the processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the file scanning method as described in any one of the first aspects above.
[0037] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the file scanning method as described in any one of the above-mentioned first aspects is implemented.
[0038] The file scanning method provided by the embodiment of the present invention receives a file scanning task, obtains the time information and the file to be scanned corresponding to the scanning task; loads a scanning strategy list that matches the time information according to the strategy time attribute; and performs strategy matching on the file to be scanned in turn according to the scanning strategies in the scanning strategy list to determine the scanning result. The file scanning method provided by the embodiment of the present invention adds the judgment of the time attribute in the strategy during the strategy loading process, saves the strategies with the same time attribute in a strategy list, adds the file scanning usage scenario of the time attribute, flexibly controls the access rights of the file, and loads and uses the strategy list with the corresponding time tendency in different time scenarios, thereby saving the maintenance cost of confidential data, grouping the originally unified strategies into lists, reducing unnecessary processing time consumption, and improving the processing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flowchart of steps of an embodiment of a file scanning method of the present invention;
[0040] Figure 2 It is a schematic diagram of the document scanning process in the prior art;
[0041] Figure 3 It is a schematic diagram of setting policy time attributes in an embodiment of a file scanning method of the present invention;
[0042] Figure 4 It is a schematic diagram of strategy grouping in an embodiment of a file scanning method of the present invention;
[0043] Figure 5 It is a schematic diagram of the process of loading and matching files by a policy matching service in an embodiment of a file scanning method of the present invention;
[0044] Figure 6 It is a schematic diagram of the file scanning system architecture in an embodiment of a file scanning method of the present invention;
[0045] Figure 7 is a structural block diagram of an embodiment of a document scanning device of the present invention;
[0046] Figure 8 It is a structural block diagram of an electronic device embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Reference Figure 1 , shows a flowchart of a file scanning method embodiment of the present invention, which may specifically include the following steps:
[0049] Step S110: receiving a file scanning task, and obtaining time information and a file to be scanned corresponding to the scanning task;
[0050] Specifically, the file scanning process includes the following steps:
[0051] File scanning process: This process is used to encapsulate the scanned files and then send the file information to the file parsing process;
[0052] File parsing process: This process is used to obtain file information data, then parse the file content, encapsulate the file content data, and then send the data to the policy matching process; and obtain the scanning result data, then encapsulate it into event data, and report the processing results;
[0053] Policy matching process: preloads policy information, processes the tasks sent by the file parsing process, and returns the matching results; a policy is associated with one or more rules, and additional conditions and special processing can be added. A rule is an interface used to associate different types of template objects and input data for matching.
[0054] Event receiving process: receiving and saving event files and event data information.
[0055] Figure 2 It is a schematic diagram of the document scanning process in the prior art, such as Figure 2 As shown in the figure, the file scanning process includes:
[0056] Step A1, the file scanning management platform (platform) reads the scanning event (to-be-scanned event or scanning result event) from the event library, sends the detector parameters and policy parameters to the event reporting process (dlp_daemon), and sends the process start (corresponding to the to-be-scanned event) or stop command (corresponding to the scanning result event);
[0057] Step A2: the event reporting process (dlp_daemon) sends a start scan task instruction to the file scanning process (dlp_storage_scan);
[0058] Step A3: The event reporting process (dlp_daemon) sends parameters to the database (redis database and mysql database);
[0059] Step A4: When the scanning policy needs to be updated, the event reporting process (dlp_daemon) sends the updated policy to the policy matching process (dlp_policyMatching);
[0060] Step A5, the file scanning process (dlp_storage_scan) performs a file queue operation on the file to be scanned (one or a batch), and stores the file to be scanned in redis queue 1 (redis is an in-memory database that supports message queue function);
[0061] Step A6, file dequeue parsing, sending the dequeued file to the file parsing process (dlp_fileParser);
[0062] Step A7, after the file parsing process (dlp_fileParser) parses the file content, the file content is queued and stored in redis queue 2;
[0063] Step A8: The file content is dequeued and sent to the policy matching process (dlp_policyMatching);
[0064] Step A9: The policy matching process (dlp_policyMatching) matches the file content according to the scanning strategy and feeds the matching result back to the redis queue 3;
[0065] Step A10, redis queue 3 feeds back the matching result to the file parsing process (dlp_fileParser);
[0066] Step A11, the file parsing process (dlp_fileParser) queues the result event into redis queue 4;
[0067] Step A12: Events in redis queue 4 are dequeued, and the scanning results are reported to the event reporting process (dlp_daemon);
[0068] Step A13: The event reporting process (dlp_daemon) reports the event to the event receiving process (dlp_incident), and the event receiving process (dlp_incident) stores the event in the database.
[0069] With fixed policies, scanning different types of file lists over time is not flexible, and creating a large number of policies will lead to low scanning rates. The requirements for accessing and downloading the same file may not be the same in different time periods, and manual control of permissions may result in errors and losses.
[0070] To solve the above problems, in an embodiment of the present invention, a policy list for determining time attributes is added. In different time scenarios, a policy list with corresponding time tendencies is loaded and used to solve the problem of insufficient flexibility. The proportion of event-triggered policies at different times can also be counted to understand the usage habits of users in the network.
[0071] When a file needs to be scanned, a file scanning task is generated and the time information corresponding to the file scanning task is set, that is, the time period that the file scanning task wants to use. After receiving the file scanning task, the file scanning task is parsed to obtain the time information corresponding to the scanning task and the file to be scanned corresponding to the scanning task.
[0072] When performing batch file scanning, you can set the time information of the scanning task through the scanning options.
[0073] For example, set the time period to June, July, and August 2023, perform policy scanning on a batch of new files, filter out the files created in June, July, and August for scanning, and do not process other files. The filtered files will provide feedback on the results of hitting the strategy, and the time information corresponding to the scanning task can be obtained as June, July, and August 2023.
[0074] Step S120: Load a scanning strategy list that matches the time information according to the strategy time attribute;
[0075] Specifically, when setting the scanning policy, the policy time attribute is added. The processing of adding the policy time attribute is mainly concentrated in the processing flow of the policy matching process. The time attribute option and the meaning of the time period are added to the policy delivery service. Among them, the service refers to the application function provided by the computer system to the user through the network. The functional module that can be installed and uninstalled in the system with the service as the unit is a plug-in.
[0076] Group the policies containing time attributes, place the policies with the same time attributes in the same scanning policy list, and mark the time attributes of the scanning policy list.
[0077] After obtaining the time information corresponding to the scanning task, match the time information with the time attributes of each saved scanning policy list, and use the scanning policy list that matches the time information as the scanning policy list corresponding to the scanning task. It should be noted that there can be multiple scanning policy lists, that is, there can be multiple scanning policy lists that match the time information. For example, the time information corresponding to the scanning task is June, July, and August 2023, and the time attributes of the scanning policy list include June 2023, July 2023, and August 2023, then these three groups of scanning policy lists are scanning policy lists that match the time information of the scanning task.
[0078] It should be noted that for scanning policies that have not set time attributes in the past, the original process will be followed. In other words, the time information of these scanning policies is for the entire period, and no scanning is performed to differentiate between time periods. In this way, for files generated on different dates, the policy can be updated by date division while retaining the original management plan for earlier files.
[0079] Step S130: According to the scanning strategies in the scanning strategy list, the to-be-scanned files are matched with strategies in turn to determine the scanning results.
[0080] Specifically, the file scanning process (dlp_storage_scan) enables the thread pool to realize the concurrent execution of multiple scanning tasks; designs a file incremental scanning mechanism, records the CRC (Cyclic Redundancy Check) value of the scanned file, compares it with the information stored in the database, sends the unstored file to the file parsing process for scanning, and then stores the file CRC information; the policy matching process realizes the loading of scanning policy information in all policy lists that match the scanning task, creates data structures of different types of rules, including basic content scanning types such as regular expressions and keywords, and scanning types of complex algorithms such as simhash (the most commonly used hash method for web page deduplication) and intelligent classification, and groups and caches the policies according to the information of the input task; the policy matching process realizes the policy scanning process, polls and scans the corresponding policy list according to different input tasks, and returns the matching results of the event according to the matching results of the rules in the policy.
[0081] The file scanning method provided by the embodiment of the present invention receives a file scanning task, obtains the time information and the file to be scanned corresponding to the scanning task; loads a scanning strategy list that matches the time information according to the strategy time attribute; and performs strategy matching on the file to be scanned in turn according to the scanning strategies in the scanning strategy list to determine the scanning result. The file scanning method provided by the embodiment of the present invention adds the judgment of the time attribute in the strategy during the strategy loading process, saves the strategies with the same time attribute in a strategy list, adds the file scanning usage scenario of the time attribute, flexibly controls the access rights of the file, and loads and uses the strategy list with the corresponding time tendency in different time scenarios, thereby saving the maintenance cost of confidential data, grouping the originally unified strategies into lists, reducing unnecessary processing time consumption, and improving the processing speed.
[0082] On the basis of the above embodiment, further, the obtaining the time information corresponding to the scanning task includes:
[0083] If the time information associated with the file scanning task is system time information, obtaining the current system time;
[0084] If the current system time is consistent with the system time information, the system time information is used as the time information corresponding to the scanning task.
[0085] Specifically, the time information associated with some file scanning tasks is system time information, which has nothing to do with the time attributes of the file itself, that is, the file creation time and modification time have nothing to do with it. As long as it meets the system time information, it needs to be scanned. For example, for confidential files, time period management is performed. 9:00-18:00 belongs to working hours, and it is open for processing to facilitate work. 18:00-9:00 the next day belongs to non-working hours, and access to confidential files is blocked. The scanning policy for confidential files is set to non-working hours, that is, 18:00-9:00 the next day, and file access during this period is blocked, while working hours are not controlled. When processing batch files, you can use the scanning option to set the policy list for the time period you want to use for the task, and set the priority higher than the attributes of the file itself, so as to reduce the judgment process of file attributes and directly select the policy list corresponding to the time period for scanning.
[0086] If the time information associated with the file scanning task is the system time information, such as 18:00-9:00 the next day in the above example, the current system time is obtained to determine whether the current system time is within the time information range associated with the file scanning task. If so, the system time information associated with the file scanning task is used as the time information corresponding to the scanning task. Otherwise, the time information policy is not determined and the original scanning policy is directly executed. For example, if the current time is within 9:00-18:00, the confidential file blocking operation is not performed.
[0087] On the basis of the above embodiments, further, the obtaining of the time information corresponding to the scanning task includes:
[0088] If the time information associated with the file scanning task is file time information, obtaining file attribute information of the file to be scanned;
[0089] The file time attribute of the file to be scanned is searched from the file attribute information, and if the file time attribute is consistent with the file time information, the file time attribute is used as the time information corresponding to the scanning task.
[0090] Specifically, the time information associated with some file scanning tasks is file time information, which has nothing to do with the system time, that is, as long as the file creation time and modification time meet the time information associated with the scanning task, scanning is required. For example, set the time period to June, July, and August 2023, perform policy scanning on a batch of new files, filter out the files with creation time of June, July, and August in this batch of files for scanning, and do not process other files. Feedback the results of the filtered files that hit the policy, and perform graphical statistics on the events of the three months of this scan. First, during the policy loading process, add the judgment of the time attribute in the policy, and save the policies with the same time attribute in a policy list; secondly, when entering the task, first obtain the file time attribute, and judge the qualified policies in the policy group list according to the file time attribute for rule scanning and processing.
[0091] If the time information associated with the file scanning task is file time information, such as June, July, and August 2023 in the above example, the file attribute information of the file to be scanned is obtained, and the file time attributes of the file to be scanned are searched from the file attribute information, such as the file creation time, the file modification time, etc., to determine whether the file time attributes are within the time information range associated with the file scanning task. If so, the file time attributes of the file to be scanned are used as the time information corresponding to the scanning task. Otherwise, the time information strategy is not judged and the original scanning strategy is directly executed.
[0092] In the embodiment of the present invention, for the file scanning usage scenario with added time attributes, the access rights of the file can be flexibly controlled, thereby saving the maintenance cost of confidential data.
[0093] On the basis of the above embodiments, further, before receiving the file scanning task, the method further includes:
[0094] Create a scanning policy and set the policy time attribute corresponding to the scanning policy;
[0095] Scan policies with the same policy time attributes are saved in the same scan policy list.
[0096] Specifically, the processing of adding policy time attributes is mainly concentrated in the processing flow of the policy matching process, and the meaning of the time attribute option and time period is added to the policy delivery service.
[0097] For example, the data structure corresponding to the information of the policy time attribute can be:
[0098] struct timeStatus{
[0099] unsinged int index; / / attribute subscript
[0100] unsinged int year; / / attribute year
[0101] unsinged int monthBegin; / / property starting month
[0102] unsinged int monthEnd; / / property end month
[0103] unsinged int dayBegin; / / property starting date
[0104] unsinged int dayEnd; / / property deadline
[0105] }
[0106] When creating a scan policy, you can use the drop-down window or options to select a time period. Figure 3 FIG. 1 is a schematic diagram of setting a policy time attribute in an embodiment of a file scanning method of the present invention. Figure 3 As shown, when creating a scanning policy, the administrator can select the policy effective time, such as working hours, non-working hours or other custom time periods. After the selection is completed, the struct timeStatus data type is automatically generated for storage and associated with the time attribute of the scanning policy.
[0107] Afterwards, the scanning policies with the same policy time attribute are saved in the same scanning policy list. Figure 4 Schematic diagram of strategy grouping in a file scanning method embodiment of the present invention. Figure 4 As shown in the figure, for the existing scanning strategies, the time attribute of each scanning strategy is determined, and the strategies with the same time attribute are grouped according to the time attribute information. The strategies with the same time attribute are stored in the same scanning strategy list. The data structure for storing the strategies in the strategy is designed as follows: using the map data structure in C++, the first member is the time attribute information, and the second member is the array of the strategy list, using the vector data structure. The process of adding strategy group members is implemented using the insert of the map data structure. The first member corresponds to the initialization of the time period, and the strategy array addition of the second member is implemented using the push_back() of the vector.
[0108] In actual applications, the strategy can also add a time distinction flag, which is used to indicate whether the time targeted by the scanning strategy is system time or file time. When a scanning task is received, the time distinction flag of the scanning strategy is matched according to the time attribute information of the scanning task to further distinguish the scanned files, thereby improving the flexibility of file scanning.
[0109] On the basis of the above embodiments, further comprising:
[0110] Add a scanning policy and set the policy time attribute corresponding to the scanning policy;
[0111] The scanning policy is added to a scanning policy list having the same time attribute as the policy.
[0112] Specifically, when you need to add a new scanning policy, you can use the drop-down window or options to select a time period. When creating a scanning policy, the administrator can select the policy effective time, such as working hours, non-working hours, or other custom time periods. After the selection is completed, the struct timeStatus data type is automatically generated for storage and associated with the time attribute of the scanning policy.
[0113] Afterwards, the new scanning policy is added to the scanning policy list with the same time attribute as the policy. If there is no scanning policy list with the same time attribute, a new scanning policy list is created.
[0114] Figure 5 FIG. 1 is a schematic diagram of a process of loading and matching files by a policy matching service in an embodiment of a file scanning method of the present invention. Figure 5 As shown in the figure, the overall process of adding file time attribute judgment to the policy matching service is as follows:
[0115] When the policy matching process is started and the policy is updated, the policy loading operation is performed. Policy loading is to access the service that stores the policy and read all stored policies into the cache; the read policies are judged and grouped one by one and stored in an array structure with the policy id as the subscript.
[0116] The policy matching process will also perform policy matching. When the scanning task is read in, it will parse the task's JSON information (JavaScript Object Notation, JS object notation, a lightweight data exchange format) to obtain the file information that needs to be scanned;
[0117] Read the file content, obtain the time attribute of the current file, parse the year, date, timestamp and other information in the time attribute, compare it with the time attribute information in the policy list, and load the corresponding policy list;
[0118] Compare the year, date, and timestamp in the file event attributes with the member variables in struct timeStatus, for example:
[0119] struct timeStatus{
[0120] unsinged int index = 1;
[0121] unsinged int year = 2024;
[0122] unsinged int monthBegin=3;
[0123] unsinged int monthEnd = 6;
[0124] unsinged int dayBegin = 1;
[0125] unsinged int dayEnd = 30;
[0126] }
[0127] It indicates that the time attribute of the policy list is the time period from March 1 to June 30, 2024, and the time information in the parsed file attributes is May 3, 2024.
[0128] Determine the year in turn = timeStatus.year
[0129] (month>mouthBegin&&month <monthEnd)
[0130] (date>dayBegin&&date <dayEnd)
[0131] If all three conditions are met, it means that the time period of the file attribute meets the time information of the current policy list. The current policy list is loaded and the time information judgment of the next policy list is performed.
[0132] Finally, load the policy list that matches the file time for polling matching and output the matching results.
[0133] In the embodiment of the present invention, the original strategies are grouped into lists, which improves the processing speed and reduces unnecessary processing time consumption; for files generated on different dates, the strategies can be updated by date division while retaining the management method of early files.
[0134] On the basis of the above embodiments, further, the scanning strategies in the scanning strategy list are sequentially matched to the files to be scanned to determine the scanning results, including:
[0135] Determining the scanning policy rules in the scanning policy list in sequence;
[0136] Calling the matching interface corresponding to the scanning policy rule to perform policy matching;
[0137] The information matching the scanning strategy is saved.
[0138] Specifically, for the scanning strategies in the strategy list, the strategy matching process is carried out in sequence to determine the scanning strategy rules in the scanning strategy list. Different matching interface calls are made for different types of rules. For example, regular type rules are matched using the PCRE (Perl Compatible Regular Expressions) interface call, and keyword type rules are matched using the AC (Aho-Corasick Algorithm, which preprocesses the pattern string into a deterministic finite state automaton and ends the text scanning once) algorithm corresponding interface implementation, and the strategy hit information is saved. Finally, the matching results are integrated into a json file and sent to the file parsing process.
[0139] The embodiment of the present invention groups the originally unified scanning strategies into lists, thereby improving the processing speed and reducing unnecessary processing time consumption.
[0140] On the basis of the above embodiments, further comprising:
[0141] Obtaining the user group authority corresponding to the file to be scanned;
[0142] Determine a user grouping strategy list according to the user grouping authority;
[0143] Determine a scanning strategy group according to the scanning strategy list and the user group strategy list;
[0144] Correspondingly, the scanning strategies in the scanning strategy list are sequentially matched to the files to be scanned to determine the scanning results, including:
[0145] According to the scanning strategies in the scanning strategy group, the strategies of the files to be scanned are matched in sequence to determine the scanning results.
[0146] Specifically, for event processing triggered by different users, a matching process can also be performed using a group-level policy list through the permissions of user groups, which is a way to achieve access security for confidential data. Obtain the user group permissions corresponding to the files to be scanned. For example, a user group of a certain level has higher permissions and can release some files, while a user group of a certain level has lower permissions and needs to scan all files. Determine the user group policy list based on the user group permissions.
[0147] Afterwards, the scanning strategy group is determined according to the scanning strategy list and the user group strategy list. For example, the user group authority weight and the time attribute weight are followed up to determine the scanning strategy group from the scanning strategy list and the user group strategy list. Finally, according to the scanning strategies in the scanning strategy group, the strategy matching is performed on the scanned files in turn to determine the scanning results, providing a more flexible file scanning method.
[0148] Figure 6 FIG. 1 is a schematic diagram of a file scanning system architecture in an embodiment of a file scanning method of the present invention. Figure 6 As shown, the file scanning system architecture includes an interface layer and a data acquisition module, a data processing module, a data scanning module and a response processing module. The interface layer is used for receiving detector parameters, issuing and updating policy groups, issuing and updating policies, obtaining organizational and user data, event reporting and heartbeat status reporting.
[0149] The data acquisition module is mainly used for storage widgets, file sharing, file scanning and traversal, and periodic file copying; the data processing module is used to parse file content, such as encrypted file recognition, office document analysis, source code file analysis, OCR (Optical Character Recognition) image analysis, text file analysis, and compressed file analysis, which belongs to the file analysis process.
[0150] The data scanning module is used for file scanning, such as keyword matching, regular matching, fuzzy keyword matching, post-processing scripts, document fingerprint matching, intelligent classification, etc., which belongs to the strategy matching process.
[0151] The response processing module is used to record the scanning results and failed retransmissions.
[0152] The file scanning method provided by the embodiment of the present invention adds a strategy list for determining time attributes to solve the problem that the scanning strategy is not flexible enough. In different time scenarios, a strategy list with corresponding time tendencies is loaded and used. The proportion of event-triggered strategies at different times can also be counted to understand the usage habits of users in the network. The originally unified strategies are grouped into lists, thereby improving the processing speed and reducing unnecessary processing time consumption.
[0153] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0154] Reference Figure 7 , shows a structural block diagram of an embodiment of a file scanning device of the present invention, which may specifically include the following modules:
[0155] The receiving and obtaining module 710 is used to receive a file scanning task and obtain the time information and the file to be scanned corresponding to the scanning task;
[0156] A loading module 720, configured to load a scanning policy list that matches the time information according to the policy time attribute;
[0157] The scanning module 730 is used to perform strategy matching on the files to be scanned in sequence according to the scanning strategies in the scanning strategy list to determine the scanning results.
[0158] As in the above device, optionally, the receiving and obtaining module 710 is specifically used for:
[0159] If the time information associated with the file scanning task is system time information, the current system time is obtained; if the current system time is consistent with the system time information, the system time information is used as the time information corresponding to the scanning task.
[0160] As in the above device, optionally, the receiving and obtaining module 710 is specifically used for:
[0161] If the time information associated with the file scanning task is file time information, obtaining file attribute information of the file to be scanned;
[0162] The file time attribute of the file to be scanned is searched from the file attribute information, and if the file time attribute is consistent with the file time information, the file time attribute is used as the time information corresponding to the scanning task.
[0163] As the above device, optionally, further comprises: a creation module, used to create a scanning strategy and set a strategy time attribute corresponding to the scanning strategy before receiving the file scanning task;
[0164] Scan policies with the same policy time attributes are saved in the same scan policy list.
[0165] As the above device, optionally, further comprises: an adding module, used to add a scanning strategy and set a strategy time attribute corresponding to the scanning strategy;
[0166] The scanning policy is added to a scanning policy list having the same time attribute as the policy.
[0167] As in the above device, optionally, the scanning module 730 is specifically used for:
[0168] Determining the scanning policy rules in the scanning policy list in sequence;
[0169] Calling the matching interface corresponding to the scanning policy rule to perform policy matching;
[0170] The information matching the scanning strategy is saved.
[0171] As in the above device, optionally, the receiving and obtaining module 710 is further used for:
[0172] Obtaining the user group authority corresponding to the file to be scanned;
[0173] Determine a user grouping strategy list according to the user grouping authority;
[0174] Determine a scanning strategy group according to the scanning strategy list and the user group strategy list;
[0175] Accordingly, the scanning module 730 is specifically used for:
[0176] According to the scanning strategies in the scanning strategy group, the strategies of the files to be scanned are matched in sequence to determine the scanning results.
[0177] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment, which will not be repeated here.
[0178] Reference Figure 8 , shows a structural block diagram of an electronic device embodiment of the present invention, the device includes: a processor (processor) 810, a memory (memory) 820 and a bus 830;
[0179] The processor 810 and the memory 820 communicate with each other via the bus 830;
[0180] The processor 810 is used to call the program instructions in the memory 820 to execute the methods provided by the above-mentioned method embodiments, for example, including: receiving a file scanning task, obtaining the time information and the file to be scanned corresponding to the scanning task; loading a scanning strategy list that matches the time information according to the strategy time attribute; and matching the strategies of the files to be scanned in turn according to the scanning strategies in the scanning strategy list to determine the scanning results.
[0181] An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: receiving a file scanning task, obtaining time information and a file to be scanned corresponding to the scanning task; loading a scanning strategy list that matches the time information according to the strategy time attribute; and performing strategy matching on the file to be scanned in turn according to the scanning strategies in the scanning strategy list to determine the scanning results.
[0182] An embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: receiving a file scanning task, obtaining time information and a file to be scanned corresponding to the scanning task; loading a scanning strategy list that matches the time information according to the strategy time attribute; and performing strategy matching on the file to be scanned in turn according to the scanning strategies in the scanning strategy list to determine the scanning results.
[0183] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0184] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, devices or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0185] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0186] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0188] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0189] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0190] The above is a detailed introduction to a file scanning method, a file scanning device, an electronic device and a storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A file scanning method, characterized in that: include: Receive a file scanning task, and obtain time information and files to be scanned corresponding to the scanning task; According to the policy time attribute, loading a scanning policy list that matches the time information; According to the scanning strategies in the scanning strategy list, the strategies of the files to be scanned are matched in turn to determine the scanning results.
2. The method according to claim 1, characterized in that The acquiring the time information corresponding to the scanning task includes: If the time information associated with the file scanning task is system time information, obtaining the current system time; If the current system time is consistent with the system time information, the system time information is used as the time information corresponding to the scanning task.
3. The method according to claim 1, characterized in that: The acquiring the time information corresponding to the scanning task includes: If the time information associated with the file scanning task is file time information, obtaining file attribute information of the file to be scanned; The file time attribute of the file to be scanned is searched from the file attribute information, and if the file time attribute is consistent with the file time information, the file time attribute is used as the time information corresponding to the scanning task.
4. The method according to claim 1, characterized in that: Before receiving a file scanning task, it also includes: Create a scanning policy and set the policy time attribute corresponding to the scanning policy; Scan policies with the same policy time attributes are saved in the same scan policy list.
5. The method according to claim 1, characterized in that Also includes: Add a scanning policy and set the policy time attribute corresponding to the scanning policy; The scanning policy is added to a scanning policy list having the same time attribute as the policy.
6. The method according to claim 1, characterized in that The step of matching the scanned files with the scanned policies in the scan policy list in turn to determine the scan results includes: Determining the scanning policy rules in the scanning policy list in sequence; Calling the matching interface corresponding to the scanning policy rule to perform policy matching; The information matching the scanning strategy is saved.
7. The method according to any one of claims 1 to 6, characterized in that: Also includes: Obtaining the user group authority corresponding to the file to be scanned; Determine a user grouping strategy list according to the user grouping authority; Determine a scanning strategy group according to the scanning strategy list and the user group strategy list; Correspondingly, the scanning strategies in the scanning strategy list are sequentially matched to the files to be scanned to determine the scanning results, including: According to the scanning strategies in the scanning strategy group, the strategies of the files to be scanned are matched in sequence to determine the scanning results.
8. A document scanning device, characterized in that: include: A receiving and obtaining module, used for receiving a file scanning task, and obtaining time information and a file to be scanned corresponding to the scanning task; A loading module, used to load a scanning strategy list that matches the time information according to the strategy time attribute; The scanning module is used to match the scanning strategies in the scanning strategy list with the files to be scanned in turn to determine the scanning results.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor and the memory communicate with each other via a bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 7 by calling the program instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Computer virus monitoring method and device
CN103049695A
Data processing method and device, nonvolatile storage medium and processor
CN113794690A
Access control system, device and program
JP2006053824A
