CN113806113A - Event processing method, device, equipment and storage medium - Google Patents

Event processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113806113A
CN113806113A CN202111145300.5A CN202111145300A CN113806113A CN 113806113 A CN113806113 A CN 113806113A CN 202111145300 A CN202111145300 A CN 202111145300A CN 113806113 A CN113806113 A CN 113806113A
Authority
CN
China
Prior art keywords
event
target object
previous
current
type
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.)
Granted
Application number
CN202111145300.5A
Other languages
Chinese (zh)
Other versions
CN113806113B (en
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.)
Shandong Civic Se Commercial Middleware Co ltd
Original Assignee
Shandong Civic Se Commercial Middleware 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 Shandong Civic Se Commercial Middleware Co ltd filed Critical Shandong Civic Se Commercial Middleware Co ltd
Priority to CN202111145300.5A priority Critical patent/CN113806113B/en
Publication of CN113806113A publication Critical patent/CN113806113A/en
Application granted granted Critical
Publication of CN113806113B publication Critical patent/CN113806113B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an event processing method, device, equipment and storage medium; in the scheme, a current event generated when a target object changes needs to be acquired, and whether a previous event corresponding to the target object exists is judged; if so, merging the current event and the early event to obtain an updated early event corresponding to the target object; if not, directly taking the current event as a previous event corresponding to the target object; and if the fact that the early event corresponding to the target object meets the preset condition is detected, taking the early event corresponding to the target object as a final event. Therefore, the method and the device can keep the operation executed by the user consistent with the generated final event by combining the original events to obtain the final event, so that the final event can accurately reflect the operation of the target object, and the direct use of the system is facilitated.

Description

