CN114817166B - Method, device and medium for canceling file operation - Google Patents

Method, device and medium for canceling file operation Download PDF

Info

Publication number
CN114817166B
CN114817166B CN202210612336.8A CN202210612336A CN114817166B CN 114817166 B CN114817166 B CN 114817166B CN 202210612336 A CN202210612336 A CN 202210612336A CN 114817166 B CN114817166 B CN 114817166B
Authority
CN
China
Prior art keywords
file operation
target node
canceling
executing
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210612336.8A
Other languages
Chinese (zh)
Other versions
CN114817166A (en
Inventor
徐如庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210612336.8A priority Critical patent/CN114817166B/en
Publication of CN114817166A publication Critical patent/CN114817166A/en
Application granted granted Critical
Publication of CN114817166B publication Critical patent/CN114817166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Landscapes

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

Abstract

The application discloses a method, a device and a medium for canceling file operation, and mainly relates to the field of file management. The method for canceling file operation firstly receives an instruction for canceling file operation input by a user, and inquires the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation; then, the REST interface is called to send an instruction for canceling the file operation to the target node according to the IP of the target node, so that the target node cancels the file operation according to the instruction for canceling the file operation. Therefore, the method can send the instruction for canceling the file operation to the target node by calling the IP of the target node recorded in the schedule, and can realize canceling the file operation in a multi-copy scene, thereby reducing the waiting time of a user and server resources and improving the working efficiency of the user.

Description

Method, device and medium for canceling file operation
Technical Field
The present invention relates to the field of file management, and in particular, to a method, an apparatus, and a medium for canceling file operations.
Background
For training tasks in artificial intelligence (Artificial Intelligence, AI) scenarios, the importance of file transfer is self-evident, however, file operations, such as file copying, decompression, compression, etc., are sometimes canceled halfway through the process of transferring the file.
In the single copy scene, the current file operation of the node can be directly canceled; in the case of multiple copies, the node executing the file operation and the node receiving the instruction for canceling the file operation may be different nodes, so that when the node executing the file operation and the node receiving the instruction for canceling the file operation are different nodes, the node executing the file operation cannot cancel the current file operation, and the file operation in the queue cannot be immediately executed, but needs to wait for the execution of the current file operation, thereby bringing poor experience to the user.
It can be seen how to implement the cancel file operation in the multi-copy scenario is a problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a method, a device and a medium for canceling file operation, which are used for realizing canceling file operation in a multi-copy scene.
In order to solve the above technical problems, the present application provides a method for canceling file operations, including:
receiving an instruction of canceling file operation input by a user, and inquiring the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation;
and calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation.
Preferably, after the target node cancels the file operation, the method further comprises:
setting data obtained by the target node executing file operation as data to be deleted;
and deleting the data to be deleted.
Preferably, after the target node cancels the file operation, the method further comprises:
and deleting the progress data of the target node for executing the file operation from the progress table.
Preferably, the invoking the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node includes:
calling a REST interface to send a communication request to a target node according to the IP of the target node;
receiving a response of the communication request fed back by the target node;
and establishing a connection channel with the target node according to the response of the communication request, and sending an instruction for canceling the file operation to the target node through the connection channel.
Preferably, if no response to the communication request fed back by the target node is received within a preset time, the method further includes:
triggering a timing task in the target node; the timing tasks comprise canceling file operation, deleting data to be deleted and deleting progress data of the target node for executing file operation.
Preferably, before receiving the instruction of canceling the file operation input by the user, the method further comprises:
and displaying the progress of the target node for executing the file operation according to the progress data of the target node for executing the file operation recorded in the progress table.
Preferably, the method further comprises:
and recording a log for executing the file operation and canceling the file operation.
In order to solve the above technical problem, the present application further provides a device for canceling file operations, including:
the receiving module is used for receiving an instruction of canceling file operation input by a user and inquiring the IP of the target node from the schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation;
and the calling module is used for calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation.
Preferably, the method further comprises:
the setting module is used for setting data obtained by the target node executing the file operation as data to be deleted after the target node cancels the file operation;
and the first deleting module is used for deleting the data to be deleted.
Preferably, the method further comprises:
and the second deleting module is used for deleting the progress data of the file operation executed by the target node from the progress table after the file operation is canceled by the target node.
Preferably, the method further comprises:
the sending module is used for calling the REST interface to send a communication request to the target node according to the IP of the target node;
the receiving response module is used for receiving a response of the communication request fed back by the target node;
the establishing module is used for establishing a connection channel with the target node according to the response of the communication request, and sending an instruction for canceling the file operation to the target node through the connection channel.
Preferably, the method further comprises:
the triggering module is used for triggering a timing task in the target node when a response of the communication request fed back by the target node is not received within a preset time; the timing tasks comprise canceling file operation, deleting data to be deleted and deleting progress data of the target node for executing file operation.
Preferably, the method further comprises:
and the display module is used for displaying the progress of the target node executing the file operation according to the progress data of the target node executing the file operation recorded in the progress table before receiving the instruction of canceling the file operation input by the user.
Preferably, the method further comprises:
and the recording module is used for recording the log for executing the file operation and canceling the file operation.
In order to solve the above technical problem, the present application further provides a device for canceling file operations, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the method for canceling the file operation when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for canceling a file operation described above.
The application provides a method for canceling file operation, which receives an instruction of canceling file operation input by a user and inquires the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation; and calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation. Therefore, the method can send the instruction for canceling the file operation to the target node by calling the IP of the target node recorded in the schedule, and can realize canceling the file operation in a multi-copy scene, thereby reducing the waiting time of a user and server resources and improving the working efficiency of the user.
In addition, the device and the medium for canceling the file operation have the same beneficial effects as the method for canceling the file operation.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a method for canceling file operations provided herein;
FIG. 2 is a flow chart of a method for canceling file operations provided herein;
FIG. 3 is a block diagram of an apparatus for canceling file manipulation provided herein;
fig. 4 is a block diagram of another apparatus for canceling file operations provided in the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
In the AI usage scenario, in order to perform a training task or an operation of a development environment, a file is first uploaded or copied, and in the operation process, the file may be further required to be compressed, decompressed, and deleted. The current AI training platform needs to queue up for execution for the same type of file operation as the user. For example, assuming that user a uses a copy file operation and needs to copy 10 files, if in a single copy scenario, only one copy operation of a file is in progress and the copy operations of the remaining files are all queued; if in a multi-copy scenario, the copy operation of all files would be randomly distributed to multiple nodes, assuming a total of 3 nodes currently, they would be randomly distributed to one of the 3 nodes. If the copy operation numbers 1, 4, and 7 are executed on the first node, the copy operation numbers 2, 5, and 8 are executed on the second node, and the copy operation numbers 3, 6, 9, and 10 are executed on the third node, they are respectively queued on the respective nodes. If the first node is executing the copy operation with the number 1, the copy operations with the numbers 4 and 7 are in the queue, and if the copy operation with the number 1 on the first node is to be canceled, an instruction for canceling the copy operation is issued to the node, however, the actually issued instruction for canceling the copy operation may be randomly distributed to any one of the three nodes, and the probability that each node receives the issued instruction for canceling the copy operation is 1/3. If an instruction to cancel the copy operation enters the first node, the copy operation numbered 1 being executed on the first node may be immediately canceled, and one of the copy operations numbered 4 and 7 may be immediately executed; if the instruction for canceling the copy operation enters the second node or the third node, the copy operation with the number 1 will disappear immediately from the display interface, but since the copy operation with the number 1 is not performed on the node receiving the instruction for canceling the copy operation, one of the copy operations with the numbers 4 and 7 in the queue cannot be performed immediately, but needs to wait until the copy operation with the number 1 on the first node is performed, which may bring bad experience to the user.
In order to solve the above problems, the core of the present application is to provide a method, an apparatus, and a medium for canceling file operations, which are used for implementing canceling file operations in a multi-copy scenario.
Fig. 1 is a schematic diagram of a method for canceling file operations provided in the present application, and for convenience of understanding, an application scenario to which the technical solution of the present application is applicable is described below with reference to fig. 1.
The system for canceling file operation can comprise a user terminal, an operation interface, a node, a display interface and a background system.
In a specific implementation, the user terminal may provide an information input interface of the query operation interface for the user through an application installed in the user terminal, such as a browser, an AI training platform, and the like. Specifically, the user terminal can acquire the website or the keyword of the query operation interface input by the user through the information input interface, and then can query the operation interface in the installed application interface. It is understood that user terminals in this application include, but are not limited to, smartphones, tablet computers, desktop computers, and the like.
The operation interface is a link for realizing communication between the user and the background system, and in this application, the operation interface may be an operation interface of the AI training platform. Specifically, the operation interface can acquire an instruction of canceling file operation input by a user through an information input field on the interface, and send the acquired instruction to the background system, and the background system randomly distributes the instruction to a certain node for execution. It should be noted that, since the background system and the node generally adopt different network communication protocols, in order to facilitate the background system to issue the received instruction to the node, a gateway is required to implement network interconnection between the background system and the node.
In the AI usage scenario, there are typically a plurality of nodes, and each node is provided with a file management micro-service for executing an instruction issued by the background system. As shown in fig. 1, assuming that 2 nodes are used, an instruction to cancel a file operation is issued to node 2, and the node actually performing the file operation is node 1, node 2 may query the schedule by its own file management micro service to obtain the IP of node 1, at this time node 2 may find node 1 according to the IP of node 1, and forward the instruction to cancel the file operation to node 1 by requesting a service to cancel the current file operation of node 1. In addition, each node can access the tool package of the file operation through the file management micro service of the node, wherein the tool package of the file operation encapsulates operations such as copying, compressing, decompressing and deleting the file, the operations can be used for executing various file operations, and the IP of the node executing the file operation in the schedule and the schedule data of the node executing the file operation can be deleted by using the tool package. In order to facilitate the query of the schedule, the schedule can be stored in a pre-created database, so that the database can be found according to the address of the database and the schedule can be obtained by querying the database, and it is noted that the pre-created database can be a special database for storing the schedule or a general database for storing various data, and the execution of the technical scheme of the application is not affected. In general, the pre-created database is a dedicated database, and is only used for storing the schedule and the data obtained by the instruction for executing the file operation, so that after the node cancels the file operation, the schedule and the data obtained by executing the file operation can be directly found from the database, and further, the schedule data of the file operation can be deleted from the schedule and the data obtained by executing the file operation can be deleted.
In a specific implementation, the background system is used for receiving an instruction of a user input operation interface, and if the received instruction is an instruction for executing file operation, the instruction is randomly issued to a certain node so that the node executes the file operation corresponding to the instruction; if the received instruction is an instruction for canceling the file operation, the instruction is analyzed to find a target node corresponding to the instruction, and at the moment, the IP of the target node can be queried from the schedule, and then the instruction can be issued to the target node according to the IP of the target node so as to cancel the current file operation of the target node.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description.
It should be noted that, the method for canceling file operation provided by the present application is mainly applicable to AI training platforms, especially large file and massive file operation scenes.
Fig. 2 is a flowchart of a method for canceling a file operation provided in the present application, as shown in fig. 2, where the method includes:
s1: receiving an instruction of canceling file operation input by a user, and inquiring the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation.
The file operation includes copying the file, compressing the file, decompressing the file, deleting the file, and the like. In the AI training platform, the file operations are run in the form of threads, each having its own running thread, and each file operation has a return value Future since each thread in Java (a computer programming language) multithreading has its return value Future. If a file operation being executed is to be canceled, a cancel method of Future needs to be triggered, and the progress of the file operation is canceled by the cancel method, so that the file operation being executed is terminated.
In specific implementation, the user can input an instruction for canceling the file operation through the operation interface of the AI training platform, and then issue the instruction to the node for executing the file operation, namely the target node through the gateway. Specifically, after receiving an instruction for executing a file operation, if a plurality of file operations of the same type need to be executed, each file operation is randomly distributed to each node, and each node concurrently executes each file operation. It will be appreciated that when the number of nodes is less than the number of file operands, for example, there are a total of 3 nodes, but the file operation instruction requires copying of 10 files, at which time some nodes may need to perform multiple file operations, and because the AI training platform needs to queue up for file operations of the same type as the user, the nodes will only perform one of the received file operations at a time, and the other file operations will be in a queued state, and only after the execution of one file operation is completed, the file operation in the queue will be performed. In addition, when each node executes the file operation, the IP of the node currently executing the file operation and the progress data of the node executing the file operation are written in the progress table. After receiving the instruction of canceling the file operation input by the user, the node executing the file operation can be used as the target node, and the IP of the target node can be queried from the schedule at the moment, so that the instruction of canceling the file operation can be sent to the target node according to the IP of the target node.
S2: and calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation.
Input representational state transfer (Representational State Transfer, REST) is a form of http requests between micro-services on nodes, is a style and manner of development of web applications, and can be defined using XML format or JSON format based on http. In a specific implementation, the REST interface is required to be called to issue an instruction of canceling the file operation input by the user to a target node executing the corresponding file operation, and after receiving the instruction of canceling the file operation, the target node directly cancels the current file operation by using a cancel method in a Future by a file management micro-service in the target node.
The embodiment provides a method for canceling file operation, which receives an instruction of canceling file operation input by a user and queries the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation; and calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation. Therefore, the method can send the instruction for canceling the file operation to the target node by calling the IP of the target node recorded in the schedule, and can realize canceling the file operation in a multi-copy scene, thereby reducing the waiting time of a user and server resources and improving the working efficiency of the user.
On the basis of the above-described embodiment, since the file operation of the target node has been canceled, it is necessary to clean up the data resulting from executing the file operation. The method comprises the following steps:
setting data obtained by the target node executing file operation as data to be deleted;
and deleting the data to be deleted.
Specifically, after the target node cancels the file operation, data obtained by performing the file operation is generated because the file operation has been performed for a while, and data obtained by performing the file operation needs to be deleted because the file operation has been cancelled. For example, if the file operation performed by the target node is an operation of copying a file, the data obtained by performing the file operation is partial data obtained by copying, and at this time, the partial data obtained by copying may be set as data to be deleted, and the data to be deleted may be deleted.
In this embodiment, the data obtained by executing the file operation by the target node is set as the data to be deleted, and the data to be deleted is deleted, so that the data obtained by executing the file operation is prevented from affecting the file operation executed next.
On the basis of the above embodiment, since the schedule records the schedule data of the target node executing the file operation, after the target node cancels the file operation, the corresponding schedule data in the schedule needs to be deleted. The method comprises the following steps: and deleting the progress data of the target node for executing the file operation from the progress table.
In a specific implementation, the target node executing the file operation may access the tool package of the file operation through its own file management micro service, and the tool package writes the progress data of the file operation into the schedule, so that the user may obtain the progress of executing the file operation by querying the schedule. Therefore, after the target node cancels the file operation, the progress data of the file operation written in advance in the progress table needs to be deleted, so that the user is prevented from misunderstanding that the instruction for canceling the file operation fails to execute.
On the basis of the above embodiment, in order to issue the instruction of canceling the file operation input by the user to the target node, a connection channel needs to be established with the target node, and the instruction of canceling the file operation is sent to the target node through the connection channel. The method comprises the following steps:
calling a REST interface to send a communication request to a target node according to the IP of the target node;
receiving a response of the communication request fed back by the target node;
and establishing a connection channel with the target node according to the response of the communication request, and sending an instruction for canceling the file operation to the target node through the connection channel.
Specifically, the target node may be found according to the IP of the target node queried from the schedule, and the REST interface may be invoked to send a communication request to the target node to communicate with the target node. After receiving the communication request, the target node feeds back the response of the communication request, so that a connection channel can be established with the target node according to the response of the communication request, and an instruction for canceling file operation can be sent to the target node through the connection channel. It should be noted that, the established connection channel is a short-connection network channel, and after the instruction of canceling the file operation is sent once, the connection channel will fail, so if the node canceling the file operation next time is the same node as the node canceling the file operation in advance, the instruction of canceling the file operation cannot be sent through the same connection channel, and the communication request needs to be sent again, so that the connection channel is established again.
The embodiment calls the REST interface to send a communication request to the target node, and establishes a connection channel with the target node according to the response of the communication request, so that an instruction for canceling file operation is sent to the target node through the connection channel, and communication with the target node is realized by constructing a network connection channel.
On the basis of the above embodiment, in order to prevent the failure of receiving the response of the communication request under the condition of poor network environment, that is, the failure of the communication request, a fault tolerance mechanism needs to be added, and if the response of the communication request fed back by the target node is not received within a preset time, the fault tolerance mechanism can be triggered to improve the fault tolerance capability. The method comprises the following steps:
triggering a timing task in the target node; the timing tasks comprise canceling file operation, deleting data to be deleted and deleting progress data of the target node for executing file operation.
Since the connection channel is a network channel, the transmission rate of the communication request is relatively fast, and therefore, the preset time should be in units of seconds, and in a specific implementation, the preset time may be set to 2s or 3s, which is not limited in this embodiment. Specifically, after the timing task of the target node is triggered, the file management micro-service on the target node invokes a cancel method to cancel the current file operation, and deletes the data obtained by executing the file operation, namely the data to be deleted and the progress data of the target node executing the file operation in the deletion schedule. It should be noted that, in the implementation, each node runs the timing task, so that when communication with any node fails, the current file operation executed by the node can be cancelled by the timing task on the node, thereby improving the fault tolerance.
On the basis of the above embodiment, in order to facilitate the user to grasp the progress of executing the file operation by the node, the display may be performed according to the progress data in the progress table. The method comprises the following steps:
and displaying the progress of the target node for executing the file operation according to the progress data of the target node for executing the file operation recorded in the progress table.
The method for displaying the progress of the file operation executed by the target node may be that the file operation is not executed when the progress bar is empty, and the file operation is executed when the progress bar is full, or may be that the file operation is not executed when the progress bar is full, and the method for displaying the progress percentage is that the file operation is not executed when the progress percentage is 0%, and the file operation is executed when the progress percentage is 100%. In a specific implementation, the progress of the target node for executing the file operation can be displayed according to the progress data of the target node for executing the file operation recorded in the progress table, so that a user can clearly grasp the progress of the target node for executing the file operation.
On the basis of the above embodiment, in order to facilitate the user to learn about the execution condition of each file operation, a log is recorded each time the file operation is executed and the file operation is cancelled, so that the user can learn whether the file operation is executed or cancelled according to the recorded log. The method comprises the following steps: and recording a log for executing the file operation and canceling the file operation.
Specifically, each time a file operation is executed and each time a file operation is canceled, a log is recorded, so that a user can learn about the execution condition of the file operation through the query log, and particularly when the user misoperation causes the file operation cancellation, the user can find the misoperation through the query log, and thus remedial measures such as re-executing the file operation which is canceled by mistake can be taken to reduce the influence on the file operation result.
In the above embodiments, the method for canceling the file operation is described in detail, and the present application further provides a corresponding embodiment of the apparatus for canceling the file operation. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
Fig. 3 is a block diagram of an apparatus for canceling file operations provided in the present application, as shown in fig. 3, where the apparatus includes:
the receiving module 10 is used for receiving an instruction of canceling file operation input by a user and inquiring the IP of the target node from the schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation;
and the calling module 11 is used for calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
According to the device for canceling file operation, which is provided by the embodiment, a receiving module receives an instruction for canceling file operation input by a user, and inquires the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation; and calling the REST interface through the calling module to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation. Therefore, the device can send the instruction for canceling the file operation to the target node by calling the IP of the target node recorded in the schedule, and can cancel the file operation in a multi-copy scene, so that the waiting time of a user and server resources are reduced, and the working efficiency of the user is improved.
FIG. 4 is a block diagram of another apparatus for canceling document operations provided in the present application, as shown in FIG. 4, the apparatus includes:
a memory 20 for storing a computer program;
a processor 21 for implementing the steps of the method of canceling a file operation as mentioned in the above embodiments when executing a computer program.
The device for canceling file operations provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 21 may include one or more processing cores, such as a four-core processor, an eight-core processor, or the like, among others. The processor 21 may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor 21 may also comprise a main processor, which is a processor for processing data in an awake state, also called central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with an image processor (Graphics Processing Unit, GPU) for taking care of rendering and rendering of the content that the display screen is required to display. In some embodiments, the processor 21 may also include an AI processor for processing computing operations related to machine learning.
Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing a computer program 201, which, when loaded and executed by the processor 21, is capable of implementing the relevant steps of the method for canceling a file operation disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202, data 203, and the like, where the storage manner may be transient storage or permanent storage. The operating system 202 may include Windows, unix, linux, among others. The data 203 may include, but is not limited to, the IP of the target node performing the file operation and the progress data of the target node performing the file operation, etc. recorded in the progress table.
In some embodiments, the device for canceling the file operation may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the structure shown in fig. 4 is not limiting of the means for canceling file operations and may include more or fewer components than shown.
The device for canceling file operation provided in this embodiment includes a memory and a processor, where the processor can implement the method for canceling file operation when executing a program stored in the memory.
Finally, the present application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method of canceling a file operation as described in the above method embodiments.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. With such understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the method described in the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The computer readable storage medium provided in this embodiment includes the above-mentioned method for canceling file operations, and the effects are the same.
The method, the device and the medium for canceling file operation provided by the application are described in detail above. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (6)

1. A method of canceling a file operation, comprising:
receiving an instruction of canceling file operation input by a user, and inquiring the IP of a target node from a schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation;
calling a REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation;
after the target node cancels the file operation, the method further comprises:
setting data obtained by the target node executing the file operation as data to be deleted;
deleting the data to be deleted;
deleting the progress data of the target node for executing the file operation from the progress table;
the step of calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node comprises the following steps:
calling the REST interface to send a communication request to the target node according to the IP of the target node;
receiving a response of the communication request fed back by the target node;
establishing a connection channel with the target node according to the response of the communication request, and sending an instruction for canceling the file operation to the target node through the connection channel;
if the response of the communication request fed back by the target node is not received within the preset time, the method further comprises the following steps:
triggering a timing task in the target node; the timing task comprises the steps of canceling the file operation, deleting the data to be deleted and deleting the progress data of the target node for executing the file operation.
2. The method of canceling a file operation of claim 1 further comprising, prior to said receiving user-entered instructions to cancel a file operation:
and displaying the progress of the target node for executing the file operation according to the progress data of the target node for executing the file operation recorded in the progress table.
3. The method of canceling a file operation of claim 1 further comprising:
recording a log for executing the file operation and canceling the file operation.
4. An apparatus for canceling a file operation, comprising:
the receiving module is used for receiving an instruction of canceling file operation input by a user and inquiring the IP of the target node from the schedule; the schedule is used for recording the IP of the target node executing the file operation and the schedule data of the target node executing the file operation;
the calling module is used for calling the REST interface to send an instruction for canceling the file operation to the target node according to the IP of the target node so that the target node cancels the file operation according to the instruction for canceling the file operation;
the setting module is used for setting data obtained by the target node executing the file operation as data to be deleted after the target node cancels the file operation;
the first deleting module is used for deleting the data to be deleted;
the second deleting module is used for deleting the progress data of the file operation executed by the target node from the progress table after the file operation is canceled by the target node;
the sending module is used for calling the REST interface to send a communication request to the target node according to the IP of the target node;
the receiving response module is used for receiving a response of the communication request fed back by the target node;
the establishing module is used for establishing a connection channel with the target node according to the response of the communication request and sending an instruction for canceling file operation to the target node through the connection channel;
the triggering module is used for triggering a timing task in the target node when a response of the communication request fed back by the target node is not received within a preset time; the timing tasks comprise canceling file operation, deleting data to be deleted and deleting progress data of the target node for executing file operation.
5. An apparatus for canceling a file operation, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of canceling a file operation of any one of claims 1 to 3 when executing said computer program.
6. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements the steps of the method of canceling a file operation as claimed in any one of claims 1 to 3.
CN202210612336.8A 2022-05-31 2022-05-31 Method, device and medium for canceling file operation Active CN114817166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210612336.8A CN114817166B (en) 2022-05-31 2022-05-31 Method, device and medium for canceling file operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210612336.8A CN114817166B (en) 2022-05-31 2022-05-31 Method, device and medium for canceling file operation

Publications (2)

Publication Number Publication Date
CN114817166A CN114817166A (en) 2022-07-29
CN114817166B true CN114817166B (en) 2024-01-12

Family

ID=82520107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210612336.8A Active CN114817166B (en) 2022-05-31 2022-05-31 Method, device and medium for canceling file operation

Country Status (1)

Country Link
CN (1) CN114817166B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104661275A (en) * 2014-12-11 2015-05-27 北京邮电大学 Method for transmitting data in opportunity network
CN107148617A (en) * 2014-09-19 2017-09-08 亚马逊科技公司 Automatically configuring for storage group is coordinated in daily record
CN110288317A (en) * 2019-06-24 2019-09-27 北京奇艺世纪科技有限公司 A kind of cancelling method of workflow, device, electronic equipment and medium
CN114281410A (en) * 2021-11-24 2022-04-05 北京金山云网络技术有限公司 Redis cluster proxy mode instruction response method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11151092B2 (en) * 2019-01-30 2021-10-19 Qumulo, Inc. Data replication in distributed file systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107148617A (en) * 2014-09-19 2017-09-08 亚马逊科技公司 Automatically configuring for storage group is coordinated in daily record
CN104661275A (en) * 2014-12-11 2015-05-27 北京邮电大学 Method for transmitting data in opportunity network
CN110288317A (en) * 2019-06-24 2019-09-27 北京奇艺世纪科技有限公司 A kind of cancelling method of workflow, device, electronic equipment and medium
CN114281410A (en) * 2021-11-24 2022-04-05 北京金山云网络技术有限公司 Redis cluster proxy mode instruction response method and device and electronic equipment

Also Published As

Publication number Publication date
CN114817166A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
US8458727B2 (en) Asynchronous client to server updates
US11526342B2 (en) Cancel and rollback update stack requests
CN107729139B (en) Method and device for concurrently acquiring resources
WO2021180025A1 (en) Message processing method and apparatus, electronic device and medium
US7949999B1 (en) Providing support for multiple interface access to software services
US10218775B2 (en) Methods for servicing web service requests using parallel agile web services and devices thereof
JP5936103B2 (en) System, computer, method and program for calling Java method on client
US7970814B2 (en) Method and apparatus for providing a synchronous interface for an asynchronous service
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
US8938522B2 (en) Tiered XML services in a content management system
US20180246949A1 (en) Early thread return with secondary event writes
CN114817166B (en) Method, device and medium for canceling file operation
CN107734050A (en) A kind of load machine distribution method, computing device and load machine distribution system
CN111966508A (en) Message batch sending method and device, computer equipment and storage medium
CN114327404A (en) File processing method and device, electronic equipment and computer readable medium
US20130198138A1 (en) Model for capturing audit trail data with reduced probability of loss of critical data
US20170031884A1 (en) Automated dependency management based on page components
CN114115897A (en) Method for dynamically generating project local executable file based on nodejs script
CN113961298A (en) Page switching method, device, equipment and medium
CN110598155A (en) Ajax request calling method and device, computer equipment and storage medium
US9122519B1 (en) Governor for elimination of repetitive requests
US20090313628A1 (en) Dynamically batching remote object model commands
US11422829B1 (en) Systems and methods for resilient service worker bridge
CN113094607B (en) Method and device for obtaining local resources
US11327802B2 (en) System and method for exporting logical object metadata

Legal Events

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