CN115687244A - File processing monitoring method, device, equipment and medium - Google Patents

File processing monitoring method, device, equipment and medium Download PDF

Info

Publication number
CN115687244A
CN115687244A CN202211356758.XA CN202211356758A CN115687244A CN 115687244 A CN115687244 A CN 115687244A CN 202211356758 A CN202211356758 A CN 202211356758A CN 115687244 A CN115687244 A CN 115687244A
Authority
CN
China
Prior art keywords
file
identification information
data structure
function
file identification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211356758.XA
Other languages
Chinese (zh)
Inventor
迟银宝
宋伟强
张鹏毅
李刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN202211356758.XA priority Critical patent/CN115687244A/en
Publication of CN115687244A publication Critical patent/CN115687244A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a file processing monitoring method, a device, equipment and a medium, wherein the method comprises the following steps: scanning the monitoring directory to obtain at least one file identification information in the monitoring directory; adding file identification information which is not stored in the first data structure in at least one file identification information to the first data structure; and after the target file in the first data structure completes service processing, updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory. By the scheme, the same target file is prevented from being repeatedly processed, and resource waste is reduced. Meanwhile, the influence on the first data structure caused by continuous stacking of file identification information is avoided, and the monitoring efficiency and the service processing performance are improved. Moreover, the comprehensiveness of the file identification information in the first data structure can be ensured, the condition of monitoring omission is avoided, and the reliability of service processing monitoring is improved.

Description