Event processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of event processing technologies, and in particular, to an event processing method, an event processing apparatus, a device, and a storage medium.
Background
In the Windows operating system, changes to a file or folder are not done at one time, but are ultimately done through one or more changes. Each change produced in the process of completing the change can be called an original event. The original event is possibly acquired and actually exists. Currently, the Windows operating system provides an interface for acquiring a file change event, but the acquired original event is different from the intuitive cognition of the user. Such as: creating an empty file, and finding a file creation and a file modification through an interface, wherein the operation of a user only needs one file creation actually, which is caused because the Windows operating system is performed in steps instead of being completed at one time when processing file changes. Namely: in the existing implementation mode, the obtained original event is difficult to display results to people in a mode conforming to the viewing habits of people in use, and the understanding difficulty of people and the system implementation problem are often caused.
Disclosure of Invention
The invention aims to provide an event processing method, an event processing device and a storage medium, so that a user can view a final processing result through processing an original event.
In order to achieve the above object, the present invention provides an event processing method, including:
acquiring a current event generated when a target object changes;
judging whether a previous-stage event corresponding to the target object exists or not;
if so, combining the current event and the early event to obtain an updated early event corresponding to the target object; if not, directly taking the current event as an early-stage event corresponding to the target object;
and if the fact that the early event corresponding to the target object meets the preset condition is detected, taking the early event corresponding to the target object as a final event.
Wherein the determining whether the early event corresponding to the target object exists includes:
converting the current event into a target event structure; wherein, the event structure includes: at least one of an event type, an object name, a new file name, an object type, an event time;
taking the path of the target object as a key, and searching an event structure body of a previous event which is the same as the key from a Map;
if the event structure of the previous event which is the same as the key is not found, judging that the previous event corresponding to the target object does not exist; and if the event structure of the previous event which is the same as the key is found, judging that the previous event corresponding to the target object exists.
The merging the current event and the early event to obtain an updated early event corresponding to the target object includes:
determining the event type of the current event according to the target event structure body, and determining the event type of the earlier event according to the event structure body of the earlier event;
determining the event type after the combination processing according to the event type of the current event and the event type of the previous event;
and modifying the event type in the event structure of the earlier event in the Map according to the event type after the merging processing, and modifying the event time in the event structure of the earlier event in the Map according to the event time of the target event structure to obtain an updated event structure of the earlier event.
After the current event is converted into the target event structure, the method further includes:
determining the object type of the target event structure;
if the object type is a folder, judging whether the event type of the target event structure body is an excluded event type; if so, excluding the current event;
if the object type is a file, after the final event is obtained, judging whether the event type of the final event is an excluded event type; and if so, excluding the final event.
After the current event is converted into the target event structure, the method further includes:
judging whether the event type of the current event is a renamed event or not;
if yes, determining the identification information of the target object, and searching an event structure body of a previous event which is the same as the identification information from the Map;
if the event structure of the previous event which is the same as the identification information is not found, judging that the previous event corresponding to the target object does not exist; and if the event structure of the previous event which is the same as the identification information is found, judging that the previous event corresponding to the target object exists.
Wherein, if it is detected that the early event corresponding to the target object satisfies the predetermined condition, taking the early event corresponding to the target object as a final event, including:
judging whether the difference value between the event time of the previous event corresponding to the target object and the current time is greater than a first difference threshold value or not;
if so, taking the early event corresponding to the target object as a final event;
if not, continuing to execute the step of acquiring the current event generated by the target object when the target object is changed.
Wherein, if it is detected that the early event corresponding to the target object satisfies the predetermined condition, taking the early event corresponding to the target object as a final event, including:
and if the difference value between the event time of the next current event of the target object and the event time of the earlier event of the target object is greater than a second difference threshold value, taking the earlier event corresponding to the target object as a final event.
To achieve the above object, the present invention further provides an event processing apparatus comprising:
the acquisition module is used for acquiring a current event generated when the target object changes;
the first judgment module is used for judging whether a previous-stage event corresponding to the target object exists or not;
the merging module is used for merging the current event and the early event when the early event corresponding to the target object exists to obtain an updated early event corresponding to the target object; if not, directly taking the current event as an early-stage event corresponding to the target object;
and the detection module is used for taking the early event corresponding to the target object as a final event when detecting that the early event corresponding to the target object meets a preset condition.
To achieve the above object, the present invention further provides an electronic device comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the event processing method when executing the computer program.
To achieve the above object, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when being executed by a processor, implements the steps of the above-mentioned event processing method.
According to the scheme, the event processing method, the event processing device, the event processing equipment and the storage medium are provided by the embodiment of the invention; in the scheme, a current event generated when a target object changes needs to be acquired, and whether a previous event corresponding to the target object exists is judged; if so, merging the current event and the early event to obtain an updated early event corresponding to the target object; if not, directly taking the current event as a previous event corresponding to the target object; and if the fact that the early event corresponding to the target object meets the preset condition is detected, taking the early event corresponding to the target object as a final event. Therefore, the method and the device can keep the operation executed by the user consistent with the generated final event by combining the original events to obtain the final event, so that the final event can accurately reflect the operation of the target object, and the direct use of the system is facilitated.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart illustrating an event processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an overall process for event merging according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating another event processing method according to the embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an event processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Currently, the event triggering technology is a commonly used technology in the file protection or website tamper-proofing technology. Compared with other technologies, the method has the advantage of low system consumption by monitoring in an event triggering mode, and a good event acquisition algorithm can well acquire and process file changes. In the current prior art, most event monitoring does not completely process all events to form a file processing event with the same performance. At present, in a Windows system, a FindFirstChangeNotification function and a ReadDirectoryChangeW function can be used to acquire an original event of file change, but the acquired original event is unprocessed and difficult to directly use. In this case, the user-operated event and the acquired event may have an error, thereby causing a serious effect. In addition, there is also a component inotify in the Linux operating system, which functions substantially the same as the two functions described above, and as such, only unprocessed primitive events can be obtained.
Therefore, the embodiment of the invention discloses an event processing method, an event processing device and a storage medium, and the scheme can solve the problem that the obtained original event and the event are different in performance. Specifically, since one or more original events are generated each time the target object changes, the scheme can process the original events and combine the original events into a final event. It should be noted that there may be multiple original events or only one original event generated by the target object changing each time, but there is only one final event. The final event needs to be generated by combining the original events and cannot be directly acquired from the system. By the method, the final event acquired by the user is consistent with the file change performance observed by the user.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic flow chart of an event processing method provided in an embodiment of the present invention specifically includes:
s101, acquiring a current event generated when a target object changes;
specifically, the target object in the present embodiment may be a file or a folder, and is not limited herein as long as it generates a current event when changed. The current event is an original event generated by the target object at each change, such as: a user newly creates a 1.txt file in a folder, and at the moment, two original events are obtained, namely: the new event of the txt file and the modification event of the 1 txt file are both the original events generated when the target object (1 txt file) changes. In addition, since each original event is generated in sequence and has different event times, in this embodiment, the original event generated when the target object changes currently is taken as the current event, and if the target object changes multiple times, different current events may be generated at different times.
S102, judging whether a previous event corresponding to the target object exists or not; if yes, executing S103; if not, executing S104;
s103, merging the current event and the early event to obtain an updated early event corresponding to the target object;
s104, directly taking the current event as a previous event corresponding to the target object;
and S105, if the fact that the early event corresponding to the target object meets the preset condition is detected, taking the early event corresponding to the target object as a final event.
It should be noted that, in the website tamper-resistant program under the Windows system, the system may first monitor folders and files through an interface provided by the operating system, and the system can obtain one or more original events whenever the files in the folders change. The system will store these original events in the queue for buffering, and other threads will perform subsequent merging processing. In the processing process, the system combines the original events according to the conditions of the event type of each original event, the occurrence time of the events, the occurrence sequence of the events and the like to generate a new event, wherein the event type of the event is the same as the operation type of the file.
In this embodiment, the previous event corresponding to the target object refers to an original event generated by the target object before the current event is generated, and this embodiment is referred to as a previous event of the target object. In this embodiment, if the current event acquired in S101 is the first current event of the target object, there is no previous event of the target object at this time, and at this time, the first current event may be directly stored as the previous event. If the current event acquired in S101 is not the first current event of the target object, that is: before the current event is received, other original events of the target object are already received, at this time, a previous event exists, and at this time, the acquired current event and the previous event need to be combined to obtain a new previous event.
For example: after receiving a first current event of a target object, the first current event needs to be taken as a previous event, after receiving a second current event of the target object, the second current event needs to be combined with the previous event to generate an updated previous event, after receiving a third current event of the target object, the third current event needs to be combined with the previous updated previous event to generate an updated previous event, and so on, until the previous event corresponding to the target object is detected to meet a predetermined condition, the previous event corresponding to the target object is taken as a final event to be reported, and if the predetermined condition is not met, S101 is continuously executed, that is: and continuously acquiring the next current event of the target object, merging the current events until the generated early event meets the preset condition, and reporting the early event as a final event. Referring to fig. 2, a schematic view of an overall process of event merging provided in the embodiment of the present invention; as shown in fig. 2, after thread 1 obtains the system primitive event and stores it in the queue, thread 2 obtains the system primitive event from the queue for processing, for example: event merging, event exclusion, and the like; if the event processing is finished or the event meets the preset condition, a final event is generated and reported, and if the event processing is not finished or the event does not meet the preset condition, the original event is continuously acquired from the queue for processing.
In summary, according to the scheme, the final event is obtained by combining the original events, so that the operation executed by the user is consistent with the generated final event, the final event can accurately reflect the operation of the target object, and the direct use of the system is facilitated. Such as: the method is applied to the file protection or website tamper-proofing technology, if the obtained final event is a modification event or a deletion event, whether the final event is a legal event or not can be judged, if the final event is the legal event, execution is allowed, if the final event is an illegal event, operations such as file repair and the like need to be executed, and early warning is carried out. Therefore, after the original event is processed by the scheme, the system can directly use the final event to perform file protection, website tamper resistance and the like, and convenience is provided for system use.
Referring to fig. 3, a schematic flow chart of another event processing method provided in the embodiment of the present invention specifically includes:
s201, acquiring a current event generated when a target object changes;
s202, converting the current event into a target event structure, taking the path of the target object as a key, and searching the event structure of the previous event which is the same as the key from the Map; wherein, the event structure includes: at least one of an event type, an object name, a new file name, an object type, an event time;
if the event structure of the previous event which is the same as the key is not found, judging that the previous event corresponding to the target object does not exist, and executing S203; if the event structure of the previous event identical to the key is found, it is determined that the previous event corresponding to the target object exists, and S206 is executed.
In this embodiment, an Event structure Event is defined, and several fields in the Event structure are as follows:
Figure BDA0003285234040000071
the event types defined by the scheme mainly include the following types:
Figure BDA0003285234040000072
Figure BDA0003285234040000081
it can be understood that the event types of multiple original events generated by the same file operation may be different, but the full paths of other events are the same except for renaming, so in the event merging process, the path where the event occurs needs to be merged as a connection between multiple original events in the scheme.
S203, determining the event type of the current event according to the target event structure, and determining the event type of the previous event according to the event structure of the previous event;
s204, determining the event type after the merging processing according to the event type of the current event and the event type of the previous event;
s205, according to the event type after the merging processing, modifying the event type in the event structure of the earlier event in the Map, according to the event time of the target event structure, modifying the event time in the event structure of the earlier event in the Map to obtain an updated event structure of the earlier event, and continuing to execute S207.
S206, taking the target event structure of the current event as value, taking the path of the target object as key, storing the key in the Map, and continuously executing S201;
in this embodiment, at the beginning of system startup, a Map of < string, Event > type is created for Event merging. When the system finds an original Event, the original Event is converted into a structure object of the Event, the occurrence path of the Event is used as a key, and then whether a corresponding early Event exists or not is searched from the Map. If the event exists, the event is taken out from the Map, the previous event serving as the target object and the current event are merged, meanwhile, the time of the event is updated, the updated previous event is obtained, and the updated previous event is stored in the Map. And if not, storing the target event structure of the current event into the Map as value. In this embodiment, when determining the event type after the merging processing according to the event type of the current event and the event type of the previous event, the processing may be performed according to a preset merging rule, and the merging rule may be set according to an actual situation, and only a part of the rules will be described here:
firstly, if the event type of the current event is newly established:
1. new construction and new construction become logic confusion, and early events are ignored: resetting the previous event and releasing the current event;
2. delete + new merge as replacement: resetting the previous event and releasing the current event;
3. modifying and newly creating are logic confusion, and early events are ignored: resetting the former event and releasing the current event.
Secondly, if the event type of the current event is deletion:
1. new + delete is offset: releasing the prior event, and releasing the current event (new and deleted can not be combined and need to be reported separately, and because the event type of the prior event is newly established, the prior event is directly reported);
2. delete + delete is a logical confusion, ignoring earlier events: resetting the previous event and releasing the current event;
3. modify + delete-delete: resetting the former event and releasing the current event.
Thirdly, the event type of the current event is modified:
1. new construction and modification are as follows: resetting the previous event and releasing the current event;
2. delete + modify — logical confusion, ignore previous events: resetting the previous event and releasing the current event;
3. modify + modify-modify, ignore the current event: resetting the former event and releasing the current event.
In the above rule, both the ignore event and the release event represent delete events, and the reset event represents update of events, such as: updates to event types, updates to event times, and the like.
It should be noted that, since the file path of the renamed event changes, after the present event is converted into the target event structure, it is also necessary to determine whether the event type of the present event is the renamed event; if yes, determining the identification information of the target object, and searching an event structure body of the previous event which is the same as the identification information from the Map; if the event structure of the previous event which is the same as the identification information is not found, judging that the previous event corresponding to the target object does not exist, and continuing to execute S206; if the event structure of the previous event identical to the identification information is found, it is determined that the previous event corresponding to the target object exists, and S203 is continuously executed. The identification information is a number used to represent uniqueness of the target object, and may be an integer, which is not specifically limited herein.
S207, judging whether the difference value between the event time of the early event corresponding to the target object and the current time is larger than a first difference threshold value or not; if yes, go to step S208; if not, executing S201;
and S208, taking the previous-stage event corresponding to the target object as a final event.
In addition, in the present embodiment, after merging the current event and the previous event and generating the updated previous event, it is necessary to set a predetermined condition to determine when to output the previous event corresponding to the target object as the final event. In this embodiment, it may be determined whether a difference between the event time of the previous event corresponding to the target object and the current time is greater than a first difference threshold; if so, taking the early event corresponding to the target object as a final event; if not, continuing to acquire the next current event for merging processing, and reporting as a final event until the preset condition is met.
In addition, in this embodiment, when the difference between the event time of the next current event of the target object and the event time of the previous event of the target object is greater than the second difference threshold, the previous event corresponding to the target object may be used as the final event. After the previous event corresponding to the target object is taken as the final event, the previous event of the target object is not found again when S202 is executed again. Namely: if the difference between the previous event and the current event exceeds a fixed value, all events (excluding the current event) generated by the target object are considered to be completely acquired, the event merging is finished, the current event is used as the first original event of the next operation of the target object, and the subsequent merging processing is continued.
Further, after the current event is converted into a target event structure, the object type of the target event structure can be determined; if the object type is a folder, judging whether the event type of the target event structure body is an excluded event type; if so, excluding the current event; if the object type is a file, after the final event is obtained, judging whether the event type of the final event is an excluded event type; and if so, excluding the final event. That is to say: according to the scheme, the original events can be merged to obtain the final event which can be directly observed and used, the files can be classified and excluded, various exclusion strategies are supported, in the embodiment, the excluded event type is the event type which needs to be excluded, the excluded event does not perform subsequent merging and reporting operations, and the excluded event type can be set by a user in a user-defined mode. In addition, the scheme can eliminate different changes of the same file, such as: only one or more changes of new creation, deletion, modification and the like of the files are monitored, partial files in the same directory can be monitored, and the method is more visual and flexible in use and simpler in processing.
In conclusion, after the combination processing is carried out on the plurality of original events by the scheme, the final event obtained by the user can be consistent with the actual operation of the user, the method can be applied to all Windows systems, the phenomenon that the file change in the Windows system is inconsistent with the change performance of the monitored event is solved, and the monitored file event can be conveniently and directly used.
The processing apparatus, the processing device, and the storage medium according to the embodiments of the present invention are described below, and the processing apparatus, the processing device, and the storage medium described below may be referred to the processing method described above.
Referring to fig. 4, an event processing apparatus according to an embodiment of the present invention includes:
the acquiring module 11 is configured to acquire a current event generated when the target object changes;
a first judging module 12, configured to judge whether there is a previous event corresponding to the target object;
a merging module 13, configured to, when a previous event corresponding to the target object exists, merge the current event and the previous event to obtain an updated previous event corresponding to the target object; if not, directly taking the current event as an early-stage event corresponding to the target object;
and the detection module 14 is configured to, when it is detected that the early event corresponding to the target object meets a predetermined condition, take the early event corresponding to the target object as a final event.
Wherein, the first judging module comprises:
the conversion unit is used for converting the current event into a target event structure; wherein, the event structure includes: at least one of an event type, an object name, a new file name, an object type, an event time;
the first searching unit is used for searching an event structure body of a previous event which is the same as the key from the Map by taking the path of the target object as the key;
a first determination unit configured to determine that there is no previous event corresponding to the target object when the event structure of the previous event that is the same as the key is not found; and when finding the event structure of the previous event which is the same as the key, judging that the previous event corresponding to the target object exists.
Wherein the merging module comprises:
a first determining unit, configured to determine an event type of the current event according to the target event structure, and determine an event type of the previous event according to the event structure of the previous event;
a second determining unit, configured to determine, according to the event type of the current event and the event type of the previous event, an event type after merging processing;
and the updating unit is used for modifying the event type in the event structure of the earlier event in the Map according to the event type after the merging processing, and modifying the event time in the event structure of the earlier event in the Map according to the event time of the target event structure to obtain an updated event structure of the earlier event.
Wherein the apparatus further comprises:
the determining module is used for determining the object type of the target event structure;
the second judgment module is used for judging whether the event type of the target event structure body is an excluded event type when the object type is a folder; if so, excluding the current event;
a third judging module, configured to judge whether the event type of the final event is an excluded event type after the object type is a file and the final event is obtained; and if so, excluding the final event.
Wherein, the first judging module further comprises:
the first judging unit is used for judging whether the event type of the current event is a renamed event or not;
the second searching unit is used for determining the identification information of the target object when the event type of the current event is a renamed event, and searching an event structure body of a previous event which is the same as the identification information from the Map;
a second determination unit configured to determine that there is no previous event corresponding to the target object in the event structure in which the previous event identical to the identification information is not found; and when finding the event structure of the previous event which is the same as the identification information, judging that the previous event corresponding to the target object exists.
Wherein the detection module comprises:
the second judgment unit is used for judging whether the difference value between the event time of the previous event corresponding to the target object and the current time is larger than a first difference threshold value or not; if so, taking the early event corresponding to the target object as a final event; if not, the acquisition module is triggered.
Wherein the detection module comprises:
and the third judging unit is used for taking the previous event corresponding to the target object as the final event when the difference value between the event time of the next current event of the target object and the event time of the previous event of the target object is greater than a second difference threshold value.
Referring to fig. 5, an electronic device according to an embodiment of the present invention includes:
a memory 21 for storing a computer program;
a processor 22 for implementing the steps of the event handling method according to any of the above-described method embodiments when executing the computer program.
In this embodiment, the device may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet Computer, a palmtop Computer, or a portable Computer.
The device may include a memory 21, a processor 22, and a bus 23.
The memory 21 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 21 may in some embodiments be an internal storage unit of the device, for example a hard disk of the device. The memory 21 may also be an external storage device of the device in other embodiments, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) Card, Flash memory Card (Flash Card), etc. provided on the device. Further, the memory 21 may also include both an internal storage unit of the device and an external storage device. The memory 21 may be used not only to store application software installed in the device and various types of data such as program codes for executing processing methods, etc., but also to temporarily store data that has been output or is to be output.
The processor 22 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for executing program codes stored in the memory 21 or Processing data, such as program codes for executing Processing methods.
The bus 23 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Further, the device may further include a network interface 24, and the network interface 24 may optionally include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are generally used to establish a communication connection between the device and other electronic devices.
Optionally, the device may further comprise a user interface 25, the user interface 25 may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 25 may also comprise a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the device and for displaying a visualized user interface.
Fig. 5 shows only the device with the components 21-25, and it will be understood by those skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the device, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the event processing method according to any of the above-mentioned method embodiments.
Wherein the storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An event processing method, comprising:
acquiring a current event generated when a target object changes;
judging whether a previous-stage event corresponding to the target object exists or not;
if so, combining the current event and the early event to obtain an updated early event corresponding to the target object; if not, directly taking the current event as an early-stage event corresponding to the target object;
and if the fact that the early event corresponding to the target object meets the preset condition is detected, taking the early event corresponding to the target object as a final event.
2. The event processing method according to claim 1, wherein the determining whether there is a previous event corresponding to the target object includes:
converting the current event into a target event structure; wherein, the event structure includes: at least one of an event type, an object name, a new file name, an object type, an event time;
taking the path of the target object as a key, and searching an event structure body of a previous event which is the same as the key from a Map;
if the event structure of the previous event which is the same as the key is not found, judging that the previous event corresponding to the target object does not exist; and if the event structure of the previous event which is the same as the key is found, judging that the previous event corresponding to the target object exists.
3. The event processing method according to claim 2, wherein the merging the current event and the early event to obtain an updated early event corresponding to the target object includes:
determining the event type of the current event according to the target event structure body, and determining the event type of the earlier event according to the event structure body of the earlier event;
determining the event type after the combination processing according to the event type of the current event and the event type of the previous event;
and modifying the event type in the event structure of the earlier event in the Map according to the event type after the merging processing, and modifying the event time in the event structure of the earlier event in the Map according to the event time of the target event structure to obtain an updated event structure of the earlier event.
4. The event processing method according to claim 2, wherein after converting the current event into a target event structure, the method further comprises:
determining the object type of the target event structure;
if the object type is a folder, judging whether the event type of the target event structure body is an excluded event type; if so, excluding the current event;
if the object type is a file, after the final event is obtained, judging whether the event type of the final event is an excluded event type; and if so, excluding the final event.
5. The event processing method according to claim 2, wherein after converting the current event into a target event structure, the method further comprises:
judging whether the event type of the current event is a renamed event or not;
if yes, determining the identification information of the target object, and searching an event structure body of a previous event which is the same as the identification information from the Map;
if the event structure of the previous event which is the same as the identification information is not found, judging that the previous event corresponding to the target object does not exist; and if the event structure of the previous event which is the same as the identification information is found, judging that the previous event corresponding to the target object exists.
6. The event processing method according to any one of claims 1 to 5, wherein the step of taking an earlier event corresponding to the target object as a final event if it is detected that the earlier event corresponding to the target object satisfies a predetermined condition includes:
judging whether the difference value between the event time of the previous event corresponding to the target object and the current time is greater than a first difference threshold value or not;
if so, taking the early event corresponding to the target object as a final event;
if not, continuing to execute the step of acquiring the current event generated by the target object when the target object is changed.
7. The event processing method according to any one of claims 1 to 5, wherein the step of taking an earlier event corresponding to the target object as a final event if it is detected that the earlier event corresponding to the target object satisfies a predetermined condition includes:
and if the difference value between the event time of the next current event of the target object and the event time of the earlier event of the target object is greater than a second difference threshold value, taking the earlier event corresponding to the target object as a final event.
8. An event processing apparatus, comprising:
the acquisition module is used for acquiring a current event generated when the target object changes;
the first judgment module is used for judging whether a previous-stage event corresponding to the target object exists or not;
the merging module is used for merging the current event and the early event when the early event corresponding to the target object exists to obtain an updated early event corresponding to the target object; if not, directly taking the current event as an early-stage event corresponding to the target object;
and the detection module is used for taking the early event corresponding to the target object as a final event when detecting that the early event corresponding to the target object meets a preset condition.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the event processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the event processing method according to any one of claims 1 to 7.
CN202111145300.5A 2021-09-28 2021-09-28 Event processing method, device, equipment and storage medium Active CN113806113B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111145300.5A CN113806113B (en) 2021-09-28 2021-09-28 Event processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111145300.5A CN113806113B (en) 2021-09-28 2021-09-28 Event processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113806113A true CN113806113A (en) 2021-12-17
CN113806113B CN113806113B (en) 2023-09-01

Family

ID=78938853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111145300.5A Active CN113806113B (en) 2021-09-28 2021-09-28 Event processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113806113B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130218941A1 (en) * 2012-02-17 2013-08-22 Bsquare Corporation Managed event queue for independent clients
US20170310557A1 (en) * 2016-04-22 2017-10-26 Invensys Systems, Inc. Consolidating manufacturing intelligence event queue items
CN107481039A (en) * 2017-07-27 2017-12-15 平安科技(深圳)有限公司 A kind of event-handling method and terminal device
CN111858504A (en) * 2020-06-04 2020-10-30 武汉达梦数据库有限公司 Operation merging execution method based on log analysis synchronization and data synchronization system
CN112131075A (en) * 2020-09-15 2020-12-25 上海上讯信息技术股份有限公司 Method and equipment for detecting abnormity of stored monitoring data
EP3757829A1 (en) * 2019-06-29 2020-12-30 INTEL Corporation Processor instruction support for mitigating controlled-channel and cache-based side-channel attacks
CN113283350A (en) * 2021-05-28 2021-08-20 青岛海尔科技有限公司 Operation event prompting method and device, storage medium and electronic device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130218941A1 (en) * 2012-02-17 2013-08-22 Bsquare Corporation Managed event queue for independent clients
US20170310557A1 (en) * 2016-04-22 2017-10-26 Invensys Systems, Inc. Consolidating manufacturing intelligence event queue items
CN107481039A (en) * 2017-07-27 2017-12-15 平安科技(深圳)有限公司 A kind of event-handling method and terminal device
EP3757829A1 (en) * 2019-06-29 2020-12-30 INTEL Corporation Processor instruction support for mitigating controlled-channel and cache-based side-channel attacks
CN111858504A (en) * 2020-06-04 2020-10-30 武汉达梦数据库有限公司 Operation merging execution method based on log analysis synchronization and data synchronization system
CN112131075A (en) * 2020-09-15 2020-12-25 上海上讯信息技术股份有限公司 Method and equipment for detecting abnormity of stored monitoring data
CN113283350A (en) * 2021-05-28 2021-08-20 青岛海尔科技有限公司 Operation event prompting method and device, storage medium and electronic device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
屠海滢,罗剑辉: ""离散事件仿真中的事件组合和合并事件策略"", 《系统仿真学报》, pages 229 - 231 *
雷超,戴国忠: ""三维交互体系结构的研究与实现"", 《计算机研究与发展》, pages 557 - 560 *

Also Published As

Publication number Publication date
CN113806113B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
US11249999B2 (en) Memory efficient searching
CN110442773B (en) Node caching method, system and device in distributed system and computer medium
CN109492399B (en) Risk file detection method and device and computer equipment
CN110704104B (en) Application counterfeiting detection method, intelligent terminal and storage medium
KR20140047570A (en) Protecting files that include editable metadata
CN110889691B (en) Information display method, device and equipment
WO2018014129A1 (en) Anomaly detection using sequences of system calls
US10181035B1 (en) System and method for .Net PE file malware detection
CN110704270A (en) Zero-buried point data acquisition method and device, electronic equipment and storage medium
CN103403709B (en) A kind of methods, devices and systems of reading and writing data
CN104200164B (en) Loader virus searching and killing method, device and terminal
CN113609479A (en) File detection method and device, electronic equipment and readable storage medium
CN113434122A (en) Multi-role page creation method and device, server and readable storage medium
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
CN111008079B (en) Process management method, device, storage medium and electronic equipment
CN113806113A (en) Event processing method, device, equipment and storage medium
CN110399166B (en) ME Nonce value saving method, device, equipment and storage medium
CN108446150B (en) Object reuse method and device and terminal equipment
CN108762826B (en) Process hiding method and computer readable storage medium
CN110618797A (en) Method and device for generating text trotting horse lamp and terminal equipment
CN111143293B (en) Metadata acquisition method, device, equipment and computer readable storage medium
CN115001683A (en) Payment data security protection method and device, electronic equipment and storage medium
CN110377665B (en) Data synchronization method and device, electronic equipment and storage medium
WO2019024507A1 (en) Touch control method and device, and terminal
CN110471793B (en) Data backup method, data recovery method, first terminal and second terminal

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
GR01 Patent grant
GR01 Patent grant