File processing method and device, storage medium and electronic equipment

By obtaining file directory change instructions in preset order and performing event recording and cancellation, the problem of file acquisition abnormalities caused by the order error of traditional file monitoring programs in large-scale data sets is solved, and the accuracy of file acquisition and system efficiency are improved.

CN119690926APending Publication Date: 2025-03-25HAINAN JINPAN INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411986109.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

Traditional file monitoring programs may encounter sequential errors when facing large-scale data sets, resulting in file acquisition exceptions.

Method used

By obtaining the change instructions of the file directory in the preset collection execution order, generating event records, and detecting whether there are associated event records in the event buffer area, and if there is, it is cancelled to ensure the correctness of file acquisition.

Benefits of technology

It effectively avoids file acquisition exceptions, ensures the accuracy and consistency of file acquisition, reduces the generation of useless files, and improves system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690926A_ABST
    Figure CN119690926A_ABST
Patent Text Reader

Abstract

The invention provides a file processing method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining a change instruction for a file directory of a server according to a preset collection execution sequence, the change instruction being used for indicating to execute a first operation of a target file in the file directory of the server; generating a first event record based on the change instruction; detecting whether a second event record associated with the first event record exists in the event cache region or not; if a second event record associated with the first event record exists, the change instruction corresponding to the first event record and a historical change instruction corresponding to the second event record are subjected to pin punching, and the historical change instruction corresponding to the second event record is used for instructing the server to execute a second operation of the target file; the second operation is an operation different from the first operation in the creation operation and the deletion operation. By applying the method provided by the invention, data acquisition abnormity can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file processing method, device, storage medium and electronic device. Background Art

[0002] In today's era of information explosion, efficient collection of unstructured data in document management and data processing systems has become critical. Unstructured data refers to data that does not follow predefined data models or patterns, such as text files, pictures, videos, etc., which account for the majority of the total amount of enterprise data. In order to effectively use this data, there must be a reliable mechanism to monitor and collect changes in this type of data.

[0003] Traditional file monitoring programs are used to detect changes in the file system, such as addition, modification, and deletion operations, and trigger the corresponding data collection process. However, in practical applications, especially when facing large-scale data sets, these file monitoring programs may encounter sequence errors, resulting in abnormal file collection. Summary of the invention

[0004] The technical problem to be solved by the present application is to provide a file processing method that can avoid file collection anomalies.

[0005] The present application also provides a file processing device to ensure the implementation and application of the above method in practice.

[0006] A file processing method, the method comprising:

[0007] Obtaining a change instruction for a file directory on the server side according to a preset acquisition execution order, wherein the change instruction is used to instruct to perform a first operation on a target file in the file directory on the server side, wherein the first operation is one of a creation operation, a deletion operation, or a modification operation;

[0008] generating a first event record based on the change instruction;

[0009] Detecting whether there is a second event record associated with the first event record in a preset event buffer area;

[0010] If there is a second event record associated with the first event record, the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record are offset, and the historical change instruction corresponding to the second event record is used to instruct the execution of a second operation of the target file on the server side, and the second operation is different from the first operation.

[0011] In the above method, optionally, generating a first event record based on the change instruction includes:

[0012] Parsing the change instruction to obtain change type information and a target file identifier included in the change instruction;

[0013] A first event record corresponding to the change instruction is generated according to the change type information and the target file identifier in the change instruction.

[0014] In the above method, optionally, the detecting whether there is a second event record associated with the first event record in a preset event buffer area includes:

[0015] querying the event cache area using the target file identifier in the first event record;

[0016] If the target event record including the target file identifier exists in the event cache area, it is determined whether the target event record is a second event record associated with the first event record according to the change type information in the target event record and the change type information in the first event record.

[0017] In the above method, optionally, the reversing of the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record includes:

[0018] Determine whether the first event record is within a time window corresponding to the second event record; the time window is determined based on a receiving timestamp of a historical change instruction corresponding to the second event record and a target parameter, the target parameter including at least one of a network parameter, a system load parameter, a memory usage of the target file, and a user behavior pattern parameter;

[0019] If the first event record is within the time window, the first event record and the second event record are marked as being in a cancelled state, so as to cancel the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record.

[0020] The above method may optionally further include:

[0021] If there is no second event record associated with the first event record, storing the first event record in the event buffer;

[0022] If no event record associated with the first event record is detected within a preset time, the change instruction is executed.

[0023] A file processing device, comprising:

[0024] A receiving unit, configured to obtain a change instruction for a file directory of a server according to a preset acquisition execution order, wherein the change instruction is used to instruct to perform a first operation on a target file in the file directory of the server, wherein the first operation is one of a creation operation, a deletion operation, or a modification operation;

[0025] A generating unit, configured to generate a first event record based on the change instruction;

[0026] a detection unit, configured to detect whether a second event record associated with the first event record exists in a preset event buffer area;

[0027] The first execution unit is used to offset the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record if there is a second event record associated with the first event record, and the historical change instruction corresponding to the second event record is used to instruct to perform a second operation of the target file on the server side, and the second operation is different from the first operation.

[0028] In the above device, optionally, the generating unit includes:

[0029] A parsing subunit, used for parsing the change instruction to obtain the change type information and the target file identifier included in the change instruction;

[0030] A generating subunit is used to generate a first event record corresponding to the change instruction according to the change type information and the target file identifier in the change instruction.

[0031] In the above device, optionally, the detection unit comprises:

[0032] A query subunit, configured to query the event cache area using a target file identifier in the first event record;

[0033] The first determination subunit is used to determine whether the target event record is a second event record associated with the first event record based on the change type information in the target event record and the change type information in the first event record if the target event record including the target file identifier exists in the event cache area.

[0034] In the above device, optionally, the first execution unit includes:

[0035] a second determination subunit, configured to determine whether the first event record is within a time window corresponding to the second event record; the time window is determined based on a receiving timestamp of a historical change instruction corresponding to the second event record and a target parameter, the target parameter including at least one of a network parameter, a system load parameter, a memory usage of the target file, and a user behavior pattern parameter;

[0036] The execution subunit is used to mark the first event record and the second event record as cancelled if the first event record is within the time window, so as to cancel the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record.

[0037] The above device may optionally further include:

[0038] a storage unit, configured to store the first event record in the event buffer if there is no second event record associated with the first event record;

[0039] The second execution unit is configured to execute the change instruction if no event record associated with the first event record is detected within a preset time.

[0040] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the file processing method as described above.

[0041] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the file processing method as described above.

[0042] Compared with the prior art, this application has the following advantages:

[0043] The present application provides a file processing method, device, storage medium and electronic device, the method comprising: obtaining a change instruction for a file directory of a server according to a preset acquisition execution order, the change instruction is used to indicate a first operation of executing a target file in the file directory of the server, the first operation being one of a creation operation, a deletion operation or a modification operation; generating a first event record based on the change instruction; detecting whether there is a second event record associated with the first event record in a preset event buffer; if there is a second event record associated with the first event record, then offsetting the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record, the historical change instruction corresponding to the second event record is used to indicate a second operation of executing the target file on the server, the second operation is different from the first operation. In the embodiment provided by the present application, by obtaining the change instruction according to the preset acquisition execution order, the failure of file acquisition can be effectively avoided, and thereby setting the event buffer buffer area, the relatively opposite instructions can be offset to avoid the acquisition of useless files. That is, the method provided by the embodiment of the present application can effectively avoid abnormal file acquisition. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0045] Figure 1 A flowchart of a file processing method provided for this application;

[0046] Figure 2 A flowchart of a process for generating a first event record based on a change instruction provided by the present application;

[0047] Figure 3 A flowchart of an instruction reversal process provided for this application;

[0048] Figure 4 A schematic diagram of the structure of a file processing device provided by the present application;

[0049] Figure 5 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0052] The present application embodiment provides a file processing method, which can be applied to electronic devices. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:

[0053] S101: obtaining a change instruction for a file directory on a server side according to a preset acquisition execution order, wherein the change instruction is used to instruct to execute a first operation on a target file in the file directory on the server side.

[0054] In this embodiment, the collection execution order may be the execution order of different change types of the file, for example, it may be the order of executing the deletion operation first and then the creation operation.

[0055] Optionally, the first operation is a creation operation or a deletion operation. In some embodiments, it may also be a modification operation.

[0056] In this embodiment, the file directory refers to a hierarchical structure for organizing and storing files on the server. When a user or client application needs to manage these files, such as adding a new file or removing an existing file, a change instruction is sent to the server. This request clearly indicates the type of operation to be performed on a target file in a specific file directory on the server, that is, the first operation referred to here, which can be to create (add) a file or delete an existing file.

[0057] In this embodiment, the target file may be any type of file, for example, may be an unstructured data document.

[0058] Optionally, the change instruction includes at least one of the following: a unique identifier for identification, detailed description of the target object or resource to be changed and its specific change content, provided by the initiator and marked with a timestamp, indicating the reason, type and priority of the change, and may be accompanied by supporting documents or additional information.

[0059] In some embodiments, the change order may also include the status of the approval process and any dependencies to ensure that changes are processed in the correct order and authority.

[0060] S102: Generate a first event record based on the change instruction.

[0061] In this embodiment, the first event record may include at least one of the timestamp of the request, the source, the target file path, the type of operation to be performed (create or delete), and possible user identity authentication information.

[0062] In an embodiment provided by the present application, based on the above embodiment, optionally, the first event record is generated based on the change instruction, such as Figure 2 As shown, including:

[0063] S201: Parse the change instruction to obtain change type information and a target file identifier included in the change instruction.

[0064] In this embodiment, after receiving the change instruction, the change instruction is first parsed. The main purpose of the parsing is to extract key information in the change instruction, namely, the change type information (for example, add, modify, delete, etc.) and the target file identifier (used to uniquely identify the file or resource to be changed).

[0065] S202: Generate a first event record corresponding to the change instruction according to the change type information and the target file identifier in the change instruction.

[0066] Optionally, the change type information and the target file identifier may be organized according to a preset event record format to generate a first event record corresponding to the change instruction.

[0067] S103: Detect whether there is a second event record associated with the first event record in a preset event buffer area.

[0068] In an embodiment provided by the present application, based on the above embodiment, optionally, the process of detecting whether there is a second event record associated with the first event record in the preset event buffer area includes:

[0069] querying the event cache area using the target file identifier in the first event record;

[0070] If the target event record including the target file identifier exists in the event cache area, it is determined whether the target event record is a second event record associated with the first event record according to the change type information in the target event record and the change type information in the first event record.

[0071] In this embodiment, the target file identifier parsed from the change instruction and included in the first event record is used as a keyword to search in the preset event buffer area to find all existing event records that may involve the same file or resource as the current change instruction.

[0072] Optionally, if target event records containing the same target file identifier are found in the event buffer, the change type information in these target event records is compared with the change type information in the first event record.

[0073] In this embodiment, the matching of the change types is determined. If both are modification requests for the same file and the change types are opposite, the event record may be determined to be the second event record.

[0074] In this embodiment, the change instructions corresponding to the event records in the event buffer area are all requests to be executed.

[0075] S104: If there is a second event record associated with the first event record, the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record are offset, and the historical change instruction corresponding to the second event record is used to instruct to perform a second operation of the target file on the server side, and the second operation is different from the first operation.

[0076] In this embodiment, the first operation may be a deletion operation, and the second operation may be a creation operation, or the first operation may be a creation operation, and the second operation may be a deletion operation.

[0077] In an embodiment provided in the present application, based on the above embodiment, optionally, the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record are offset, such as Figure 3 As shown, including:

[0078] S301: Determine whether the first event record is within a time window corresponding to the second event record; the time window is determined based on a receiving timestamp of a historical change instruction corresponding to the second event record and target parameters, wherein the target parameters include at least one of network parameters, system load parameters, memory usage of the target file, and user behavior pattern parameters.

[0079] In this embodiment, a time window is determined based on the reception timestamp of the historical change instruction corresponding to the second event record and combined with at least one target parameter (such as a network parameter, a system load parameter, a memory usage of a target file, or a user behavior pattern parameter).

[0080] The time window is used to limit the effective time period during which the first event record can be offset with the second event record. If the first event record occurs after the second event record but is still within the time window, it is considered that there is a reasonable correlation between them and they can be offset.

[0081] Optionally, after receiving the second event record, the basic time window may be determined first, and then the time window increment may be determined based on network parameters, system load parameters, the memory usage of the target file, or user behavior pattern parameters, and then the time window of the second event record may be determined in combination with the basic time window and the time window increment. Specifically, a preset configuration file may be queried based on network parameters, system load parameters, the memory usage of the target file, and user behavior pattern parameters to determine the time window increment. The configuration file records the time window increments corresponding to different target parameters.

