File operation processing method and device

By automatically determining the order of concurrent file operations and executing them asynchronously on the server, the problems of large data transmission volume and high processing complexity in existing technologies are solved, achieving more efficient and reliable file operation processing.

CN121996633APending Publication Date: 2026-05-08JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-01-29
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing distributed file systems, concurrent file operations increase the amount of data transmitted by client read/write requests and complicate the processing logic of metadata service nodes, making it difficult to guarantee the reliability of file operations and data consistency.

Method used

By processing read, write, and truncation operation requests received from clients, the server automatically determines the order of concurrent operations and executes them accordingly, sending feedback information to ensure asynchronous execution of file operations, thus reducing the data maintenance burden on both the information server and the client.

Benefits of technology

It improves the reliability and data consistency of concurrent file operations, reduces the amount of data transmitted and the complexity of processing, and improves file processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121996633A_ABST
    Figure CN121996633A_ABST
Patent Text Reader

Abstract

The invention discloses a file operation processing method and device, and relates to the technical field of distributed file processing. A specific embodiment of the invention comprises the following steps: receiving a read-write operation request aiming at a target file sent by a client by utilizing a processing server, and receiving a truncation operation request aiming at the target file sent by an information server forwarding client; determining a concurrent operation sequence of the read-write operation and the truncation operation; executing read-write operation and truncation operation based on the concurrent operation sequence; further sending first feedback information corresponding to the truncation operation and second operation feedback information corresponding to the read-write operation; according to the embodiment of the invention, through interaction among the processing server, the information server and the client, the execution sequence of different file operations is automatically determined, and the file operations are asynchronously executed, so that the reliability of processing concurrent file operations and the data consistency of files are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed file processing technology, and in particular to a file operation processing method and apparatus. Background Technology

[0002] In a distributed file system, there are various operations on files, such as read and write operations, truncation operations, etc. In real-world scenarios, the same file often receives multiple different types of operation requests at the same time (such as receiving write requests and truncation requests at the same time).

[0003] Existing methods typically utilize metadata service nodes to receive truncation requests, maintain and record the specific truncation data corresponding to each truncation request, and require clients to carry additional truncation information when initiating read / write requests to avoid newly written data being truncated or reading outdated data. Existing methods for handling file operations increase the amount of data transmitted in client read / write requests and also increase the complexity of file processing logic in metadata service nodes. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a file operation processing method and apparatus, applied to a file operation processing system. The method and apparatus utilize a processing server to receive read / write operation requests for a target file sent by a client, and to receive truncation operation requests for a target file forwarded by an information server from the client; determine the concurrent operation order of the read / write and truncation operations; and execute the read / write and truncation operations based on the concurrent operation order; further, it sends a first feedback message corresponding to the truncation operation and a second operation feedback message corresponding to the read / write operation. Through the interaction between the processing server, the information server, and the client, the present invention automatically determines the execution order of different file operations and executes file operations asynchronously, thereby improving the reliability of processing concurrent file operations and the data consistency of files.

[0005] To achieve the above objectives, according to one aspect of the present invention, a file operation processing method is provided, applied to a file operation processing system, including: a client, an information server, and a processing server; The server receives read / write operation requests for target files from clients, and forwards truncation operation requests for target files from clients. The processing server determines the concurrent operation order of read, write, and truncation operations; based on the concurrent operation order, it executes the read, write, and truncation operations. The processing server sends the first feedback information corresponding to the truncation operation to the information server, so that the information server can determine that after receiving all the first feedback information sent by the processing server, it will forward the first feedback information to the client; and the processing server sends the second operation feedback information corresponding to the read and write operations to the client.

[0006] Optionally, the processing server obtains the target data block indicated by the read / write operation request and the truncation operation request; during the execution of read / write operations and truncation operations, the processing server uses the status identifier of the target data block to indicate the read / write operation status or the truncation operation status.

[0007] Optionally, after the processing server receives the truncation operation request for the target file sent by the client forwarded by the information server, it sets the status flag of the target data block to the truncation operation status and sends a first feedback message indicating that the truncation operation was successful to the information server; after the processing server receives the read / write operation request for the target file sent by the client, it sets the status flag of the target data block to the read / write operation status and sends a second feedback message indicating that the read / write operation was successful to the client.