File processing monitoring method, device, equipment and medium
Technical Field
The embodiment of the invention relates to the technical field of file monitoring, in particular to a file processing monitoring method, device, equipment and medium.
Background
The file processing monitoring refers to monitoring the business processing condition of the file. The file processing monitoring can avoid the waste of resource use caused by repeated processing of files.
In the prior art, file processing monitoring is performed by using a method of recording file identification information by using HashSet (a set without repeated elements), or recording file identification information by using ArrayList (an array which can be dynamically modified). In the two methods, when the number of files processed by the service is increased or the service processing time is increased, file identification information is piled up, so that the monitoring efficiency and the service processing performance are reduced.
Disclosure of Invention
The invention provides a file processing monitoring method, a file processing monitoring device, file processing monitoring equipment and a file processing monitoring medium, which are used for improving monitoring efficiency and service processing performance.
According to an aspect of the present invention, there is provided a file processing monitoring method, including:
scanning a monitoring directory to obtain at least one file identification information in the monitoring directory;
adding file identification information which is not stored in a first data structure in the at least one file identification information to the first data structure;
and after the target file in the first data structure completes service processing, updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory.
According to another aspect of the present invention, there is provided a document processing monitoring apparatus including:
the file identification information acquisition module is used for scanning the monitoring directory to obtain at least one piece of file identification information in the monitoring directory;
a first data structure adding module, configured to add file identification information that is not stored in a first data structure in the at least one file identification information to the first data structure;
and the first data structure updating module is used for updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory after the target file in the first data structure completes service processing.
According to another aspect of the present invention, there is provided an electronic apparatus including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute any file processing monitoring method provided by the embodiment of the invention.
According to another aspect of the present invention, there is also provided a computer-readable storage medium storing computer instructions for causing a processor to implement any one of the file processing monitoring methods provided by the embodiments of the present invention when the computer instructions are executed.
The embodiment of the invention provides a file processing monitoring scheme, which comprises the steps of scanning a monitoring directory to obtain at least one file identification information in the monitoring directory; adding file identification information which is not stored in the first data structure in at least one file identification information to the first data structure; and after the target file in the first data structure completes the service processing, updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory. According to the scheme, the existence condition of the file identification information of the target file in the monitoring directory is monitored by introducing the first data structure, so that the repeated processing of the same target file is avoided, and the resource waste is reduced. Meanwhile, according to the existence condition of the file identification information, the first data structure can update the stored file identification information, the performance influence on the first data structure caused by structural expansion due to continuous stacking of the file identification information is avoided, and the monitoring efficiency and the service processing performance are improved. In addition, the file identification information which is not stored in the first data structure in the at least one file identification information is added to the first data structure, so that the comprehensiveness of the file identification information in the first data structure can be ensured, the condition of monitoring omission is avoided, and the reliability of service processing monitoring is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a file processing monitoring method according to an embodiment of the present invention;
fig. 2 is a flowchart of a file processing monitoring method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a document processing monitoring apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device for implementing a file processing monitoring method according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 1 is a flowchart of a file processing monitoring method according to an embodiment of the present invention, where the embodiment is applicable to a case of monitoring a file processing process, and the method may be executed by a file processing monitoring apparatus, where the apparatus may be implemented in a software and/or hardware manner, and may be configured in an electronic device bearing a data processing function, such as a server.
Referring to fig. 1, the document processing monitoring method includes:
s110, scanning the monitoring directory to obtain at least one piece of file identification information in the monitoring directory.
The monitoring directory refers to a tool formed by arranging files according to a certain sequence. The monitoring directory records file identification information of the file. The file identification information may be information that uniquely characterizes the file identity. The file identification information may include at least one of a file name and a file type. The file type is not limited in any way in the embodiment of the present invention, and may be at least one of zip (compressed package) or txt (plain text file).
In the embodiment of the invention, the monitoring directory is in a real-time updating state, and the monitoring directory can be scanned in real time or at regular time to obtain at least one file identification information in the monitoring directory. In a specific implementation manner, under the condition of timing scanning, when a preset scanning frequency is reached, scanning a monitoring directory to obtain at least one piece of file identification information in the monitoring directory; if not, scanning is prohibited. The scanning frequency is not limited in any way in the embodiment of the invention, and can be set by a technician according to experience or actual requirements.
It should be noted that, when the monitoring directory is scanned while meeting the preset scanning rule, all the file identification information in the monitoring directory is scanned.
S120, adding file identification information which is not stored in the first data structure in the at least one file identification information to the first data structure.
The first data structure refers to a storage structure which can be used for filtering and storing read file identification information in the monitoring directory.
Specifically, for any file identification information, if the file identification information is stored in the monitoring directory but not stored in the first data structure, the file identification information is added to the first data structure.
In the embodiment of the invention, the file identification information which is not stored in the first data structure in the at least one file identification information is added to the first data structure by a method of calling a function.
Optionally, an identifier reading function may be called, and if a read lock is not added to the identifier reading function, file identifier information in the first data structure is read; and calling an identification adding function, and if the identification adding function does not add a write lock, adding unread file identification information in at least one file identification information to the first data structure.
Wherein the identification reading function may be used to read file identification information in the data structure. An identity addition function may be used to add file identity information to the data structure. The embodiment of the present invention does not limit the specific implementation manner of the identifier reading function and the identifier adding function, and may be set by a technician according to needs or habits.
The read lock of the identifier reading function is used for controlling the identifier reading function to realize only one reading request (namely, a call request to the identifier reading function) at the same time. The write lock of the identification adding function is used for controlling the identification adding function to realize only one adding request (namely a calling request for the identification adding function) at the same time. The embodiment of the present invention does not limit the implementation manner of the read request and the add request, and may be set by a technician as needed. Illustratively, the read request may be implemented by a read thread and the add request may be implemented by an add thread. Wherein the read thread is a thread dedicated to reading file identification information in the data structure. An add thread is a thread dedicated to adding file identification information to a data structure.
In the embodiment of the invention, in order to ensure the reading orderliness, the identification reading function can only respond to one reading request at a time; if at least two reading requests exist simultaneously, the reading lock is set, the identification reading function is controlled to only respond to one reading request, and other reading requests wait. Specifically, an identifier reading function is called in response to any one reading request, and if a reading lock is added to the identifier reading function, the reading request waits for the reading lock of the identifier reading function to be released; and if the reading lock is not added by the identification reading function, responding to the reading request, and reading the file identification information in the first data structure.
If the file identification information in the first data structure is read, and compared with the file identification information in the monitoring directory, at least one piece of file identification information is not stored in the first data structure, at least one piece of file identification information is added to the first data structure. In order to ensure the adding orderliness, the mark adding function can only respond one adding request at a time; if at least two adding requests exist at the same time, the control mark adding function can only respond to one adding request by setting the write lock, and other adding requests wait. Specifically, an identifier adding function is called in response to any one adding request, and if a write lock is added to the identifier adding function, the adding request waits for the write lock of the identifier adding function to be released; and if the write lock is not added by the identification adding function, responding to the adding request, and adding the file identification information corresponding to the adding request into the first data structure.
It can be understood that, by introducing the identification reading function and the identification adding function to realize the reading and adding of the first data structure, the efficiency of reading and adding can be improved. Meanwhile, the read lock and the write lock are introduced, so that the single execution performance of the identification reading function and the identification adding function is ensured, the chaotic condition is avoided when the file identification information of the first data structure is read or added, and the reading and adding accuracy is improved.
Or alternatively, an identify access function may be invoked; the identification access function comprises an identification reading sub-function and an identification adding sub-function; if the mark access function is not locked, reading file identification information in the first data structure by calling the mark reading sub-function; and adding unread file identification information in the at least one file identification information to the first data structure by calling the identification adding sub-function.
Wherein the identity access function may be used to access file identity information in the data structure. Specifically, the identifier access function includes an identifier reading sub-function and an identifier adding sub-function. The identification reading sub-function is used for reading file identification information in the data structure. The identification adding sub-function is used for adding the file identification information to the data structure. The embodiment of the present invention does not limit the specific implementation manner of the identifier access function, and may be set by a technician according to experience or needs.
The lock of the identification access function is used for controlling the identification access function to realize only one access request (namely, a call request for the identification access function) at the same time. It should be noted that, in the embodiment of the present invention, the implementation manner of the access request is not limited at all, and may be set by a technician as needed. Illustratively, the access request may be implemented by an access thread. Wherein the access thread is a thread dedicated to accessing file identification information in the data structure.
In the embodiment of the invention, in order to ensure the access orderliness, the identification access function can only respond to one access request at a time; if at least two access requests exist at the same time, the control mark access function can only respond to one access request by setting the lock, and other access requests wait. Specifically, for any one access request, an identifier access function is called, and if a lock is added to the identifier access function, the access request waits for the release of the lock; if the mark access function is not locked, responding to the access request, namely calling a mark reading sub-function, and reading the file mark information in the first data structure; and adding unread file identification information in the at least one file identification information to the first data structure by calling the identification adding sub-function. The access request may include a read request and an add request.
It can be understood that, by adding a lock to the identification access function, single execution of the identification access function can be realized, thereby avoiding a chaotic condition when accessing the first data structure and improving the accuracy of access. Meanwhile, the reading and adding of the first data structure are realized by setting the identification reading sub-function and the identification adding sub-function in the identification access function, the situation that maintenance is not easy to occur when the identification reading sub-function and the identification adding sub-function are independently set is avoided, and the maintainability is improved.
S130, after the target file in the first data structure completes the service processing, updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory.
The target file refers to a file which is in service processing or is processed. The number of target files is at least one. The service processing refers to operating the file to achieve the requirement or purpose of the service initiator. The business process may include at least one of removal, deletion, backup, modification, and the like.
The existence condition is that whether the file identification information of any target file exists in the monitoring directory. Specifically, the existence condition includes that the monitoring directory has file identification information of the target file, and the monitoring directory does not have file identification information of the target file.
The embodiment of the invention does not limit the implementation mode of the business processing at all, and technical personnel can set the business processing according to requirements. In an alternative embodiment, the target file in the first data structure may be processed by a business process thread. The business processing thread is a thread which is specially used for conducting business processing on the target file. The number of business processing threads is at least one. The advantage of using the service processing thread is that at least two target files can be processed in parallel at the same time, and the service processing efficiency of the target files is improved.
Illustratively, one target file corresponds to one business processing thread. For any one target file, after the business processing thread completes the business processing on the target file, under normal conditions, the file identification information of the target file in the monitoring directory is deleted, and according to the deletion condition of the file identification information of the target file in the monitoring directory, the first data structure deletes the stored file identification information of the target file; when an unexpected situation (for example, a server performance problem occurs), after the service processing thread completes processing on the target file, the file identification information of the target file in the monitoring directory is not deleted, and according to the existence situation of the file identification information of the target file in the monitoring directory, the file identification information of the target file is still stored in the first data structure.
The embodiment of the invention provides a file processing monitoring scheme, which comprises the steps of scanning a monitoring directory to obtain at least one file identification information in the monitoring directory; adding file identification information which is not stored in the first data structure in at least one file identification information to the first data structure; and after the target file in the first data structure completes the service processing, updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory. According to the scheme, the existence condition of the file identification information of the target file in the monitoring directory is monitored by introducing the first data structure, so that the repeated processing of the same target file is avoided, and the resource waste is reduced. Meanwhile, according to the existence condition of the file identification information, the first data structure can update the stored file identification information, the performance influence on the first data structure caused by structural expansion due to continuous stacking of the file identification information is avoided, and the monitoring efficiency and the service processing performance are improved. In addition, the file identification information which is not stored in the first data structure in the at least one file identification information is added to the first data structure, so that the comprehensiveness of the file identification information in the first data structure can be ensured, the condition of monitoring omission is avoided, and the reliability of service processing monitoring is improved.
Example two
Fig. 2 is a flowchart of a file processing monitoring method according to a second embodiment of the present invention, where in this embodiment, based on the above embodiment, further, "after a service processing is completed on a target file in a first data structure, according to an existence condition of file identification information of the target file in a monitoring directory, update file identification information in the first data structure" is refined to "if the file identification information of the target file in the monitoring directory is deleted after the target file is processed, the file identification information of the target file in the data structure to be processed is deleted by calling an identification deletion function; the data structure to be processed is a first data structure; if the file identification information of the target file in the monitoring directory is not deleted after the target file is processed, adding the file identification information of the target file in a second data structure; under the condition that the file identification information of the target file in the monitoring directory is monitored to be absent, deleting the file identification information of the target file in the data structure to be processed by calling an identification deleting function; the data structure to be processed comprises a first data structure and a second data structure' so as to perfect the updating mechanism in the first data structure. For parts which are not described in detail in the embodiments of the present invention, reference may be made to other embodiments.
Referring to fig. 2, the document processing monitoring method includes:
s210, scanning the monitoring directory to obtain at least one piece of file identification information in the monitoring directory.
S220, adding file identification information which is not stored in the first data structure in the at least one file identification information to the first data structure.
And S230, if the file identification information of the target file in the monitoring directory is deleted after the target file is processed, deleting the file identification information of the target file in the data structure to be processed by calling an identification deleting function.
The data structure to be processed refers to a data structure which needs to be subjected to access processing such as deletion or addition. Here, the data structure to be processed is a first data structure. The identifier delete function may be configured to delete file identifier information of a target file in the to-be-processed data structure. The embodiment of the present invention does not limit the specific implementation manner of the mark deletion function, and may be set by a technician according to experience or habit.
Specifically, for any target file, if the file identification information of the target file in the monitoring directory is deleted after the service processing is completed on the target file, an identification deletion function is called to delete the file identification information of the target file in the first data structure.
S240, if the file identification information of the target file in the monitoring directory is not deleted after the target file is processed, adding the file identification information of the target file in the second data structure.
The second data structure may be configured to store file identification information that is in the monitoring directory and has completed business processing but has not been deleted.
Specifically, for any target file, if the target file has completed the service processing but the file identification information corresponding to the target file in the monitoring directory is not deleted, the file identification information of the target file is added to the second data structure, and the file identification information of the target file in the first data structure is continuously saved.
And S250, under the condition that the file identification information of the target file in the monitoring directory is monitored to be absent, deleting the file identification information of the target file in the data structure to be processed by calling an identification deleting function.
Here, the data structure to be processed includes a first data structure and a second data structure.
Specifically, for the file identification information of any one target file stored in the second data structure, if the file identification information of the target file is detected to be deleted in the monitoring directory, the file identification information of the target file stored in the first data structure and the second data structure is deleted by calling an identification deletion function.
For example, the processing duration may be preset, and when the processing duration reaches the service processing duration, the corresponding file identification information is searched for in the monitoring directory according to the file identification information stored in the second data structure. If the corresponding file identification information is found in the monitoring directory, processing the file corresponding to the file identification information; and if not, deleting the corresponding file identification information in the first data structure and the second data structure. It should be noted that, in the embodiment of the present invention, the size of the processing time period is not limited at all, and may be set by a skilled person according to experience or needs.
The embodiment of the invention provides a file processing monitoring scheme, wherein file identification information of a target file in a monitoring directory is deleted by adding the file identification information if the target file is processed, and the file identification information of the target file in a data structure to be processed is deleted by calling an identification deletion function; the data structure to be processed is a first data structure; if the file identification information of the target file in the monitoring directory is not deleted after the target file is processed, adding the file identification information of the target file in a second data structure; under the condition that the file identification information of the target file in the monitoring directory does not exist, deleting the file identification information of the target file in the data structure to be processed by calling an identification deletion function; the data structure to be processed comprises a first data structure and a second data structure. According to the scheme, after the target file is processed, the file identification information in the data structure to be processed is deleted by calling the identification deletion function according to the existence of the file identification information of the target file in the monitoring directory, so that the continuous stacking of the file identification information in the data structure to be processed is avoided, and the service processing capacity is reduced. Meanwhile, by introducing a second data structure, the file identification information of the processed but undeleted target file in the monitoring directory is stored, so that the omission of the file identification information which is processed but undeleted is avoided, a basis is provided for subsequent service processing, and the accuracy of the service processing is ensured.
In the embodiment of the invention, the setting of the identification deletion function is not limited at all. In an alternative embodiment, the identity deletion function may be set separately. Specifically, the file identification information of the target file in the data structure to be processed can be deleted by calling the identification deletion function if the write lock is not added to the identification deletion function.
It should be noted that the data structure to be processed here may be the first data structure, and may also be the first data structure and the second data structure.
The write lock of the identification deletion function is used for controlling the identification deletion function to realize only one deletion request (namely, a call request for the identification deletion function) at the same time. The implementation manner of the deletion request is not limited at all, and can be set by technical personnel according to needs. Illustratively, the delete request may be implemented by a delete thread. The deleting thread is a thread which is specially used for deleting the file identification information in the data structure to be processed.
In the embodiment of the invention, in order to ensure the orderliness of deletion, the identification deletion function can only respond to one deletion request at a time; if at least two deletion requests exist simultaneously, the writing lock is set, the control mark deletion function can only respond to one deletion request, and other deletion requests wait. Specifically, for the file identification information of any one target file, when it is monitored that the file identification information of the target file does not exist in the monitoring directory, an identification deletion function is called in response to a corresponding deletion request, and the file identification information of the target file in the data structure to be processed is deleted. Optionally, if the write lock is added to the identifier-deletion function, the deletion request waits for the write lock release of the identifier-deletion function; and if the write lock is not added to the identification deleting function, calling the identification deleting function to delete the file identification information of the target file in the data structure to be processed.
It can be understood that, by introducing the identification deletion function, deletion of the data structure to be processed is realized, and deletion efficiency is improved. Meanwhile, by adding a write lock to the identification deletion function, the single execution performance of the identification deletion function is ensured, the chaotic condition is avoided when the file identification information in the data structure to be processed is deleted, and the deletion accuracy is improved.
In another alternative embodiment, the identify delete function may be a sub-function, with other functions present. Specifically, the identifier deletion function is a subfunction in the identifier access function; correspondingly, an identification deleting function in the identification access function is called, and if the lock is not added to the identification access function, the file identification information of the target file in the data structure to be processed is deleted.
It should be noted that the data structure to be processed here may be the first data structure, and may also be the first data structure and the second data structure.
Specifically, when the identifier deletion function is a subfunction in the identifier access function, the identifier access function is called in response to any one of the access requests, and if a lock is added to the identifier access function, the access request waits for the release of the lock; and if the lock is not added to the identification access function, responding to the access request, namely calling an identification deletion function in the identification access function, and deleting the file identification information of the target file corresponding to the access request in the data structure to be processed. The access request may include a deletion request.
It can be understood that, by adding locks to the identification access function, the single execution of the identification access function can be realized, the condition of confusion when accessing the data structure to be processed is avoided, and the accuracy of access is improved. Meanwhile, the identification deleting function is set in the identification access function, so that the data structure to be processed is deleted, the situation that the data structure is not easy to maintain when the identification deleting function is set independently is avoided, and the maintainability is improved.
On the basis of the above embodiment, the identifier access function includes an identifier reading sub-function, an identifier adding sub-function, an identifier deleting function, and the like. The identifier reading sub-function, the identifier adding sub-function and the identifier deleting function in the identifier access function can independently set locks, namely the identifier reading sub-function can set a reading lock, the identifier adding sub-function can set a writing lock, and the identifier deleting function can set a writing lock. When the lock is added to the identification access function, each function in the identification access function cannot be called; when the lock is not added to the identification access function, if at least one of the identification reading sub-function, the identification adding sub-function and the identification deleting function is added with the lock, the at least one function added with the lock cannot be called, and other functions except the function added with the lock can be called; when the lock is not added to the identifier access function, if the lock is not added to the identifier reading sub-function, the identifier adding sub-function and the identifier deleting function, all the functions in the identifier access function can be called.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a file processing monitoring apparatus according to a third embodiment of the present invention, where this embodiment is applicable to a case of monitoring a file processing process, and the method may be executed by the file processing monitoring apparatus, and the apparatus may be implemented in a software and/or hardware manner, and may be configured in an electronic device bearing a data processing function, such as a server.
As shown in fig. 3, the apparatus includes: a file identification information obtaining module 310, a first data structure adding module 320, and a first data structure updating module 330. Wherein the content of the first and second substances,
a file identification information obtaining module 310, configured to scan the monitoring directory to obtain at least one piece of file identification information in the monitoring directory;
a first data structure adding module 320, configured to add file identification information that is not stored in the first data structure in the at least one file identification information to the first data structure;
the first data structure updating module 330 is configured to update the file identifier information in the first data structure according to the existence condition of the file identifier information of the target file in the monitoring directory after the target file in the first data structure completes service processing.
The embodiment of the invention provides a file processing monitoring scheme, which comprises the steps of scanning a monitoring directory through a file identification information acquisition module to obtain at least one piece of file identification information in the monitoring directory; adding file identification information which is not stored in the first data structure in at least one piece of file identification information to the first data structure through a first data structure adding module; after the target file in the first data structure is subjected to business processing through the first data structure updating module, the file identification information in the first data structure is updated according to the existence condition of the file identification information of the target file in the monitoring directory. According to the scheme, the existence condition of the file identification information of the target file in the monitoring directory is monitored by introducing the first data structure, so that the repeated processing of the same target file is avoided, and the resource waste is reduced. Meanwhile, according to the existence condition of the file identification information, the first data structure can update the stored file identification information, the performance influence on the first data structure caused by structural expansion due to continuous stacking of the file identification information is avoided, and the monitoring efficiency and the service processing performance are improved. In addition, the file identification information which is not stored in the first data structure in the at least one file identification information is added to the first data structure, so that the comprehensiveness of the file identification information in the first data structure can be ensured, the condition of monitoring omission is avoided, and the reliability of service processing monitoring is improved.
Optionally, the first data structure updating module 330 includes:
the first deleting unit is used for deleting the file identification information of the target file in the data structure to be processed by calling an identification deleting function if the file identification information of the target file in the monitoring directory is deleted after the target file is processed;
the data structure to be processed is a first data structure.
Optionally, the first data structure updating module 330 includes:
the first adding unit is used for adding the file identification information of the target file in the second data structure if the file identification information of the target file in the monitoring directory is not deleted after the target file is processed;
the second deleting unit is used for deleting the file identification information of the target file in the data structure to be processed by calling an identification deleting function under the condition that the file identification information of the target file in the monitoring directory is monitored to be absent;
the data structure to be processed comprises a first data structure and a second data structure.
Optionally, the first deleting unit or the second deleting unit is specifically configured to:
and deleting the file identification information of the target file in the data structure to be processed by calling the identification deletion function if the write lock is not added to the identification deletion function.
Optionally, in the first deletion unit or the second deletion unit, the identifier deletion function is a sub-function in the identifier access function; correspondingly, the first deleting unit or the second deleting unit is specifically configured to:
and calling an identification deleting function in the identification access function, and deleting the file identification information of the target file in the data structure to be processed if the lock is not added to the identification access function.
Optionally, the first data structure adding module 320 includes:
the first reading unit is used for calling the identification reading function, and reading the file identification information in the first data structure if the identification reading function is not added with a reading lock;
and the second adding unit is used for calling the identification adding function, and adding the unread file identification information in the at least one file identification information to the first data structure if the write lock is not added to the identification adding function.
Optionally, the first data structure adding module 320 includes:
a calling unit for calling the identifier access function; the identification access function comprises an identification reading sub-function and an identification adding sub-function;
the second reading unit is used for reading the file identification information in the first data structure by calling the identification reading sub-function if the identification access function is not added with the lock;
and the third adding unit is used for adding the unread file identification information in the at least one file identification information to the first data structure by calling the identification adding sub-function.
The file processing monitoring device provided by the embodiment of the invention can execute the file processing monitoring method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the file processing monitoring methods.
In the technical scheme of the invention, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the related file identification information, the monitoring directory, the target file and the like all accord with the regulation of related laws and regulations without violating the good custom of the public order.
Example four
Fig. 4 is a schematic structural diagram of an electronic device for implementing a file processing monitoring method according to a fourth embodiment of the present invention. The electronic device 410 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 410 includes at least one processor 411, and a memory communicatively connected to the at least one processor 411, such as a Read Only Memory (ROM) 412, a Random Access Memory (RAM) 413, and the like, wherein the memory stores computer programs executable by the at least one processor, and the processor 411 may perform various appropriate actions and processes according to the computer programs stored in the Read Only Memory (ROM) 412 or the computer programs loaded from the storage unit 418 into the Random Access Memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other through a bus 414. An input/output (I/O) interface 415 is also connected to bus 414.
Various components in the electronic device 410 are connected to the I/O interface 415, including: an input unit 416 such as a keyboard, a mouse, or the like; an output unit 417 such as various types of displays, speakers, and the like; a storage unit 418, such as a magnetic disk, optical disk, or the like; and a communication unit 419 such as a network card, modem, wireless communication transceiver, or the like. The communication unit 419 allows the electronic device 410 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Processor 411 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as a document processing monitoring method.
In some embodiments, the file processing monitoring method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and/or installed onto electronic device 410 via ROM 412 and/or communications unit 419. When loaded into RAM 413 and executed by processor 411, may perform one or more of the steps of the file handling monitoring method described above. Alternatively, in other embodiments, the processor 411 may be configured to perform the file handling monitoring method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A file processing monitoring method is characterized by comprising the following steps:
scanning a monitoring directory to obtain at least one file identification information in the monitoring directory;
adding file identification information which is not stored in a first data structure in the at least one file identification information to the first data structure;
and after the target file in the first data structure completes service processing, updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory.
2. The method according to claim 1, wherein the updating the file identification information in the first data structure according to the existence of the file identification information of the target file in the monitoring directory comprises:
if the file identification information of the target file in the monitoring directory is deleted after the target file is processed, deleting the file identification information of the target file in a data structure to be processed by calling an identification deletion function;
wherein the data structure to be processed is the first data structure.
3. The method according to claim 1, wherein the updating the file identification information in the first data structure according to the existence of the file identification information of the target file in the monitoring directory comprises:
if the file identification information of the target file in the monitoring directory is not deleted after the target file is processed, adding the file identification information of the target file in a second data structure;
under the condition that the file identification information of the target file in the monitoring directory is monitored to be absent, deleting the file identification information of the target file in a data structure to be processed by calling an identification deleting function;
wherein the to-be-processed data structure comprises the first data structure and the second data structure.
4. The method according to claim 2 or 3, wherein the deleting the file identification information of the target file in the data structure to be processed by calling an identification deletion function comprises:
and deleting the file identification information of the target file in the data structure to be processed by calling an identification deletion function if the identification deletion function does not add a write lock.
5. The method of claim 2 or 3, wherein the identity deletion function is a sub-function in an identity access function; correspondingly, the deleting the file identification information of the target file in the data structure to be processed by calling the identification deleting function includes:
and calling an identification deleting function in the identification access function, and deleting the file identification information of the target file in the data structure to be processed if the identification access function does not add a lock.
6. The method according to claim 1, wherein adding file identification information, which is not stored in the first data structure, of the at least one file identification information to the first data structure comprises:
calling an identification reading function, and reading file identification information in the first data structure if a reading lock is not added to the identification reading function;
and calling an identification adding function, and if the write lock is not added to the identification adding function, adding unread file identification information in the at least one file identification information to the first data structure.
7. The method of claim 1, wherein adding to the first data structure file identification information not stored in the first data structure of the at least one file identification information comprises:
calling an identification access function; the identification access function comprises an identification reading sub-function and an identification adding sub-function;
if the lock is not added to the identification access function, reading file identification information in the first data structure by calling an identification reading sub-function;
and adding unread file identification information in the at least one file identification information to the first data structure by calling the identification adding sub-function.
8. A document processing monitoring apparatus, comprising:
the file identification information acquisition module is used for scanning the monitoring directory to obtain at least one piece of file identification information in the monitoring directory;
a first data structure adding module, configured to add file identification information that is not stored in a first data structure in the at least one file identification information to the first data structure;
and the first data structure updating module is used for updating the file identification information in the first data structure according to the existence condition of the file identification information of the target file in the monitoring directory after the target file in the first data structure completes service processing.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a document processing monitoring method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a document processing monitoring method according to any one of claims 1 to 7.
CN202211356758.XA 2022-11-01 2022-11-01 File processing monitoring method, device, equipment and medium Pending CN115687244A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211356758.XA CN115687244A (en) 2022-11-01 2022-11-01 File processing monitoring method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211356758.XA CN115687244A (en) 2022-11-01 2022-11-01 File processing monitoring method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115687244A true CN115687244A (en) 2023-02-03

