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

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

Info

Publication number
CN113806113B
CN113806113B CN202111145300.5A CN202111145300A CN113806113B CN 113806113 B CN113806113 B CN 113806113B CN 202111145300 A CN202111145300 A CN 202111145300A CN 113806113 B CN113806113 B CN 113806113B
Authority
CN
China
Prior art keywords
event
target object
type
current
earlier
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.)
Active
Application number
CN202111145300.5A
Other languages
Chinese (zh)
Other versions
CN113806113A (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

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

Abstract

The invention discloses an event processing method, an event processing device, event processing equipment and a storage medium; in the scheme, a current event generated when a target object changes is required to be acquired, and whether a pre-event corresponding to the target object exists or not is judged; if yes, merging 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 a pre-event corresponding to the target object; and if the detected early event corresponding to the target object meets the preset condition, taking the early event corresponding to the target object as a final event. Therefore, the method 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, apparatus, device, and storage medium.
Background
In a Windows operating system, a change to a file or folder is not completed at one time, but is completed after one or more changes. Each change made in completing the change may be referred to as an original event. The original event is likely to be acquired and actually exists. Currently, the Windows operating system provides an interface for acquiring a file change event, but the acquired original event is not the same as the visual perception of the user. Such as: creating an empty file, the creation of a file and the modification of a file can be found through the interface, and in fact, the user's operation is only one file creation, which occurs because the Windows operating system processes file changes in steps and is not completed at one time. Namely: in the existing implementation mode, the obtained original event is difficult to meet the viewing habit of people in use, and results are displayed to people, so that people often have difficulty in understanding and system implementation problems.
Disclosure of Invention
The invention aims to provide an event processing method, an event processing device, event processing equipment 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 pre-event corresponding to the target object exists or not;
if yes, 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 pre-event corresponding to the target object;
and if the detected early event corresponding to the target object meets the preset condition, taking the early event corresponding to the target object as a final event.
Wherein the determining whether a pre-event corresponding to the target object exists includes:
converting the current event into a target event structure; wherein, the event structure body comprises: at least one of event type, object name, new file name, object type, event time;
taking the path of the target object as a key, and searching an event structure body of the earlier event which is the same as the key from the Map;
if the event structure body of the earlier event which is the same as the key is not found, judging that the earlier event corresponding to the target object does not exist; if the event structure of the earlier event identical to the key is found, determining that the earlier event corresponding to the target object exists.
The merging processing of the current event and the previous event to obtain an updated previous 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 previous event according to the event structure body of the previous event;
determining the event type after merging processing according to the event type of the current event and the event type of the earlier event;
and modifying the event type in the event structure of the early event in the Map according to the event type after the merging processing, and modifying the event time in the event structure of the early event in the Map according to the event time of the target event structure to obtain an event structure of the updated early event.
Wherein after the current event is converted into the target event structure, the method further comprises:
determining an object type of the target event structure;
if the object type is a folder, judging whether the event type of the target event structure is an event excluding type; if yes, the current event is eliminated;
if the object type is a file, judging whether the event type of the final event is an excluded event type or not after the final event is obtained; if yes, the final event is eliminated.
Wherein after the current event is converted into the 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 body of the earlier event which is the same as the identification information is not found, judging that the earlier event corresponding to the target object does not exist; if the event structure of the earlier event which is the same as the identification information is found, judging that the earlier event corresponding to the target object exists.
And if the detected early event corresponding to the target object meets the preset condition, taking the early event corresponding to the target object as a final event, wherein the method comprises the following steps:
judging whether the difference value between the event time of the earlier event corresponding to the target object and the current time is larger than a first difference value threshold value or not;
if yes, taking the earlier 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 during the change.
And if the detected early event corresponding to the target object meets the preset condition, taking the early event corresponding to the target object as a final event, wherein the method comprises the following steps:
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 larger than a second difference value threshold, 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 judging module is used for judging whether a pre-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, so as to obtain an updated early event corresponding to the target object; if not, directly taking the current event as a pre-event corresponding to the target object;
and the detection module is used for taking the earlier event corresponding to the target object as a final event when the earlier event corresponding to the target object is detected to meet the preset condition.
To achieve the above object, the present invention further provides an electronic device including:
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 stored thereon a computer program which, when executed by a processor, implements the steps of the event processing method described above.
As can be seen from the above solutions, the embodiment of the present invention provides an event processing method, apparatus, device, and storage medium; in the scheme, a current event generated when a target object changes is required to be acquired, and whether a pre-event corresponding to the target object exists or not is judged; if yes, merging 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 a pre-event corresponding to the target object; and if the detected early event corresponding to the target object meets the preset condition, taking the early event corresponding to the target object as a final event. Therefore, the method 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 invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an event processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an overall process of event merging according to an embodiment of the present invention;
FIG. 3 is a flowchart of another event processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an event processing device 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, in file protection or website tamper-proof technology, event triggering technology is one of the common technologies. Compared with other technologies, the method for monitoring by using the event triggering mode has the advantage of low system consumption, and a good event acquisition algorithm can well acquire and process file changes. In the current prior art, most event monitoring does not fully process all events to form a file processing event that behaves the same. At present, in a Windows system, a FindFirstChangeNotification function and a ReadDirectyChangesW function can be used for acquiring original events of file changes, but the acquired original events are unprocessed and are difficult to directly use. In this case, errors occur in the event operated by the user and the acquired event, resulting in serious consequences. 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 also only raw events that are not processed can be obtained.
Therefore, the embodiment of the invention discloses an event processing method, an event processing device, event processing equipment and a storage medium. Specifically, since one or more original events are generated each time the target object changes, the present solution can process the original events and combine them into a final event. It should be noted that there may be multiple original events or only one original event generated by each change of the target object, but only one final event. The final event needs to be generated through merging of original events, and cannot be directly obtained from the system. In this way, the final event obtained by the user is consistent with the file change observed by the user.
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flow chart of an event processing method provided by an embodiment of the present invention specifically includes:
s101, acquiring a current event generated by a target object in the process of change;
specifically, the target object in this embodiment may be a file or a folder, which is not limited herein, as long as it generates a current event when it changes. The current event is an original event generated by the target object at each change, such as: the user newly builds a 1.Txt file in the folder, and at this time, two original events are acquired, namely: new events of the txt file and modification events of the 1.Txt file, both of which are original events generated when the target object (1. Txt file) changes. In addition, since the respective original events are sequentially generated and have different event times, in this embodiment, the original event generated when the target object is changed at the present time is taken as the present event, and if the target object is changed multiple times, different present events are generated at different times.
S102, judging whether a pre-event corresponding to a 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 pre-event corresponding to the target object;
s105, if the early event corresponding to the target object is detected to meet the preset condition, the early event corresponding to the target object is taken as a final event.
It should be noted that, in the website tamper-proof program in the Windows system, the system first monitors the folder and the file through the interface provided by the operating system, and the system can obtain one or more original events each time the file in the folder changes. The system stores the original events in a queue for buffering, and other threads perform subsequent merging processing. In the processing process, the system can combine the original events according to the conditions of the event types of the original events, the occurrence time of the events, the occurrence sequence of the events and the like to generate a new event, wherein the event types of the event are the same as the operation types of the files.
In this embodiment, the pre-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 pre-event of the target object. In this embodiment, if the current event acquired in S101 is the first current event of the target object, then there is no previous event of the target object, and 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 received, a pre-event exists at the moment, and the acquired current event and the pre-event need to be combined to obtain a new pre-event.
For example: after receiving the first current event of the target object, the first current event needs to be used as a pre-event, after receiving the second current event of the target object, the second current event needs to be combined with the pre-event to generate an updated pre-event, after receiving the third current event of the target object, the third current event needs to be combined with the pre-event after the previous update to generate an updated pre-event, and so on until the pre-event corresponding to the target object is detected to meet the preset condition, the pre-event corresponding to the target object is used as a final event to be reported, and if the preset condition is not met, the step S101 is continuously executed, namely: and continuing to acquire the next current event of the target object, merging until the generated early event meets the preset condition, and reporting the generated early event as a final event. Referring to fig. 2, an overall flow chart of event merging is provided in an embodiment of the present invention; as can be seen from fig. 2, after the thread 1 acquires the original event of the system and stores the original event in the queue, the thread 2 acquires the original event from the queue for processing, for example: event merging, event exclusion, etc.; if the event processing is completed or the event meets the preset condition, a final event is generated and reported, and if the event is not completed or the event does not meet the preset condition, the original event is continuously acquired from the queue for processing.
In summary, the method for obtaining the final event by combining the original events can keep the operation executed by the user consistent with the generated final event, so that the final event can accurately reflect the operation of the target object, and the method is beneficial to the direct use of the system. Such as: the scheme is applied to file protection or website tamper-proof 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 a legal event, execution is allowed, and if the final event is an illegal event, file repair and other operations 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 carry out file protection, website tamper resistance and the like, thereby providing convenience for the use of the system.
Referring to fig. 3, another flow chart of an event processing method provided in an embodiment of the present invention specifically includes:
s201, acquiring a current event generated by a target object in the process of change;
s202, converting a current event into a target event structure body, taking a path of a 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; wherein, the event structure body comprises: at least one of event type, object name, new file name, object type, event time;
if the event structure of the previous event identical to the key is not found, determining that there is no previous event corresponding to the target object, and executing S203; if the event structure of the previous event identical to the key is found, it is determined that there is a previous event corresponding to the target object, and S206 is executed.
In this embodiment, an Event structure Event is defined, and several fields in the Event structure are as follows:
the event types defined by the scheme mainly comprise the following:
it will be appreciated that the event types of the plurality of original events generated by the same file operation may be different, but the full paths of the other events are the same except for renaming, so that in the event and merging process, the scheme needs to combine the paths of the event as a link between the plurality of original events.
S203, determining the event type of the current event according to the target event structure body, and determining the event type of the early event according to the event structure body of the early event;
s204, determining the event type after merging processing according to the event type of the current event and the event type of the earlier event;
s205, modifying the event type in the event structure of the early event in the Map according to the event type after the merging process, modifying the event time in the event structure of the early event in the Map according to the event time of the target event structure to obtain an event structure of the updated early event, and continuing to execute S207.
S206, storing a target event structure of the current event as a value and a path of a target object as a key to the Map, and continuing to execute S201;
in this embodiment, at the beginning of system startup, a < string, event > type Map is created for Event merging. And when the system discovers the original Event, converting the original Event into a structural object of an Event, taking the occurrence path of the Event as a key, and then searching whether the corresponding early Event exists or not from the Map. If the event exists, the event is taken out from the Map, the early event serving as a target object is combined with the current event, and meanwhile, the time of the event is updated, so that the updated early event is obtained and stored in the Map. If not, the target event structure of the current event is stored as a value in the Map. In this embodiment, when determining the event type after the merging process 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, where the merging rule may be set according to an actual situation, and only a part of rules are described herein:
1. if the event type of the current event is newly built:
1. new + new = logic confusion, ignoring early events: resetting the early event and releasing the current event;
2. delete+new build = merge as replacement: resetting the early event and releasing the current event;
3. modification + new = logic confusion, ignoring the early event: and resetting the early event and releasing the current event.
2. If the event type of the current event is delete:
1. new + delete = cancel: releasing the early event, and releasing the current event (new and deletion cannot be combined, and the current event is reported separately, and the early event is directly reported because the event type of the early event is new);
2. delete+delete = logic chaotic, ignore early event: resetting the early event and releasing the current event;
3. modify + delete = delete: and resetting the early event and releasing the current event.
3. The event type of the current event is modification:
1. new + modify = new: resetting the early event and releasing the current event;
2. delete+modify = logic chaotic, ignore early event: resetting the early event and releasing the current event;
3. modification + modification = modification, ignore current event: and resetting the early event and releasing the current event.
In the rule, both the ignore event and the release event represent delete events, and the reset event represents update of the event, for example: an update of event type, an update of event time, etc.
It should be noted that, because the file path of the renamed event changes, after the current event is converted into the target event structure body by the scheme, it is also necessary to determine whether the event type of the current event is a renamed event; if yes, determining the identification information of the target object, and searching an event structure body of the earlier event which is the same as the identification information from the Map; if the event structure of the previous event identical to the identification information is not found, determining 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 the process proceeds to S203. The identification information is a number for indicating the uniqueness of the target object, and may be an integer, which is not particularly limited herein.
S207, judging whether the difference value between the event time of the earlier event corresponding to the target object and the current time is larger than a first difference value threshold value; if yes, executing S208; if not, executing S201;
s208, taking the earlier event corresponding to the target object as a final event.
It should be noted that, in this embodiment, after the current event and the previous event are combined and the updated previous event is generated, a predetermined condition needs to be set 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 the difference between the event time of the early event corresponding to the target object and the current time is greater than a first difference threshold; if yes, taking the earlier event corresponding to the target object as a final event; if not, continuing to acquire the next current event to carry out merging processing, and reporting the next current event 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. When the previous event corresponding to the target object is taken as the final event and S202 is executed again, the previous event of the target object is not found. 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 acquired, event merging is finished, and the current event is taken as the first original event of the next operation of the target object, and the subsequent merging processing is continued.
Further, after converting the current event into the target event structure, an object type of the target event structure may also be determined; if the object type is the folder, judging whether the event type of the target event structure body is an event excluding type; if yes, the current event is eliminated; if the object type is a file, judging whether the event type of the final event is an excluded event type or not after the final event is obtained; if yes, the final event is excluded. That is to say: the scheme not only can merge and process the original event to obtain the final event which can be directly observed and used, but also can classify and exclude the file and support various excluding strategies, in the embodiment, the excluded event type is the event type needing to be excluded, the event after being excluded does not execute subsequent merging and reporting operations, and the excluded event type can be set by user definition. Moreover, the scheme not only can exclude different changes of the same file, for example: only one or more changes such as new creation, deletion, modification and the like of the file are monitored, and the monitoring of partial files under the same catalog can be realized, so that the method is more visual and flexible in use and simpler in processing.
In summary, after the multiple original events are combined and processed by the scheme, the final event acquired by the user can be consistent with the actual operation of the user, and the method can be applied to all Windows systems, so that the phenomenon that the file change and the monitored event change under the Windows system are inconsistent is solved, and the monitored file event can be conveniently and directly used.
The processing device, the storage medium and the processing method described in the following may be referred to each other.
Referring to fig. 4, an embodiment of the present invention provides a schematic structure of an event processing device, including:
an obtaining module 11, configured to obtain a current event generated when a target object changes;
a first judging module 12, configured to judge whether a pre-event corresponding to the target object exists;
the merging module 13 is configured to, when a pre-event corresponding to the target object exists, merge the current event and the pre-event to obtain an updated pre-event corresponding to the target object; if not, directly taking the current event as a pre-event corresponding to the target object;
and the detection module 14 is used for taking the earlier event corresponding to the target object as a final event when the earlier event corresponding to the target object is detected to meet the preset condition.
Wherein, the first judging module includes:
a conversion unit for converting the current event into a target event structure; wherein, the event structure body comprises: at least one of event type, object name, new file name, object type, event time;
a first search unit, configured to search an event structure of a previous event that is the same as a key from a Map, using a path of the target object as the key;
a first determination unit configured to determine that a preceding event corresponding to the target object does not exist when an event structure of the preceding event identical to the key is not found; and when an event structure body of the same pre-event as the key is found, determining that the pre-event corresponding to the target object exists.
Wherein, the merging module includes:
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;
the second determining unit is used for determining the event type after combining processing according to the event type of the current event and the event type of the earlier event;
and the updating unit is used for modifying the event type in the event structure body of the early event in the Map according to the event type after the merging processing, and modifying the event time in the event structure body of the early event in the Map according to the event time of the target event structure body to obtain an event structure body of the updated early event.
Wherein the apparatus further comprises:
a determining module for determining an object type of the target event structure;
the second judging module is used for judging whether the event type of the target event structure body is an event exclusion type or not when the object type is a folder; if yes, the current event is eliminated;
the third judging module is used for judging whether the event type of the final event is an event excluding type after the final event is obtained, wherein the object type is a file; if yes, the final event is eliminated.
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 a pre-event corresponding to the target object does not exist, when an event structure of the pre-event identical to the identification information is not found; and when the event structure body of the earlier event which is the same as the identification information is found, judging that the earlier event corresponding to the target object exists.
Wherein, the detection module includes:
the second judging unit is used for judging whether the difference value between the event time of the earlier event corresponding to the target object and the current time is larger than a first difference value threshold value or not; if yes, taking the earlier event corresponding to the target object as a final event; and if not, triggering the acquisition module.
Wherein, the detection module includes:
and the third judging unit is used for taking the earlier event corresponding to the target object as a 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 earlier event of the target object is larger than a second difference value threshold value.
Referring to fig. 5, an electronic device structure schematic diagram provided in 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 processing method according to any of the method embodiments described above 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 palm 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 including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 21 may in some embodiments be an internal storage unit of the device, such as a hard disk of the device. The memory 21 may in other embodiments also be an external storage device of the device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are 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 for storing application software installed in the device and various types of data, such as program codes for executing a processing method, etc., but also for temporarily storing data that has been output or is to be output.
The processor 22 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for executing program code or processing data stored in the memory 21, such as program code for performing processing methods, etc.
The bus 23 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 5, but not only one bus or one type of bus.
Further, the device may also 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.), typically 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 further 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, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the device and for displaying a visual user interface.
Fig. 5 shows only a device having components 21-25, it will be understood by those skilled in the art that the configuration shown in fig. 5 is not limiting of the device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program realizes the steps of the event processing method in any of the method embodiments when being executed by a processor.
Wherein the storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer 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 (8)

1. An event processing method, comprising:
acquiring a current event generated when a target object changes;
judging whether a pre-event corresponding to the target object exists or not;
if yes, 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 pre-event corresponding to the target object;
if the detected earlier event corresponding to the target object meets the preset condition, taking the earlier event corresponding to the target object as a final event;
wherein the determining whether a pre-event corresponding to the target object exists includes:
converting the current event into a target event structure; wherein, the event structure body comprises: at least one of event type, object name, new file name, object type, event time;
taking the path of the target object as a key, and searching an event structure body of the earlier event which is the same as the key from the Map;
if the event structure body of the earlier event which is the same as the key is not found, judging that the earlier event corresponding to the target object does not exist; if the event structure body of the earlier event which is the same as the key is found, judging that the earlier event corresponding to the target object exists;
the merging processing of the current event and the previous event to obtain an updated previous 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 previous event according to the event structure body of the previous event;
determining the event type after merging processing according to the event type of the current event and the event type of the earlier event;
and modifying the event type in the event structure of the early event in the Map according to the event type after the merging processing, and modifying the event time in the event structure of the early event in the Map according to the event time of the target event structure to obtain an event structure of the updated early event.
2. The event processing method according to claim 1, further comprising, after the converting the current event into a target event structure:
determining an object type of the target event structure;
if the object type is a folder, judging whether the event type of the target event structure is an event excluding type; if yes, the current event is eliminated;
if the object type is a file, judging whether the event type of the final event is an excluded event type or not after the final event is obtained; if yes, the final event is eliminated.
3. The event processing method according to claim 1, further comprising, after the converting the current event into a target event structure:
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 body of the earlier event which is the same as the identification information is not found, judging that the earlier event corresponding to the target object does not exist; if the event structure of the earlier event which is the same as the identification information is found, judging that the earlier event corresponding to the target object exists.
4. The event processing method according to any one of claims 1 to 3, wherein if it is detected that the pre-event corresponding to the target object satisfies a predetermined condition, then taking the pre-event corresponding to the target object as a final event, comprises:
judging whether the difference value between the event time of the earlier event corresponding to the target object and the current time is larger than a first difference value threshold value or not;
if yes, taking the earlier 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 during the change.
5. The event processing method according to any one of claims 1 to 3, wherein if it is detected that the pre-event corresponding to the target object satisfies a predetermined condition, then taking the pre-event corresponding to the target object as a final event, comprises:
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 larger than a second difference value threshold, taking the earlier event corresponding to the target object as a final event.
6. An event processing apparatus, comprising:
the acquisition module is used for acquiring a current event generated when the target object changes;
the first judging module is used for judging whether a pre-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, so as to obtain an updated early event corresponding to the target object; if not, directly taking the current event as a pre-event corresponding to the target object;
the detection module is used for taking the earlier event corresponding to the target object as a final event when the earlier event corresponding to the target object is detected to meet the preset condition;
the first judging module is specifically configured to convert the current event into a target event structure body; wherein, the event structure body comprises: at least one of event type, object name, new file name, object type, event time; taking the path of the target object as a key, and searching an event structure body of the earlier event which is the same as the key from the Map; if the event structure body of the earlier event which is the same as the key is not found, judging that the earlier event corresponding to the target object does not exist; if the event structure body of the earlier event which is the same as the key is found, judging that the earlier event corresponding to the target object exists;
the merging module is specifically 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; determining the event type after merging processing according to the event type of the current event and the event type of the earlier event; and modifying the event type in the event structure of the early event in the Map according to the event type after the merging processing, and modifying the event time in the event structure of the early event in the Map according to the event time of the target event structure to obtain an event structure of the updated early event.
7. 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 of claims 1 to 5 when executing said computer program.
8. A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the event processing method according to any of claims 1 to 5.
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 CN113806113A (en) 2021-12-17
CN113806113B true 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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013123514A1 (en) * 2012-02-17 2013-08-22 Bsquare Corporation Managed event queue for independent clients
US10374903B2 (en) * 2016-04-22 2019-08-06 Schneider Electric Software, Llc Consolidating manufacturing intelligence event queue items

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 (1)