[0008] Optionally, read and write operations include write operations and read operations. After receiving the truncation operation request for the target file sent by the client forwarded by the information server, the processing server determines the status identifier of the target data block. If the status identifier indicates a write operation status, the concurrent operation order of read / write operations and truncation operations is determined to be write operations first, followed by truncation operations. If the status identifier indicates a truncation operation status, the concurrent operation order of read / write operations and truncation operations is determined to be truncation operations first, followed by either write or read operations.

[0009] Optionally, for cases where the concurrent operation order of read / write and truncation operations is determined to be write operations first and truncation operations later, the processing server executes read / write and truncation operations based on the concurrent operation order, including: executing the write operation, pausing the truncation operation to wait for the write operation to complete; and resuming and executing the truncation operation after determining that the write operation is complete.

[0010] Optionally, for cases where the concurrent operation order of read / write operations and truncation operations is determined to be truncation operations first and write operations later, the processing server performs read / write operations and truncation operations based on the concurrent operation order, including: performing truncation operations, pausing write operations to wait for truncation operations to complete; and resuming and performing write operations after determining that the write operations are complete.

[0011] Optionally, for cases where the concurrent operation order of read / write operations and truncation operations is determined to be truncation operations first and read operations second, the processing server performs read / write operations and truncation operations based on the concurrent operation order, including: performing truncation operations; setting the data range of the target data block to a preset value; and returning the preset value as the second feedback information of the read operation request to the client.

[0012] Optionally, during read / write and truncation operations, the processing server uses the status flag of the target data block to indicate the read / write operation status or the truncation operation status, including setting the status flag to a preset status when it is determined that both the read / write and truncation operations for the target data block have been completed.

[0013] To achieve the above objectives, according to a second aspect of the present invention, a file operation processing server is provided, characterized in that it includes: a request receiving module, an operation execution module, and a feedback sending module; wherein, The request receiving module is used to receive read / write operation requests for the target file sent by the client, and to receive truncation operation requests for the target file sent by the client forwarded by the information server. The execution operation module is used to determine the concurrent operation order of read, write, and truncation operations; based on the concurrent operation order, it executes the read, write, and truncation operations. The feedback sending module is used to send the first feedback information corresponding to the truncation operation to the information server, so that the information server can determine to forward the first feedback information to the client after receiving the first feedback information sent by all file operation processing servers; and to send the second operation feedback information corresponding to the read and write operations to the client.

[0014] Optionally, the file operation processing server is used to obtain the target data block indicated by read / write operation requests and truncation operation requests; during the execution of read / write operations and truncation operations, the status identifier of the target data block is used to indicate the read / write operation status or the truncation operation status.

[0015] Optionally, the file operation processing server is configured to receive a truncation operation request for a target file sent by the client forwarded by the information server, set the status flag of the target data block to the truncation operation status, and send a first feedback message indicating that the truncation operation was successful to the information server; and to receive a read / write operation request for a target file sent by the client, set the status flag of the target data block to the read / write operation status, and send a second feedback message indicating that the read / write operation was successful to the client.

[0016] Optionally, the read / write operation includes a write operation and a read operation; the file operation processing server, after receiving a truncation operation request for the target file sent by the client forwarded by the information server, determines the status identifier of the target data block. If the status identifier indicates a write operation status, the server determines the concurrent operation order of the read / write operation and the truncation operation to be write operation first, followed by truncation operation; if the status identifier indicates a truncation operation status, the server determines the concurrent operation order of the read / write operation and the truncation operation to be truncation operation first, followed by either write or read operation.

[0017] Optionally, for cases where the concurrent operation order of read / write and truncation operations is determined to be write operations first and truncation operations later, the file operation processing server is used to perform read / write and truncation operations based on the concurrent operation order, including: performing a write operation, pausing the truncation operation to wait for the write operation to complete; and resuming and performing the truncation operation after determining that the write operation is complete.

[0018] Optionally, for cases where the concurrent operation order of read / write operations and truncation operations is determined to be truncation operations first and write operations later, the file operation processing server is used to perform read / write operations and truncation operations based on the concurrent operation order, including: performing truncation operations, pausing write operations to wait for truncation operations to complete; and resuming and performing write operations after determining that the write operations are complete.

[0019] Optionally, for cases where the concurrent operation order of read / write operations and truncation operations is determined to be truncation operations first and read operations second, the file operation processing server is used to perform read / write operations and truncation operations based on the concurrent operation order, including: performing truncation operations; setting the data range of the target data block to a preset value; and returning the preset value as the second feedback information of the read operation request to the client.

[0020] Optionally, the file operation processing server is used to indicate the read / write operation status or truncation operation status using the status identifier of the target data block during read / write and truncation operations, including: setting the status identifier to a preset status when it is determined that both read / write and truncation operations for the target data block have been completed.

[0021] To achieve the above objectives, according to a third aspect of the present invention, an electronic device for file operation processing is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform any of the methods described above for file operation processing.

[0022] To achieve the above objectives, according to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements any of the methods described above for file operation processing.

[0023] To achieve the above objectives, according to a fifth aspect of the present invention, a computer program product is provided, comprising a computer program, characterized in that, when executed by a processor, the computer program implements any of the methods described above for file operation processing.

[0024] One embodiment of the above invention has the following advantages or beneficial effects: It can utilize a processing server to receive read / write operation requests for target files sent by clients, and receive truncation operation requests for target files forwarded by clients from an information server; determine the concurrent operation order of read / write and truncation operations; and execute read / write and truncation operations based on the concurrent operation order; further, it sends first feedback information corresponding to the truncation operation and second operation feedback information corresponding to the read / write operation. This embodiment of the invention, through the interaction between the processing server, the information server, and the client, automatically determines the execution order of different file operations and executes file operations asynchronously, improving the reliability of concurrent file operation processing and the data consistency of files. Clients do not need to carry truncation data when sending read / write requests, and the information server does not need to maintain truncation data, reducing the amount of data transmitted by the file system and the processing difficulty.

[0025] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0026] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1 This is a schematic diagram of the structure of a file operation processing system provided in an embodiment of the present invention; Figure 2 is a schematic diagram of a file truncation operation provided in an embodiment of the present invention; Figure 3A This is a schematic diagram of an interactive process for file operation processing provided in an embodiment of the present invention; Figure 3B This is a schematic diagram of another file operation processing interaction provided by an embodiment of the present invention; Figure 3C This is a schematic diagram of another file operation processing interaction provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a file operation processing server provided in one embodiment of the present invention; Figure 5 is an exemplary system architecture diagram in which embodiments of the present invention can be applied; Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0027] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0028] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention all comply with the provisions of relevant laws and regulations, and require notification to users and obtaining their consent or authorization. When applicable, user personal information is subjected to de-identification and / or anonymization and / or encryption technical processing.

[0029] like Figure 1 As shown, this embodiment of the invention provides a file operation processing method, applied to a file operation processing system 100, including: a client 103, an information server 102, and a processing server 101; The processing server 101 receives read / write operation requests for the target file sent by the client 103, and the receiving information server 102 forwards truncation operation requests for the target file sent by the client 103. Processing server 101 determines the concurrent operation order of read / write and truncation operations; based on the concurrent operation order, it executes the read / write and truncation operations; Processing server 101 sends first feedback information corresponding to the truncation operation to information server 102, so that information server 102 determines to forward the first feedback information to client 103 after receiving all first feedback information from processing servers; and processing server 101 sends second operation feedback information corresponding to the read / write operation to client 103.

[0030] Specifically, for various file operations including file truncation, this embodiment of the invention utilizes a processing server to directly determine the concurrent operation order of read / write and truncation operations; and based on the determined concurrent operation order, executes the read / write and truncation operations. This eliminates the need for an information server to record the specific truncation data for the truncation request, and also eliminates the need for the client to carry truncation data when sending read / write requests. This reduces the amount of data transmitted between multiple parties, improves the reliability of file operations, and reduces the complexity of processing file operations.

[0031] Furthermore, in this embodiment of the invention, an existing metadata server (MetaServer) can be reused as an information server to receive truncation operation requests for a certain file sent by the client, and directly forward the truncation operation requests to the processing server (DataServer). The metadata server (MetaServer) is used to maintain and update the file's metadata.

[0032] Simultaneously, the server directly receives read and write operation requests (write operation requests, read operation requests) from clients.

