File filtering method, device, equipment and medium
By adjusting the filtering conditions in the network file system, efficient file filtering in multiple systems is achieved, solving the problems of high manual investment and low accuracy, and is suitable for the file filtering method of the NFS protocol.
Patent Information
- Application Number
- CN202210900703.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-28
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-07-28
AI Technical Summary
The existing network file system lacks filtering function when operating massive files, resulting in high cost of manual investment and inability to guarantee accuracy, especially in Linux systems, the CIFS protocol is not applicable.
By obtaining the current filtering conditions and the previous filtering conditions in the service configuration file of the network file system, adjusting the difference conditions to obtain the current target filtering conditions, and using the network file system protocol for file filtering, supporting file filtering in multiple systems.
It reduces the workload of manually setting filtering conditions, improves the accuracy and efficiency of file filtering, and is suitable for multiple system environments.
Smart Images

Figure CN115203143B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a file filtering method, device, equipment and medium. Background Art
[0002] With the development of distributed storage, it has become common to use the NFS (Network File System) protocol to operate massive files. Without a filtering function, manual filtering is required when operating files, and accuracy cannot be guaranteed. Among existing network communication protocols, CIFS (Common Internet File System) supports file filtering, but the CIFS protocol is mainly used in Windows systems and is not suitable for Linux systems.
[0003] From the above, it can be seen that how to implement file filtering in various systems to reduce labor costs is a problem to be solved in this field. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a file filtering method, device, equipment and medium that can implement file filtering in various systems. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a file filtering method, comprising:
[0006] Get the current filter condition and the previous filter condition in the network file system service configuration file;
[0007] Adjusting the previous filtering condition based on the current filtering condition to obtain a current target filtering condition;
[0008] The client of the network file system is mounted to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file.
[0009] Optionally, adjusting the previous filtering condition based on the current filtering condition to obtain the current target filtering condition includes:
[0010] Determine whether the current filtering condition is consistent with the previous filtering condition;
[0011] If they are inconsistent, the difference between the current filtering condition and the previous filtering condition is determined, and the previous filtering condition is adjusted based on the difference to obtain the current target filtering condition.
[0012] Optionally, adjusting the previous filtering condition based on the difference condition to obtain the current target filtering condition includes:
[0013] Determining whether the difference condition meets a preset condition;
[0014] If the conditions are met, a linked list structure for storing the corresponding previous filtering condition in the service configuration file is removed from the linked list, and the corresponding memory is released.
[0015] Optionally, before obtaining the current filtering condition and the previous filtering condition in the service configuration file of the network file system, the method further includes:
[0016] The previous filtering condition is stored in the corresponding linked list structure in the service configuration file.
[0017] Optionally, storing the previous filtering condition in the corresponding linked list structure in the service configuration file includes:
[0018] Using a preset segmentation condition to segment a plurality of the previous filtering conditions;
[0019] The divided last filtering conditions are respectively stored in the corresponding linked list structures in the service configuration file, and the memory of the corresponding size is allocated to the divided last filtering conditions.
[0020] Optionally, mounting the client of the network file system to the server so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file includes:
[0021] The client of the network file system is mounted to the server, so as to determine the current file to be filtered by using the network file system protocol and the current target filtering condition, and filter the current file to be filtered from the current file to obtain the target file.
[0022] Optionally, after filtering the current file to be filtered from the current file, the method further includes:
[0023] Generate preset prompt information corresponding to the current file to be filtered, and display the preset prompt information through a preset prompt interface.
[0024] In a second aspect, the present application discloses a file filtering device, comprising:
[0025] Condition acquisition module, used to obtain the current filter condition and the previous filter condition in the service configuration file of the network file system;
[0026] A condition adjustment module, configured to adjust the previous filtering condition based on the current filtering condition to obtain a current target filtering condition;
[0027] The file filtering module is used to mount the client of the network file system to the server, so as to filter the current file by using the network file system protocol and the current target filtering condition to obtain the target file.
[0028] In a third aspect, the present application discloses an electronic device, comprising:
[0029] Memory, used to store computer programs;
[0030] The processor is configured to execute the computer program to implement the steps of the aforementioned disclosed file filtering method.
[0031] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed file filtering method are implemented.
[0032] It can be seen that the present application obtains the current filtering condition and the previous filtering condition in the service configuration file of the network file system; adjusts the previous filtering condition based on the current filtering condition to obtain the current target filtering condition; mounts the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file. It can be seen that the previous filtering condition is adjusted in the service configuration file of the network file system in each system to obtain the current target filtering condition, and the current file is filtered using the network file system protocol and the current target filtering condition to obtain the target file, thereby reducing the labor input cost and improving efficiency when operating files. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0034] Figure 1 A flow chart of a file filtering method disclosed in this application;
[0035] Figure 2 A flowchart of a specific file filtering method disclosed in this application;
[0036] Figure 3This is a structural diagram of a file filtering device disclosed in this application;
[0037] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0039] With the development of distributed storage, it has become common to use the NFS protocol to operate massive files. Without filtering functions, manual filtering is required when operating files, and accuracy cannot be guaranteed. Among existing network communication protocols, CIFS supports file filtering, but the CIFS protocol is mainly used in Windows systems and is not suitable for Linux systems.
[0040] To this end, this application provides a file filtering solution that can implement file filtering in various systems to reduce labor costs.
[0041] See also Figure 1 As shown, the embodiment of the present application discloses a file filtering method, including:
[0042] Step S11: obtaining the current filtering condition and the previous filtering condition in the service configuration file of the network file system.
[0043] In this embodiment, the NFS network file system is one of the current mainstream heterogeneous platform shared file systems, which allows computers in the network to share resources through the TCP (Transmission Control Protocol) / IP (Internet Protocol) network. It is mainly used to share directories and files in the UNIX environment. The working principle of NFS is to use a client / server architecture, consisting of a client program and a server program. In massive storage and distributed file and object storage, the NFS protocol has a wide range of applications. NFS operation words: Network file system operation words refer to a series of methods for operating files. Files can be in multiple states, so that users or processes can operate on files. The network file system calls the lib in ceph (distributed file system) through operation words to implement the functions corresponding to the operation words. CIFS is a communication protocol for network file sharing between Windows hosts. Lib is a computer file format, and there are two types of libs. One is a static library, such as the C-Runtime library. This type of lib contains function implementation code and is generally used in static linking. It adds the code in the lib to the target module file, where the target module can be an EXE (executable) or a DLL (Dynamic Link Library). Therefore, after linking, the lib file is useless. Another type of lib is used in conjunction with a DLL. It does not contain any code, but the code is in the DLL. This type of lib is used for statically calling the DLL, so it also serves as a link. Once the link is completed, the lib is no longer useful.
[0044] Step S12: adjusting the previous filtering condition based on the current filtering condition to obtain the current target filtering condition.
[0045] In this embodiment, it can be understood that if the current filtering condition is consistent with the previous filtering condition, then the previous filtering condition can be directly used as the current target filtering condition. If the current filtering condition is inconsistent with the previous filtering condition, then the condition in which there is a difference between the current filtering condition and the previous filtering condition, that is, the difference condition, is determined, and the difference condition is used to adjust the previous filtering condition to obtain the current target filtering condition. For example, the previous filtering condition 1 is to filter out files within a preset period, and the previous filtering condition 2 is to filter out files in a preset file library. Therefore, it can be inferred that the previous target file after filtering based on the previous filtering condition 1 and the previous filtering condition 2 is a file that is neither in the preset file library nor within the preset period. If the current filtering condition is only to filter out files within the preset period, then the determined difference condition is to filter out files in the preset file library, so the previous filtering condition 2 is deleted based on the difference condition, and only the previous filtering condition 1 is retained, and the previous filtering condition 1 is used as the current target filtering condition. In the network file system service configuration file, filter conditions can be dynamically modified and deleted without restarting the network file system service, ensuring normal business operations. When modifying, the linked list structure storing the filter conditions is updated. When deleting, the linked list structure storing the filter conditions is first removed from the linked list and then the memory is released. It is also possible to adjust only the specific position of a condition in the previous filter based on the difference condition. For example, if the previous filter condition is to filter out files not dated between March 5, 2019 and March 28, 2022, and the current filter condition is to filter out files not dated between March 5, 2019 and March 28, 2021, then you only need to modify "2022" in the previous filter condition to "2021" so that the previous filter condition filters out files not dated between March 5, 2019 and March 28, 2021, making the previous filter condition the current target filter condition. It should be noted that the current file is being filtered. When filtering the next file, the current target filtering condition needs to be updated to the previous filtering condition, and when filtering the next file, it needs to be updated to the current file filtering condition.
[0046] In this embodiment, when storing multiple previous filter conditions, if there are multiple previous filter conditions, the multiple previous filter conditions can be segmented using a preset segmentation condition; the segmented previous filter conditions are respectively stored in the corresponding linked list structure in the service configuration file, and the memory of the corresponding size is allocated to the segmented previous filter conditions. The service configuration file of the network file system supports setting multiple filter conditions, and the filter conditions can be separated by a preset segmentation character, such as " / ". The configured filter conditions are segmented using " / ", and each segmentation is stored in the linked list structure, which facilitates dynamic memory allocation.
[0047] Step S13: Mounting the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file.
[0048] In this embodiment, mounting the client of the network file system to the server so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file specifically includes: mounting the client of the network file system to the server so as to determine the current file to be filtered using the network file system protocol and the current target filtering condition, and filtering the current file to be filtered from the current file to obtain the target file.
[0049] In this embodiment, after the client of the network file system is mounted on the server, operations such as creating directories or files are performed, and the linked list structure of the storage filter conditions is traversed in the process of triggering operation words in the network file system protocol, where the operation words may include mkdir (create directory), create (create file), remove (delete file or directory), rename (rename file), and readdir (display directory and files).
[0050] In this embodiment, after filtering the current file to be filtered from the current file, it also includes: generating preset prompt information corresponding to the current file to be filtered, and displaying the preset prompt information through a preset prompt interface. When the user searches for file 1, relevant information corresponding to file 1, such as the file name, can be entered in the preset search interface. If file 1 has been filtered out based on the current target filtering conditions, a preset prompt information corresponding to file 1 is generated. The preset prompt information can be "File 1 has been filtered based on the current target filtering conditions", and the preset prompt information is displayed through the preset prompt interface so that the user can perform corresponding processing based on the preset prompt information. It can be understood that the preset prompt information is also a kind of operation word error code.
[0051] It can be seen that the present application obtains the current filtering condition and the previous filtering condition in the service configuration file of the network file system; adjusts the previous filtering condition based on the current filtering condition to obtain the current target filtering condition; mounts the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file. It can be seen that the previous filtering condition is adjusted in the service configuration file of the network file system in each system to obtain the current target filtering condition, and the current file is filtered using the network file system protocol and the current target filtering condition to obtain the target file, thereby reducing the labor input cost and improving efficiency when operating files.
[0052] See also Figure 2 As shown, the embodiment of the present application discloses a specific file filtering method, including:
[0053] Step S21: obtaining the current filtering condition and the previous filtering condition in the service configuration file of the network file system.
[0054] In this embodiment, before obtaining the current filtering condition and the previous filtering condition in the service configuration file of the network file system, the method further includes: storing the previous filtering condition in the corresponding linked list structure in the service configuration file.
[0055] In this embodiment, storing the previous filter condition in the corresponding linked list structure in the service configuration file specifically includes: using a preset segmentation condition to segment a plurality of the previous filter conditions; storing the segmented previous filter conditions in the corresponding linked list structure in the service configuration file, and allocating a corresponding size of memory to the segmented previous filter conditions. The service configuration file of the network file system supports setting multiple filter conditions. The filter conditions can be segmented using a preset segmentation character, such as " / ". The wildcard "?" is used in the filter condition to represent an arbitrary character, and the wildcard "*" can represent an arbitrary string of characters. The configured filter condition is segmented using " / ", and each segmentation is performed, the filter condition is stored in the linked list structure, which facilitates dynamic allocation of memory size.
[0056] Step S22: Determine whether the current filtering condition is consistent with the previous filtering condition; if not, determine the difference between the current filtering condition and the previous filtering condition, and adjust the previous filtering condition based on the difference to obtain the current target filtering condition.
[0057] In this embodiment, the previous filtering condition is adjusted based on the difference condition to obtain the current target filtering condition, specifically including: determining whether the difference condition meets the preset condition; if so, removing the linked list structure used to store the corresponding previous filtering condition in the service configuration file, and releasing the corresponding memory. It can be understood that, for example, the previous filtering condition is only to filter out files that are not within the preset period, and the current filtering condition is two filtering conditions, namely current filtering condition 1: filter out files that are not within the preset period, and current filtering condition 2: filter out files that are not in the preset file library. It can be determined that the previous filtering condition is inconsistent with the current filtering condition, and it is determined that the difference condition is to filter out files that are not within the preset period. Then, the difference condition can be added to the corresponding position in the previous filtering condition, that is, the previous filtering condition is adjusted to obtain the current target filtering condition; the previous filtering condition can also be modified. For example, the previous filtering condition is to filter out files that are not between February 10, 2022 and February 15, 2022, and the current filtering condition is to filter out files that are not between February 10, 2022 and February 27, 2022. Then, you only need to modify the corresponding content in the previous filtering condition so that the previous filtering condition is to filter out files that are not between February 10, 2022 and February 27, 2022, and then make the previous filtering condition the current target filtering condition. It should be noted that the current file is being filtered. When filtering the next file, the current target filtering condition needs to be updated to the previous filtering condition, and when filtering the next file, it needs to be updated to the current file filtering condition.
[0058] Step S23: Mounting the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file.
[0059] In this embodiment, the current target filtering condition can be set not only to filter the current file, but also to filter the directory level in the current file, which is more detailed and specific.
[0060] It can be seen from this that in this application, if the current filtering file is inconsistent with the previous filtering file, the difference condition can be determined, and the previous filtering file can be adjusted based on the difference condition to obtain the current target filtering file. Therefore, there is no need to reset the complete current filtering file. It is only necessary to adjust the previous filtering file based on the difference file, which greatly reduces the workload of setting the filtering conditions, thereby improving the speed and efficiency of subsequent file filtering and reducing labor costs. Because the accuracy of manually set filtering conditions is low, reducing the manually set filtering conditions can further improve the accuracy of file filtering.
[0061] See also Figure 3As shown, the embodiment of the present application discloses a file filtering device, comprising:
[0062] Condition acquisition module 11, used to obtain the current filtering condition and the previous filtering condition in the service configuration file of the network file system;
[0063] A condition adjustment module 12, configured to adjust the previous filtering condition based on the current filtering condition to obtain a current target filtering condition;
[0064] The file filtering module 13 is used to mount the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file.
[0065] Among them, the condition adjustment module 12 is specifically used to: if the current filtering condition is consistent with the previous filtering condition, then the previous filtering condition can be directly used as the current target filtering condition; if the current filtering condition is inconsistent with the previous filtering condition, then the condition in which there is a difference between the current filtering condition and the previous filtering condition, that is, the difference condition, is determined, and the difference condition is used to adjust the previous filtering condition to obtain the current target filtering condition. For example, the previous filtering condition 1 is to filter out files within a preset period, and the previous filtering condition 2 is to filter out files in a preset file library. Therefore, it can be inferred that the previous target file after filtering based on the previous filtering condition 1 and the previous filtering condition 2 is a file that is neither in the preset file library nor within the preset period. If the current filtering condition is only to filter out files within the preset period, then the determined difference condition is to filter out files in the preset file library, so the previous filtering condition 2 is deleted based on the difference condition, and only the previous filtering condition 1 is retained, and the previous filtering condition 1 is used as the current target filtering condition. You can also adjust only the specific position of a certain condition in the previous filter condition based on the difference condition. For example, if the previous filter condition was to filter out files not dated between March 5, 2019 and March 28, 2022, and the current filter condition is to filter out files not dated between March 5, 2019 and March 28, 2021, then you only need to change "2022" in the previous filter condition to "2021" so that the previous filter condition filters out files not dated between March 5, 2019 and March 28, 2021, and thus the previous filter condition becomes the current target filter condition. It should be noted that the current target filter condition is currently being filtered, so when filtering the next file, the current target filter condition needs to be updated to the previous filter condition, and when filtering the next file, it needs to be updated to the current file filter.
[0066] The condition adjustment module 12 is specifically used to: determine whether the difference condition meets the preset condition; if so, remove the linked list structure used to store the corresponding previous filtering condition in the service configuration file, and release the corresponding memory. It can be understood that, for example, the previous filtering condition is only to filter out files that are not within the preset period, and the current filtering condition is two filtering conditions, namely current filtering condition 1: filter out files that are not within the preset period, and current filtering condition 2: filter out files that are not in the preset file library. It can be determined that the previous filtering condition is inconsistent with the current filtering condition, and it is determined that the difference condition is to filter out files that are not within the preset period. Then, the difference condition can be added to the corresponding position in the previous filtering condition, that is, the previous filtering condition is adjusted to obtain the current target filtering condition; the previous filtering condition can also be modified. For example, the previous filtering condition is to filter out files that are not between February 10, 2022 and February 15, 2022, and the current filtering condition is to filter out files that are not between February 10, 2022 and February 27, 2022. Then, you only need to modify the corresponding content in the previous filtering condition so that the previous filtering condition is to filter out files that are not between February 10, 2022 and February 27, 2022, and then make the previous filtering condition the current target filtering condition. It should be noted that the current file is being filtered. When filtering the next file, the current target filtering condition needs to be updated to the previous filtering condition, and when filtering the next file, it needs to be updated to the current file filtering condition.
[0067] The file filtering device is specifically configured to store the last filtering condition in the corresponding linked list structure in the service configuration file.
[0068] The file filtering device is specifically configured to: split a plurality of the previous filtering conditions using a preset splitting condition; store the splitted previous filtering conditions in the corresponding linked list structure in the service configuration file; and allocate a corresponding amount of memory to the splitted previous filtering conditions. The service configuration file of the network file system supports setting multiple filtering conditions, and the filtering conditions can be separated by a preset separator character, such as " / ". The configured filtering conditions are separated by " / ", and each filter condition is stored in the linked list structure after each split, thereby facilitating dynamic memory allocation.
[0069] The file filtering device is specifically used to: generate preset prompt information corresponding to the current file to be filtered, and display the preset prompt information through a preset prompt interface. When a user searches for file 1, he can enter relevant information corresponding to file 1, such as the file name, in the preset search interface. If file 1 has been filtered out based on the current target filtering conditions, a preset prompt information corresponding to file 1 is generated. The preset prompt information can be "File 1 has been filtered based on the current target filtering conditions", and the preset prompt information is displayed through the preset prompt interface so that the user can perform corresponding processing based on the preset prompt information. It can be understood that the preset prompt information is also a kind of operation word error code.
[0070] It can be seen that the present application obtains the current filtering condition and the previous filtering condition in the service configuration file of the network file system; adjusts the previous filtering condition based on the current filtering condition to obtain the current target filtering condition; mounts the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file. It can be seen that the previous filtering condition is adjusted in the service configuration file of the network file system in each system to obtain the current target filtering condition, and the current file is filtered using the network file system protocol and the current target filtering condition to obtain the target file, thereby reducing the labor input cost and improving efficiency when operating files.
[0071] In some specific embodiments, the condition adjustment module 12 includes:
[0072] A first judging unit, configured to judge whether the current filtering condition is consistent with the previous filtering condition;
[0073] The filtering condition obtaining unit is configured to determine a difference between the current filtering condition and the previous filtering condition if there is any inconsistency, and adjust the previous filtering condition based on the difference to obtain the current target filtering condition.
[0074] In some specific embodiments, the condition adjustment module 12 includes:
[0075] A second judging unit, configured to judge whether the difference condition satisfies a preset condition;
[0076] The removing unit is used to remove the linked list structure for storing the corresponding previous filtering condition in the service configuration file if the condition is met, and release the corresponding memory.
[0077] In some specific embodiments, the file filtering device further includes:
[0078] A storage unit is configured to store the previous filtering condition in the corresponding linked list structure in the service configuration file.
[0079] In some specific embodiments, the storage unit includes:
[0080] A segmentation unit, configured to segment the plurality of previous filtering conditions using a preset segmentation condition;
[0081] A memory allocation unit is used to store the divided last filtering condition in the corresponding linked list structure in the service configuration file, and allocate the memory of the corresponding size to the divided last filtering condition.
[0082] In some specific embodiments, the file filtering module 13 includes:
[0083] The target file acquisition unit is used to mount the client of the network file system to the server, so as to determine the current file to be filtered by using the network file system protocol and the current target filtering condition, and filter the current file to be filtered from the current file to obtain the target file.
[0084] In some specific embodiments, the file filtering device further includes:
[0085] The prompt information display unit is used to generate preset prompt information corresponding to the current file to be filtered, and display the preset prompt information through a preset prompt interface.
[0086] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the following steps:
[0087] Get the current filter condition and the previous filter condition in the network file system service configuration file;
[0088] Adjusting the previous filtering condition based on the current filtering condition to obtain a current target filtering condition;
[0089] The client of the network file system is mounted to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file.
[0090] In some specific implementations, the processor may implement the following steps by executing the computer program stored in the memory:
[0091] Determine whether the current filtering condition is consistent with the previous filtering condition;
[0092] If they are inconsistent, the difference between the current filtering condition and the previous filtering condition is determined, and the previous filtering condition is adjusted based on the difference to obtain the current target filtering condition.
[0093] In some specific implementations, the processor may implement the following steps by executing the computer program stored in the memory:
[0094] Determining whether the difference condition meets a preset condition;
[0095] If the conditions are met, a linked list structure for storing the corresponding previous filtering condition in the service configuration file is removed from the linked list, and the corresponding memory is released.
[0096] In some specific implementations, the processor may implement the following steps by executing the computer program stored in the memory:
[0097] The previous filtering condition is stored in the corresponding linked list structure in the service configuration file.
[0098] In some specific implementations, the processor may implement the following steps by executing the computer program stored in the memory:
[0099] Using a preset segmentation condition to segment a plurality of the previous filtering conditions;
[0100] The divided last filtering conditions are respectively stored in the corresponding linked list structures in the service configuration file, and the memory of the corresponding size is allocated to the divided last filtering conditions.
[0101] In some specific implementations, the processor may implement the following steps by executing the computer program stored in the memory:
[0102] The client of the network file system is mounted to the server, so as to determine the current file to be filtered by using the network file system protocol and the current target filtering condition, and filter the current file to be filtered from the current file to obtain the target file.
[0103] In some specific embodiments, the processor may further include the following steps by executing the computer program stored in the memory:
[0104] Generate preset prompt information corresponding to the current file to be filtered, and display the preset prompt information through a preset prompt interface.
[0105] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0106] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0107] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0108] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device, enabling the processor 21 to calculate and process the massive amount of data 223 in the memory 22. It can be Windows, Unix, Linux, etc. In addition to including computer programs capable of implementing the file filtering method disclosed in any of the aforementioned embodiments and executed by the electronic device, the computer programs 222 may further include computer programs capable of performing other specific tasks. Data 223 may include data received by the electronic device from external devices as well as data collected by its own input and output interface 25.
[0109] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the method steps performed in the file filtering process disclosed in any of the aforementioned embodiments are implemented.
[0110] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0111] The above is a detailed introduction to a file filtering method, device, equipment and 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 intended to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A file filtering method, characterized in that: include: Get the current filter condition and the previous filter condition in the network file system service configuration file; Adjusting the previous filtering condition based on the current filtering condition to obtain a current target filtering condition; Mounting the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file; The adjusting the previous filtering condition based on the current filtering condition to obtain the current target filtering condition includes: Determine whether the current filtering condition is consistent with the previous filtering condition; if not, determine the difference between the current filtering condition and the previous filtering condition, and adjust the previous filtering condition based on the difference to obtain the current target filtering condition; if consistent, determine the previous filtering condition as the current target filtering condition; The adjusting the previous filtering condition based on the difference condition to obtain the current target filtering condition includes: Determine whether the difference condition meets a preset condition; if so, remove the linked list structure for storing the corresponding previous filtering condition in the service configuration file and release the corresponding memory; Before obtaining the current filtering condition and the previous filtering condition in the service configuration file of the network file system, the method further includes: The plurality of previous filter conditions are segmented using a preset segmentation condition and a preset segmentation character; the segmented previous filter conditions are respectively stored in the corresponding linked list structure in the service configuration file, and the memory of the corresponding size is allocated to the segmented previous filter conditions.
2. The file filtering method according to claim 1, wherein: Mounting the client of the network file system to the server so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file includes: The client of the network file system is mounted to the server, so as to determine the current file to be filtered by using the network file system protocol and the current target filtering condition, and filter the current file to be filtered from the current file to obtain the target file.
3. The file filtering method according to claim 2, characterized in that: After filtering the current file to be filtered from the current file, the method further includes: Generate preset prompt information corresponding to the current file to be filtered, and display the preset prompt information through a preset prompt interface.
4. A file filtering device, characterized in that: include: Condition acquisition module, used to obtain the current filter condition and the previous filter condition in the service configuration file of the network file system; A condition adjustment module, configured to adjust the previous filtering condition based on the current filtering condition to obtain a current target filtering condition; A file filtering module is used to mount the client of the network file system to the server, so as to filter the current file using the network file system protocol and the current target filtering condition to obtain the target file; The file filtering device is specifically used for: Determine whether the current filtering condition is consistent with the previous filtering condition; If they are inconsistent, determining the difference between the current filtering condition and the previous filtering condition, and adjusting the previous filtering condition based on the difference to obtain the current target filtering condition; if they are consistent, determining the previous filtering condition as the current target filtering condition; The file filtering device is specifically used for: Determine whether the difference condition meets a preset condition; if so, remove the linked list structure for storing the corresponding previous filtering condition in the service configuration file and release the corresponding memory; The file filtering device is specifically used for: The plurality of previous filter conditions are segmented using a preset segmentation condition and a preset segmentation character; the segmented previous filter conditions are respectively stored in the corresponding linked list structure in the service configuration file, and the memory of the corresponding size is allocated to the segmented previous filter conditions.
5. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the file filtering method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the file filtering method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Data display method, system and device, storage medium and electronic equipment
CN112559576A