* Cited by examiner, † Cited by third party
Title
"三维交互体系结构的研究与实现";雷超,戴国忠;《计算机研究与发展》;第557-560页 *

Also Published As

Publication number Publication date
CN113806113A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN112005233B (en) Restoration point selection based on malware attack detection
US20160350282A1 (en) Sensitive text detecting method and apparatus
CN110457363B (en) Query method, device and storage medium based on distributed database
CN108063818B (en) Data downloading method, device, terminal and computer readable storage medium
CN111930962A (en) Document data value evaluation method and device, electronic equipment and storage medium
CN112434308B (en) Application vulnerability detection method and device, electronic equipment and computer storage medium
CN111400126A (en) Network service abnormal data detection method, device, equipment and medium
CN110704104A (en) Application counterfeit detection method, intelligent terminal and storage medium
CN109710571B (en) File analysis method, device and storage medium
CN111694843A (en) Missing number detection method and device, electronic equipment and storage medium
CN113806113B (en) Event processing method, device, equipment and storage medium
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
US11544276B2 (en) Search device, method and program recording medium
CN110399166B (en) ME Nonce value saving method, device, equipment and storage medium
CN109194703B (en) Processing method of communication load between cloud platform hosts, electronic device and medium
CN111858604A (en) Data storage method and device, electronic equipment and storage medium
CN110618797A (en) Method and device for generating text trotting horse lamp and terminal equipment
US20150278722A1 (en) Event processing device, event processing method, and event processing program
CN115001683A (en) Payment data security protection method and device, electronic equipment and storage medium
CN111143293B (en) Metadata acquisition method, device, equipment and computer readable storage medium
CN113434122A (en) Multi-role page creation method and device, server and readable storage medium
CN114546522B (en) Picture configuration method and device for application, electronic equipment and storage medium
CN106778359B (en) The release method and its electronic device of resetting factory protection
CN113687981B (en) Data recovery method, device, equipment and storage medium
CN116050375B (en) Policy file similarity comparison method, device and system and electronic equipment

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