[0033] Furthermore, the processing server determines the concurrent operation order of read / write and truncation operations based on the received file operation requests (read operations, write operations, truncation operations, etc.); based on the concurrent operation order, it executes the read / write and truncation operations; during the processing, the processing server sends the first feedback information corresponding to the truncation operation to the information server, so that the information server determines to forward the first feedback information to the client after receiving all the first feedback information from the processing servers; and the processing server sends the second operation feedback information corresponding to the read / write operation to the client.

[0034] Different types of file operations are automatically performed through the interaction between the processing server 101, the information server 102, and the client 103.

[0035] In this embodiment of the invention, the processing server obtains the target data block indicated by the read / write operation request and the truncation operation request; during the execution of the read / write operation and the truncation operation, the processing server uses the status identifier of the target data block to indicate the read / write operation status or the truncation operation status.

[0036] Specifically, the truncation operation request includes the specific truncation data corresponding to the truncation operation, such as: Fsid (representing the file system identifier to which the target file belongs), Ino (the inode identifier of the target file), File size (the size of the target file), chunk information (i.e., target data block information), Truncate size (the size of the truncated data), etc.

[0037] Furthermore, read and write operation requests (read operation requests and write operation requests) can also carry information about the target data block in the target file.

[0038] In this embodiment of the invention, the truncation operation and the read / write operation are usually aimed at the same target data block, that is, the data operated on by the truncation operation and the read / write operation have overlapping areas. Therefore, the processing server can be used to determine the concurrent operation order of the read / write operation and the truncation operation; and further, based on the determined concurrent operation order, the read / write operation and the truncation operation are executed.

[0039] Specifically, the method for determining the concurrent operation order of read / write and truncation operations using the processing server is as follows: combining the receiving order of the received requests and setting the status flag of the target data block.

[0040] In essence, after the processing server receives a truncation operation request for a target file from the client (forwarded by the information server), it sets the status flag of the target data block to the truncation operation status and sends a first feedback message indicating successful truncation to the information server. Similarly, after the processing server receives a read / write operation request for the target file from the client, it sets the status flag of the target data block to the read / write operation status and sends a second feedback message indicating successful read / write to the client. For example, the truncation operation status is 't', and the read / write operation status is 'w'; the status flag of the target data block indicates either the read / write operation status or the truncation operation status.

[0041] Preferably, in this embodiment of the invention, after receiving a truncation operation request for the target file, the processing server may also record detailed data about the truncation operation as a transaction log for reference when performing subsequent truncation operations, or to provide data for subsequent statistical analysis of file truncation operations.

[0042] Furthermore, read and write operations include write operations and read operations. After receiving a truncation operation request for the target file sent by the client forwarded by the information server, the processing server determines the status identifier of the target data block. If the status identifier indicates a write operation status, the concurrent operation order of read / write and truncation operations is determined to be write operation first, followed by truncation operation; if the status identifier indicates a truncation operation status, the concurrent operation order of read / write and truncation operations is determined to be truncation operation first, followed by either write or read operation. Specifically, after receiving any type of operation request, the processing server can check the status data of the status identifier and determine the concurrent operation order of read / write and truncation operations based on whether the status data is 't' (representing truncation status) or 'w' (representing write status).

[0043] Furthermore, during read / write and truncation operations, the processing server uses the status identifier of the target data block to indicate the status of the read / write or truncation operation. This includes setting the status identifier to a preset status when it is determined that both the read / write and truncation operations on the target data block have been completed. Specifically, the preset status can be a default value, i.e., clearing the status corresponding to the status identifier.

[0044] like Figure 2 As shown in the figure, this embodiment of the invention provides a structural diagram for processing file truncation operations; it includes: a client 103, an information server 102, and a processing server 101; Client 103 sends a truncation operation request for the target file. Information server 102 receives the truncation operation request for the target file sent by client 103 and forwards it to multiple processing servers that process the target file, namely DataServer1, DataServer2, and DataServerN.

[0045] Multiple processing servers, DataServer1, DataServer2, and DataServerN, each process the truncation operation request and return feedback information (i.e., the first feedback information) for the truncation operation. The information server, after receiving the first feedback information from all processing servers, forwards the first feedback information to the client. Specifically, the information server can manage the mapping relationship between target files and processing servers, thereby determining the multiple target processing servers (or all processing servers) to forward the truncation operation to the file.

[0046] After the processing server successfully receives the truncation operation request and obtains the information of the truncation operation request, it returns the first feedback information (e.g., truncation operation successful). The actual execution of the truncation operation by the processing server can be carried out after the first feedback information is returned. Each processing server performs asynchronous file operations.

[0047] This invention, by processing truncation requests through a processing server, eliminates the need for the information server to maintain specific truncation information for the file. This overcomes the problems of existing methods that require clients to send read / write requests with truncation data and require the information server to maintain truncation information, leading to complex business processing and large data transmission volumes. This improves file processing efficiency and reliability.

[0048] like Figure 3A As shown in the figure, this embodiment of the invention provides an interactive flowchart for file operation processing; it includes the following steps: Step S301A: Client 1 sends a write operation request for the target data block of the target file; the processing server receives the request, sets the status flag of the target data block to the write operation status (w), and performs the write operation.

[0049] Step S302A: Client 2 sends a truncation operation request for the target data block of the target file to the information server; the information server determines the processing server to handle the request and forwards the request to the processing server; the processing server records the truncation transaction log; sets the status flag of the target data block to truncation operation status t (i.e., switching from write operation status to truncation operation status). It then immediately returns a successful truncation operation (i.e., the first feedback message) to the information server and further provides feedback to client 2, i.e., the truncation operation is executed asynchronously.

[0050] Step S303A: The server pauses the truncation operation, waits for the write operation to complete, resumes the truncation operation, and sends a message of successful write operation execution (i.e., the second feedback information) to the corresponding client 1; simultaneously, it clears the status flag after confirming the completion of the truncation operation. The method for pausing the truncation operation, waiting for the write operation to complete, and then resuming the truncation operation can be accomplished by maintaining condition variables, mutex locks, and combining functions such as wait and notify.

[0051] Steps S301A to S303A describe the case where the concurrent operation order of read / write and truncation operations is determined to be write operation first and truncation operation second. The processing server executes read / write and truncation operations based on the concurrent operation order, including: executing the write operation, pausing the truncation operation to wait for the write operation to complete; and resuming and executing the truncation operation after determining that the write operation is complete.

[0052] This invention overcomes the problems of existing methods that require clients to send truncated data when sending read / write requests, and require information servers to maintain truncated information, resulting in complex business processing and large data transmission volumes. By processing server maintenance status identifiers and truncation information, this invention improves file processing efficiency and reliability.

[0053] like Figure 3B As shown in the diagram, this embodiment of the invention provides another interactive flow diagram for file operation processing; it includes the following steps: Step S301B: Client 1 sends a truncation operation request for the target data block of the target file to the information server; the information server determines the processing server to handle the request and forwards the request to the processing server; the processing server records the truncation transaction log; sets the status flag of the target data block to the truncation operation status t, and immediately returns the truncation operation execution success (i.e., the first feedback information) to the information server and further feedback to client 1, and executes the truncation operation asynchronously.

[0054] Step S302B: Client 1 sends a write operation request for the target data block of the target file; the processing server receives the request, determines that the current status of the status identifier indicates a truncation operation, therefore sets the status identifier of the target data block to the write operation status w, and suspends the write operation, waiting for the truncation operation to complete; after determining that the truncation operation is completed, the write operation is resumed; further, the write operation is determined to be completed and the status identifier is cleared, and feedback on the successful execution of the write operation (i.e., the second feedback information) is sent to the corresponding client 1.

[0055] Steps S301B to S302B describe the case where the concurrent operation order of read / write and truncation operations is determined to be truncation operation first, followed by write operation. Based on the concurrent operation order, the processing server executes read / write and truncation operations, including: executing truncation operation, pausing write operation to wait for truncation operation to complete; and resuming and executing write operation after determining that write operation is complete.

[0056] This invention overcomes the problems of existing methods that require clients to send truncated data when sending read / write requests, and require information servers to maintain truncated information, resulting in complex business processing and large data transmission volumes. By processing server maintenance status identifiers and truncation information, this invention improves file processing efficiency and reliability.

[0057] like Figure 3C As shown in the diagram, this embodiment of the invention provides another interactive flow diagram for file operation processing; it includes the following steps: Step S301C: Client 1 sends a truncation operation request for the target data block of the target file to the information server; the information server determines the processing server to handle the request and forwards the request to the processing server; the processing server records the truncation transaction log; sets the status flag of the target data block to the truncation operation status t, and immediately returns a successful truncation operation (i.e., the first feedback information) to the information server, further feedback to client 1, and asynchronously executes the truncation operation.

[0058] Step S302C: Client 1 sends a read operation request for the target data block of the target file; the processing server receives the request, sets the data range of the target data block to a preset value, and returns a second feedback message indicating successful read operation to Client 1; after confirming that the truncation operation has been completed, the status flag is cleared. The preset value for the data range can be 0; that is, 0 is used as the second feedback message for the read operation request, indicating that the data range being read is invalid (truncation operation performed).

[0059] Steps S301B to S302B describe the case where the concurrent operation order of read / write and truncation operations is determined to be truncation operation first, followed by read operation. Based on this concurrent operation order, the processing server executes the read / write and truncation operations, including: performing the truncation operation; setting the data range of the target data block to a preset value; and returning the preset value as the second feedback information to the client for the read operation request. This step overcomes the problem of reading old data during the read operation.

[0060] Understandably, in cases where a read operation precedes a truncation operation, since the read operation does not modify the target file, it can directly execute the read and return the corresponding data. The subsequent truncation operation can then be executed without waiting for the read operation to finish.

[0061] This invention overcomes the problems of existing methods that require clients to send truncated data when sending read / write requests, and require information servers to maintain truncated information, resulting in complex business processing and large data transmission volumes. By processing server maintenance status identifiers and truncation information, this invention improves file processing efficiency and reliability.

[0062] like Figure 4 As shown, this embodiment of the invention provides a file operation processing server 400, including: a request receiving module 401, an operation execution module 402, and a feedback sending module 403; wherein, The request receiving module 401 is used to receive read / write operation requests for the target file sent by the client, and to receive truncation operation requests for the target file sent by the client forwarded by the information server. The execution module 402 is used to determine the concurrent operation order of read / write operations and truncation operations; and to execute read / write operations and truncation operations based on the concurrent operation order. The feedback sending module 403 is used to send the first feedback information corresponding to the truncation operation to the information server, so that the information server can determine that after receiving the first feedback information from all processing servers, it will forward the first feedback information to the client; and to send the second operation feedback information corresponding to the read and write operation to the client.

[0063] This invention also provides an electronic device for file operation processing, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in any of the above embodiments.

[0064] This invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in any of the above embodiments.

[0065] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the methods described above for file operation processing.

[0066] Figure 5 An exemplary system architecture 500 is shown that can be applied to the file operation processing method or file operation processing apparatus of the present invention.

[0067] like Figure 5As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0068] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, and 503, such as e-commerce client applications, web browser applications, search applications, instant messaging tools, and email clients.

[0069] Terminal devices 501, 502, and 503 can be various electronic devices with displays and supporting various client applications, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0070] Server 505 can be a server that provides various services, such as a background management server that supports client applications used by users through terminal devices 501, 502, and 503. The background management server can process received file read / write or truncation operation requests and return the operation results to the terminal devices.

[0071] It should be noted that the file operation processing method provided in the embodiments of the present invention is generally executed by server 505, and correspondingly, the file operation processing server is generally set in server 505.

[0072] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0073] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device of the present invention. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0074] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0075] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0076] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.

[0077] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0079] The modules and / or units described in the embodiments of the present invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor; for example, a processor can be described as including a request receiving module, an operation execution module, and a feedback sending module. The names of these modules do not necessarily limit the module itself; for example, a request receiving module can also be described as "a module that receives read / write operation requests or truncation operation requests for a target file."

[0080] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: the ability to receive read / write operation requests for target files sent by a client using a processing server, and to receive truncation operation requests for target files sent by a client forwarded by an information server; determine the concurrent operation order of the read / write operations and the truncation operations; and execute the read / write operations and the truncation operations based on the concurrent operation order; further sending first feedback information corresponding to the truncation operation and second operation feedback information corresponding to the read / write operation. The embodiments of the present invention, through the interaction between the processing server, the information server, and the client, automatically determine the execution order of different file operations and execute file operations asynchronously, improving the reliability of handling concurrent file operations and the data consistency of files. The client does not need to carry truncation data when sending read / write requests, and the information server does not need to maintain truncation data, reducing the amount of data transmitted by the file system and the processing difficulty.

[0081] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A file operation processing method, characterized in that, It is used in file operation and processing systems, including: clients, information servers, and processing servers; The processing server receives read / write operation requests for the target file sent by the client, and receives truncation operation requests for the target file forwarded by the information server from the client. The processing server determines the concurrent operation order of the read / write operation and the truncation operation; based on the concurrent operation order, it executes the read / write operation and the truncation operation. The processing server sends the first feedback information corresponding to the truncation operation to the information server, so that the information server determines, after receiving the first feedback information sent by all processing servers, to forward the first feedback information to the client; and the processing server sends the second operation feedback information corresponding to the read / write operation to the client.

2. The method according to claim 1, characterized in that, The processing server obtains the target data block indicated by the read / write operation request and the truncation operation request; During the execution of the read / write operation and the truncation operation, the processing server uses the status identifier of the target data block to indicate the read / write operation status or the truncation operation status.

3. The method according to claim 2, characterized in that, After receiving the truncation operation request for the target file sent by the client forwarded by the information server, the processing server sets the status identifier of the target data block to the truncation operation status and sends back first feedback information indicating that the truncation operation was successful to the information server. After receiving the read / write operation request for the target file sent by the client, the processing server sets the status identifier of the target data block to the read / write operation status and sends a second feedback message indicating that the read / write operation was successful to the client.

4. The method according to claim 3, characterized in that, The read / write operations include write operations and read operations; After receiving the truncation operation request for the target file sent by the client and forwarded by the information server, the processing server determines the status identifier of the target data block. If the status indicator indicates a write operation status, the concurrent operation order of the read / write operation and the truncation operation is determined to be write operation first, followed by truncation operation. If the status indicator indicates a truncation operation state, the concurrent operation order of the read / write operation and the truncation operation is determined to be truncation operation first, followed by write or read operation.

5. The method according to claim 4, characterized in that, For cases where the concurrent operation order of the read / write operation and the truncation operation is determined to be write operation first, followed by truncation operation, The processing server executes the read / write operations and the truncation operations based on the concurrent operation order, including: Perform a write operation, then pause the truncation operation to wait for the write operation to complete. After confirming that the write operation is complete, resume and execute the truncation operation.

6. The method according to claim 4, characterized in that, For cases where the concurrent operation order of the read / write operation and the truncation operation is determined to be truncation operation first, followed by write operation, The processing server executes the read / write operations and the truncation operations based on the concurrent operation order, including: Perform a truncation operation, pausing write operations to wait for the truncation operation to complete; After confirming that the write operation is complete, resume and execute the write operation.

7. The method according to claim 4, characterized in that, For cases where the concurrent operation order of the read / write operation and the truncation operation is determined to be truncation operation first, followed by read operation, The processing server executes the read / write operations and the truncation operations based on the concurrent operation order, including: Perform a truncation operation; Set the data range of the target data block to a preset value; The preset value is then returned to the client as the second feedback information for the read operation request.

8. The method according to claim 2, characterized in that, During the execution of the read / write operation and the truncation operation, the processing server uses the status identifier of the target data block to indicate the read / write operation status or the truncation operation status, including: Once it is determined that both the read / write operation and the truncation operation for the target data block have been completed, the status flag is set to a preset state.

9. A file operation processing server, characterized in that, include: The module comprises a request receiving module, an operation execution module, and a feedback sending module; among which, The receiving request module is used to receive read / write operation requests for the target file sent by the client, and to receive truncation operation requests for the target file sent by the client forwarded by the information server. The execution module is used to determine the concurrent operation order of the read / write operation and the truncation operation; and to execute the read / write operation and the truncation operation based on the concurrent operation order. The feedback sending module is used to send the first feedback information corresponding to the truncation operation to the information server, so that the information server determines to forward the first feedback information to the client after receiving the first feedback information sent by all file operation processing servers; and to send the second operation feedback information corresponding to the read / write operation to the client.

10. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.

12. A computer program product, comprising a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.