[0082] In some embodiments, factors such as network parameters, system load parameters, and the size of the file example.txt are checked. Assuming that the fluctuation state parameter of the network is less than the preset fluctuation parameter threshold, the system load parameter is less than the preset load parameter threshold, and the file memory occupancy is less than the preset occupancy threshold, and the user often revokes operations within the preset time period, the time window increment can be determined to be 0, and the basic time window can be used as the time window of the second event record. If the fluctuation parameter of the network is not less than the fluctuation parameter threshold, the system load parameter is not less than the preset load parameter threshold, and the file memory occupancy is not less than the preset occupancy threshold, and the user's historical revocation time is longer than the preset time period, the basic time window can be added with a preset increment value to obtain the time window corresponding to the second event record.

[0083] S302: If the first event record is within the time window, mark the first event record and the second event record as being in a cancelled state, so as to cancel the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record.

[0084] In this embodiment, if the first event record is within the time window, it can be determined that the change type in the first event record and the change type in the second event record are interrelated, and they are marked as offset, that is, the two operations are considered to offset each other.

[0085] In an embodiment provided in the present application, based on the above embodiment, optionally, further comprising:

[0086] If there is no second event record associated with the first event record, storing the first event record in the event buffer;

[0087] If no event record associated with the first event record is detected within a preset time, the change instruction is executed.

[0088] In some embodiments, when the file is modified, a reasonable collection execution order is automatically set by the directory monitoring service: first execute the delete operation, and then execute the create operation, so as to ensure that the collection process is completed smoothly. When a user creates a new file in the operating system, the create (create) and del (delete) events are triggered; and the create event will generate two records. Given that del events are usually processed faster than create events, this may cause the del event to be executed before the file is fully uploaded, leaving many useless files in the distributed storage. To this end, the embodiment of the present application adopts a task instruction caching mechanism. If there are both new and deleted events within a certain time window, they are offset first to avoid unnecessary file uploads to the server. Doing so can not only save resources, but also effectively reduce the generation of useless files.

[0089] By applying the method provided in the embodiment of the present application, any creation or modification operation under the monitored file directory can ensure its real-time reflection in the acquisition and storage system, thereby ensuring the consistency and accuracy of the system data and improving the overall efficiency.

[0090] and Figure 1 Corresponding to the method described above, the embodiment of the present application further provides a file processing device for Figure 1 The specific implementation of the method is shown in the following diagram: Figure 4 As shown, specifically including:

[0091] The receiving unit 401 is used to obtain a change instruction for a file directory of the server according to a preset acquisition execution order, wherein the change instruction is used to instruct to perform a first operation of a target file in the file directory of the server, wherein the first operation is one of a creation operation, a deletion operation or a modification operation;

[0092] A generating unit 402, configured to generate a first event record based on the change instruction;

[0093] A detection unit 403 is used to detect whether there is a second event record associated with the first event record in a preset event buffer area;

[0094] The first execution unit 404 is used to offset the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record if there is a second event record associated with the first event record, and the historical change instruction corresponding to the second event record is used to instruct to perform a second operation of the target file on the server side, and the second operation is different from the first operation.

[0095] In an embodiment provided in the present application, based on the above solution, optionally, the generating unit includes:

[0096] A parsing subunit, used for parsing the change instruction to obtain the change type information and the target file identifier included in the change instruction;

[0097] A generating subunit is used to generate a first event record corresponding to the change instruction according to the change type information and the target file identifier in the change instruction.

[0098] In an embodiment provided in the present application, based on the above solution, optionally, the detection unit includes:

[0099] A query subunit, configured to query the event cache area using a target file identifier in the first event record;

[0100] The first determination subunit is used to determine whether the target event record is a second event record associated with the first event record based on the change type information in the target event record and the change type information in the first event record if the target event record including the target file identifier exists in the event cache area.

[0101] In an embodiment provided in the present application, based on the above solution, optionally, the first execution unit includes:

[0102] a second determination subunit, configured to determine whether the first event record is within a time window corresponding to the second event record; the time window is determined based on a receiving timestamp of a historical change instruction corresponding to the second event record and a target parameter, the target parameter including at least one of a network parameter, a system load parameter, a memory usage of the target file, and a user behavior pattern parameter;

[0103] The execution subunit is used to mark the first event record and the second event record as cancelled if the first event record is within the time window, so as to cancel the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record.

[0104] In an embodiment provided in the present application, based on the above solution, optionally, it further includes:

[0105] a storage unit, configured to store the first event record in the event buffer if there is no second event record associated with the first event record;

[0106] The second execution unit is configured to execute the change instruction if no event record associated with the first event record is detected within a preset time.

[0107] The specific principles and execution processes of each unit and module in the file processing device disclosed in the above embodiment of the present application are the same as the file processing method disclosed in the above embodiment of the present application. Please refer to the corresponding parts of the file processing method provided in the above embodiment of the present application, and will not be repeated here.

[0108] An embodiment of the present application further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned file processing method.

[0109] The present application also provides an electronic device, whose structural diagram is as follows: Figure 5 As shown, it specifically includes a memory 501 and one or more instructions 502, wherein the one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to perform the following operations:

[0110] Obtaining a change instruction for a file directory on the server side according to a preset acquisition execution order, wherein the change instruction is used to instruct to perform a first operation on a target file in the file directory on the server side, wherein the first operation is one of a creation operation, a deletion operation, or a modification operation;

[0111] generating a first event record based on the change instruction;

[0112] Detecting whether there is a second event record associated with the first event record in a preset event buffer area;

[0113] If there is a second event record associated with the first event record, the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record are offset, and the historical change instruction corresponding to the second event record is used to instruct the execution of a second operation of the target file on the server side, and the second operation is different from the first operation.

[0114] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0115] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0116] For the convenience of description, the above device is described in terms of functions and is described separately in various units. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0117] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0118] The above is a detailed introduction to a file processing method provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A file processing method, characterized in that: The following steps are involved: Obtaining a change instruction for a file directory on the server side according to a preset acquisition execution order, wherein the change instruction is used to instruct to execute a first operation on a target file in the file directory on the server side; generating a first event record based on the change instruction; Detecting whether there is a second event record associated with the first event record in a preset event buffer area; If there is a second event record associated with the first event record, the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record are offset, and the historical change instruction corresponding to the second event record is used to instruct the execution of a second operation of the target file on the server side, and the second operation is different from the first operation.

2. The method according to claim 1, characterized in that The generating a first event record based on the change instruction includes: Parsing the change instruction to obtain change type information and a target file identifier included in the change instruction; A first event record corresponding to the change instruction is generated according to the change type information and the target file identifier in the change instruction.

3. The method according to claim 1, characterized in that The detecting whether there is a second event record associated with the first event record in a preset event buffer area includes: querying the event cache area using the target file identifier in the first event record; If the target event record including the target file identifier exists in the event cache area, it is determined whether the target event record is a second event record associated with the first event record according to the change type information in the target event record and the change type information in the first event record.

4. The method according to claim 3, characterized in that: The reversing of the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record includes: Determine whether the first event record is within a time window corresponding to the second event record; the time window is determined based on a receiving timestamp of a historical change instruction corresponding to the second event record and a target parameter, the target parameter including at least one of a network parameter, a system load parameter, a memory usage of the target file, and a user behavior pattern parameter; If the first event record is within the time window, the first event record and the second event record are marked as being in a cancelled state, so as to cancel the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record.

5. The method according to claim 1, characterized in that Also includes: If there is no second event record associated with the first event record, storing the first event record in the event buffer; If no event record associated with the first event record is detected within a preset time, the change instruction is executed.

6. A file processing device, characterized in that: The following steps are involved: A receiving unit, configured to obtain a change instruction for a file directory of a server according to a preset acquisition execution order, wherein the change instruction is used to instruct to perform a first operation on a target file in the file directory of the server, wherein the first operation is one of a creation operation, a deletion operation, or a modification operation; A generating unit, configured to generate a first event record based on the change instruction; a detection unit, configured to detect whether a second event record associated with the first event record exists in a preset event buffer area; The first execution unit is used to offset the change instruction corresponding to the first event record and the historical change instruction corresponding to the second event record if there is a second event record associated with the first event record, and the historical change instruction corresponding to the second event record is used to instruct to perform a second operation of the target file on the server side, and the second operation is different from the first operation.

7. The device according to claim 6, characterized in that The generating unit comprises: A parsing subunit, used for parsing the change instruction to obtain the change type information and the target file identifier included in the change instruction; A generating subunit is used to generate a first event record corresponding to the change instruction according to the change type information and the target file identifier in the change instruction.

8. The device according to claim 6, characterized in that The detection unit comprises: A query subunit, configured to query the event cache area using a target file identifier in the first event record; The first determination subunit is used to determine whether the target event record is a second event record associated with the first event record based on the change type information in the target event record and the change type information in the first event record if the target event record including the target file identifier exists in the event cache area.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the file processing method according to any one of claims 1 to 5.

10. An electronic device, characterized in that: The device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the file processing method as claimed in any one of claims 1 to 5.