Family

ID=85047557

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211356758.XA Pending CN115687244A (en) 2022-11-01 2022-11-01 File processing monitoring method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115687244A (en)

Similar Documents

Publication Publication Date Title
US20230020324A1 (en) Task Processing Method and Device, and Electronic Device
CN112346834A (en) Database request processing method and device, electronic equipment and medium
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN113676531B (en) E-commerce flow peak clipping method and device, electronic equipment and readable storage medium
CN115687244A (en) File processing monitoring method, device, equipment and medium
CN114564149A (en) Data storage method, device, equipment and storage medium
CN114722003A (en) Centralized data acquisition method, device, equipment and storage medium
CN114721876A (en) Data backup method, device and medium
CN116595110A (en) Data storage method and device, electronic equipment and storage medium
CN117633109A (en) Method, device, equipment and medium for detecting and optimizing data blocks in database cluster
CN115599828A (en) Information processing method, device, equipment and storage medium
CN116932623A (en) Conversion method, device and equipment of cloud container scheduling data and storage medium
CN118152348A (en) Hive small file processing method, device, equipment and storage medium
CN117519983A (en) Memory-based data processing method and device
CN115390992A (en) Virtual machine creating method, device, equipment and storage medium
CN115454660A (en) Task management method and device, electronic equipment and storage medium
CN115904701A (en) Parameter refreshing method, device, equipment and storage medium
CN117596298A (en) Data processing method and device, electronic equipment and storage medium
CN117873682A (en) Synchronous-to-asynchronous task processing method, device, equipment, medium and product
CN115328698A (en) Data page recovery method and device, electronic equipment and storage medium
CN115794555A (en) Service log processing method, device, equipment and storage medium
CN118093211A (en) Distributed lock processing method, device, equipment and medium
CN114416687A (en) Time layering merging method, device, equipment and medium for time sequence data
CN115905121A (en) File processing method, device, equipment and storage medium
CN114546705A (en) Operation response method, operation response device, electronic apparatus, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination