File transmission method, device, electronic device and storage medium

By adopting a distributed and decentralized point-to-point file transfer method in a cloud environment, the high maintenance cost and stability problems of source servers and central nodes in traditional methods are solved, and efficient and stable file transfer is achieved.

CN117201483BActive Publication Date: 2024-08-27BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311234748.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2024-08-27
Estimated Expiration
2043-09-22

AI Technical Summary

Technical Problem

In a cloud environment, traditional file transfer methods require independent maintenance of independent source servers and central nodes, resulting in high costs and bandwidth bottlenecks, affecting download efficiency and stability.

Method used

A distributed and decentralized point-to-point file transmission method is adopted. By selecting initial seed nodes in the cluster to download files in parallel and performing point-to-point transmission between nodes, bandwidth resources within the cluster are utilized to avoid single points of failure at the central node.

Benefits of technology

Maximize the use of bandwidth resources within the cluster, improve file download efficiency, reduce node load and data volume, and improve system stability and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117201483B
    Figure CN117201483B
Patent Text Reader

Abstract

The present disclosure provides a file transmission method, device, electronic device and storage medium, and relates to the field of computer technology, especially to the fields of cloud computing, big data, information flow, etc. The specific implementation scheme is: in response to determining that the target node of the cluster has obtained the file to be transmitted, obtaining information of the target file distribution task configured for the target node, the cluster also includes a downstream node of the target node, and the information of the target file distribution task includes a downstream node identifier of the downstream node; and in response to receiving a first execution instruction for executing the target file distribution task, sending the file to be transmitted to the downstream node according to the downstream node identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the fields of cloud computing, big data, information flow, and more specifically to a file transmission method, device, electronic device, and storage medium. Background Art

[0002] In a cloud environment, many businesses will operate and manage some very large clusters, such as the common Hadoop (a distributed system infrastructure) big data cluster with thousands of nodes. In this environment, there is often a need to download a file (deployment package, configuration file or data) from one machine or external environment to multiple machines in the cluster. Summary of the invention

[0003] The present disclosure provides a file transmission method, device, electronic device and storage medium.

[0004] According to one aspect of the present disclosure, a file transfer method is provided, comprising: in response to determining that a target node of a cluster has obtained a file to be transferred, obtaining information of a target file distribution task configured for the target node, the cluster also including a downstream node of the target node, the information of the target file distribution task including a downstream node identifier of the downstream node; and in response to receiving a first execution instruction for executing the target file distribution task, sending the file to be transferred to the downstream node according to the downstream node identifier.

[0005] According to another aspect of the present disclosure, a file transfer device is provided, including: a task information acquisition module, used to obtain information of a target file distribution task configured for the target node in response to determining that the target node of the cluster has obtained the file to be transferred, the cluster also including a downstream node of the target node, and the information of the target file distribution task includes a downstream node identifier of the downstream node; and a file sending module, used to send the file to be transferred to the downstream node according to the downstream node identifier in response to receiving a first execution instruction for executing the target file distribution task.

[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the file transfer method of the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the file transmission method of the present disclosure.

[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program is stored in at least one of a readable storage medium and an electronic device, and when the computer program is executed by a processor, the file transmission method of the present disclosure is implemented.

[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0011] Figure 1 An exemplary system architecture to which the file transmission method and device according to an embodiment of the present disclosure can be applied is schematically shown;

[0012] Figure 2 A flowchart of a file transmission method according to an embodiment of the present disclosure is schematically shown;

[0013] Figure 3 The exemplary structural diagram of the nodes in the cluster according to the embodiment of the present disclosure is schematically shown;

[0014] Figure 4 A schematic diagram schematically shows the processing logic of a file distribution task according to an embodiment of the present disclosure;

[0015] Figure 5 The overall flow chart of determining the task execution status of the current task according to an embodiment of the present disclosure is schematically shown;

[0016] Figure 6 A task state transition diagram of a single file distribution task or a task in a file distribution task group according to an embodiment of the present disclosure is schematically shown;

[0017] Figure 7 A block diagram schematically shows a file transmission device according to an embodiment of the present disclosure; and

[0018] Figure 8 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0020] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.

[0021] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0022] When a file needs to be downloaded from one machine or external environment to multiple machines in a cluster, it is usually achieved by building an independent source server or service cluster. Specifically, one or more nodes are selected as sources in the cluster, and multiple machines that need to download files download files from these sources in parallel at the same time, and a fixed central node is required to monitor the download status of each node.

[0023] In the process of implementing the disclosed concept, the inventors found that the above method requires the maintenance of an independent source server, which is costly, and the bandwidth of the source server can easily become a download bottleneck, resulting in a low efficiency of the entire download task. In addition, a fixed central node needs to be maintained, and the central node completes various operations during the file transfer process, which can easily become a stability bottleneck of this solution.

[0024] Figure 1 An exemplary system architecture to which the file transmission method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.

[0025] It should be noted that Figure 1 The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, the exemplary system architecture to which the file transfer method and apparatus can be applied may include a terminal device, but the terminal device may implement the file transfer method and apparatus provided by the embodiments of the present disclosure without interacting with the server.

[0026] like Figure 1As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0027] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).

[0028] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0029] The server 105 may be a server that provides various services, such as a background management server that provides support for the content browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (for example only). The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.

[0030] It should be noted that the file transmission method provided in the embodiment of the present disclosure can generally be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the file transmission device provided in the embodiment of the present disclosure can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103.

[0031] Alternatively, the file transmission method provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the file transmission device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The file transmission method provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the file transmission device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0032] For example, when a user reads an e-book online, the first terminal device 101, the second terminal device 102, and the third terminal device 103 can obtain the target content in the e-book pointed by the user's sight, and then send the obtained target content to the server 105, and the server 105 analyzes the target content to determine the characteristic information of the target content; predicts the content that the user is interested in based on the characteristic information of the target content; and extracts the content that the user is interested in. Alternatively, a server or server cluster that can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105 analyzes the target content and finally extracts the content that the user is interested in.

[0033] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0034] Figure 2 The flowchart of the file transmission method according to the embodiment of the present disclosure is schematically shown.

[0035] like Figure 2 As shown, the method includes operations S210 to S220.

[0036] In operation S210, in response to determining that the target node of the cluster has obtained the file to be transferred, information of the target file distribution task configured for the target node is obtained. The cluster also includes a downstream node of the target node, and the information of the target file distribution task includes a downstream node identifier of the downstream node.

[0037] In operation S220, in response to receiving a first execution instruction for executing a target file distribution task, the file to be transmitted is sent to a downstream node according to a downstream node identifier.

[0038] According to an embodiment of the present disclosure, file transmission can represent the process of downloading a transmission file from one node and sending it to another node. A cluster may include multiple nodes. When any node in the cluster receives a file to be transmitted, the node can be determined as a target node. A target file distribution task can represent the task of sending a file to be transmitted from a target node to a downstream node of the target node.

[0039] According to an embodiment of the present disclosure, when the file to be transmitted has not been sent to any node in the cluster, a batch of initial seed nodes can be selected in the cluster. Then, the file to be transmitted is downloaded in parallel from the file source of the file to be transmitted and sent to the initial seed node. The initial seed node that receives the file to be transmitted can be determined as the target node.

[0040] According to an embodiment of the present disclosure, when there are some target nodes in the cluster that have obtained the file to be transmitted, each target node can be converted into a seed node to continue to provide downloads of the file to be transmitted to the downstream nodes of the target node. The downstream node that receives the file to be transmitted can continue to be determined as the target node. In this case, starting from any target node, by executing the target file distribution task, point-to-point file transmission can be performed within the cluster until all nodes in the cluster have obtained the file to be transmitted and the task is completed.

[0041] Through the above-mentioned embodiments of the present disclosure, a distributed and decentralized diffuse point-to-point file transmission method is realized. Since point-to-point transmission is implemented in a cluster, it can maximize the use of bandwidth resources in the cluster and realize the download of a file on multiple machines, which is conducive to the rapid completion of file download tasks.

[0042] In conjunction with specific embodiments, Figure 2 The method shown is further explained.

[0043] According to an embodiment of the present disclosure, before performing the above operation S210, it is necessary to first determine the target file distribution task configured by the target node. The method may include: in response to receiving a file transfer instruction representing the distribution of a file to be transferred to a cluster, generating a target file distribution task according to the file transfer information represented by the file transfer instruction. Sending the information of the target file distribution task to a second external storage unit connected to each node of the cluster, so that the information of the target file distribution task is sent to the node of the cluster through the second external storage unit.

[0044] According to the embodiments of the present disclosure, the machine nodes in the cluster are named as Peers, and the machines can be in a peer relationship with each other, and there is no centralized node. JobScheduler (job scheduler) and TaskExecutor (task executor) and other components can be normally deployed on each Peer. JobScheduler and TaskExecutor are designed as stateless components, and JobScheduler and TaskExecutor and other components of different Peers will not perceive each other. The second external storage unit can be used to realize information synchronization between peers that do not perceive each other.

[0045] Figure 3 An exemplary structural diagram of nodes in a cluster according to an embodiment of the present disclosure is schematically shown.

[0046] like Figure 3 As shown, cluster 300 includes a first Peer 310, a second Peer 320, a third Peer 330, and a fourth Peer 340. JobScheduler 301 can represent a JobScheduler deployed for any Peer (not shown in the specific structure of each Peer). Corresponding to the first Peer 310, the second Peer 320, the third Peer 330, and the fourth Peer 340, a first TaskExecutor 311, a second TaskExecutor 321, a third TaskExecutor 331, and a fourth TaskExecutor 341 are also deployed respectively. External storage 303 can represent the above-mentioned second external storage unit.

[0047] For example, JobScheduler 301 may represent the JobScheduler in the first Peer 310. When each Peer in the cluster 300 has not obtained the file to be transferred, and JobScheduler 301 receives a file transfer instruction representing a file transfer job 302 of distributing the file to be transferred to the cluster, JobScheduler 301 may, in response to receiving the file transfer instruction, decompose the file transfer job 302 into multiple file distribution tasks according to the file transfer information, such as Figure 3 The plurality of file distribution tasks 304 in the storage medium can be synchronized to the first Peer 310, the second Peer 320, the third Peer 330, the fourth Peer 340 and other Peers through the external storage 303.

[0048] According to an embodiment of the present disclosure, there may be multiple target file distribution tasks generated, and information of the multiple target file distribution tasks may be sent to each node of the cluster. For example, the first TaskExecutor 311, the second TaskExecutor 321, the third TaskExecutor 331, and the fourth TaskExecutor 341 may all obtain the multiple file distribution tasks.

[0049] According to an embodiment of the present disclosure, TaskExecutor can execute the corresponding file distribution task in response to receiving an execution instruction for executing the file distribution task. For example, in response to receiving an execution instruction for executing the file distribution task in the second Peer 320, the second TaskExecutor 321 is used to execute the file distribution task in the second Peer 320.

[0050] Through the above-mentioned embodiments of the present disclosure, by configuring the second external storage unit, it is possible to make each node in the cluster independent of each other, to realize the decentralization of the cluster, and to achieve flexible horizontal expansion.

[0051] According to an embodiment of the present disclosure, a cluster may include a first node and a second node. The file transfer information may include a first node identifier of the first node and a second node identifier of the second node. Generating a target file distribution task according to the file transfer information represented by the file transfer instruction may include: generating a target file distribution task with the first node as a source node and the second node as a destination node according to the first node identifier and the second node identifier.

[0052] According to an embodiment of the present disclosure, when there are multiple nodes in a cluster, one node can be randomly determined as the first node, and another node can be randomly determined as the second node. In the process of generating a target file distribution task, which of the first node and the second node is the source node and which node is the destination node can also be randomly determined, which is not limited here.

[0053] For example, see Figure 3 , the file transmission information may include the first node identifier Peer_id1 of the first Peer 310, the second node identifier Peer_id2 of the second Peer 320, the third node identifier Peer_id3 of the third Peer 330, and the fourth node identifier Peer_id4 of the fourth Peer 340. A target file distribution task may be generated with Peer_id1 as the source node and Peer_id3 as the destination node. Another target file distribution task may be generated with Peer_id2 as the source node and Peer_id4 as the destination node.

[0054] It should be noted that when determining the target file distribution task based on the above method, since the specific storage address to which the file to be transmitted is sent to each node is not defined, a pre-storage address can be pre-defined in each node to achieve that when the node obtains the file to be transmitted, the file to be transmitted is stored in the pre-storage address.

[0055] According to an embodiment of the present disclosure, the file transfer information may also include a target storage address of the file to be transferred. The above-mentioned generating a target file distribution task according to the file transfer information represented by the file transfer instruction may also include: generating a target file distribution task with the first node as the source node, the second node as the destination node, and the target storage address in the second node as the file storage address of the file to be transferred according to the first node identifier, the second node identifier and the target storage address.

[0056] According to an embodiment of the present disclosure, since the obtained target file distribution task includes the target storage address of the file to be transmitted, the file to be transmitted can be directly stored in the target storage address of the destination node during the process of transmitting the file to be transmitted from the source node to the destination node.

[0057] According to an embodiment of the present disclosure, sending the target file distribution task to the node of the cluster may include: according to the source node identifier of the source node of the target file distribution task, sending the target file distribution task to the node corresponding to the source node identifier.

[0058] According to an embodiment of the present disclosure, after determining multiple target file distribution tasks, first, based on the source node identifier of the target file distribution task, tasks that are transmitted to other nodes with the current node as the source can be filtered out from the multiple target file distribution tasks. Then, such tasks are sent to the current node.

[0059] For example, see Figure 3 As in the above embodiment, the target file distribution task with Peer_id1 as the source node and Peer_id3 as the destination node can be sent only to the first Peer 310. The target file distribution task with Peer_id2 as the source node and Peer_id4 as the destination node can be sent only to the second Peer 320.

[0060] Through the above embodiments of the present disclosure, the amount of data in the nodes in the cluster can be reduced and the load on the nodes can be alleviated.

[0061] According to the embodiment of the present disclosure, JobScheduler, as a dispatching component of file transfer work, needs to perceive the completion of file transfer work according to the status of file distribution task. Therefore, TaskExecutor can synchronize the status of file distribution task to JobScheduler through external storage at regular intervals.

[0062] Based on this, the above-mentioned file transfer method may also include: in response to determining that the current moment reaches the predefined moment, determining the target task execution status information of the target file distribution task. Sending the target task execution status information to a first external storage unit connected to each node of the cluster, so that the target task execution status information is sent to each node of the cluster through the first external storage unit.

[0063] According to an embodiment of the present disclosure, a timing operation may be performed in advance to determine whether the current time has reached a predefined time. The first external storage unit may have the same or similar technical features as the second external storage unit, which will not be described in detail herein.

[0064] According to an embodiment of the present disclosure, the target task execution status information may include any one of the following: init (initialization), waiting (waiting), running (executing), fail (execution failed and not completed), done (execution successful), faildone (execution failed and completed). Init may indicate that the task is initialized and has not yet been claimed by TaskExecutor. Waiting may indicate that TaskExecutor has claimed the task but is waiting for the upstream task to execute. Running may indicate that TaskExecutor is executing the task and transferring the file to other nodes. Done may indicate that the file transfer is complete and the task is executed successfully. Fail may indicate that the file transfer failed and the task execution failed, but because there is a retry mechanism, the task has not ended. Faildone may indicate that the task failed and the maximum number of retries was reached, and the task execution ended in a failed state.

[0065] It should be noted that a file distribution task can have a fixed upstream task. If and only if the upstream task is successfully executed and the file is successfully downloaded to the node, the node can execute the file distribution task with itself as the source and continue to distribute the file to other nodes.

[0066] Through the above embodiments of the present disclosure, the target task execution status information in each node can be updated regularly, which is conducive to the efficient and stable operation of the cluster. In addition, all state synchronization is achieved through external storage, which can achieve flexible horizontal scalability.

[0067] According to an embodiment of the present disclosure, TaskExecutor may include two stages when executing a file distribution task. The first stage is to synchronize the upstream task status. TaskExecutor needs to wait until the upstream task of the current file distribution task is completed before entering the second stage to execute the current task.

[0068] Figure 4 The following is a schematic diagram schematically showing the processing logic of a file distribution task according to an embodiment of the present disclosure.

[0069] like Figure 4 As shown, for example, the first file distribution task 401 may represent the tasks of the upstream nodes of the second file distribution task 402 and the third file distribution task 403. The second file distribution task 402 may represent the tasks of the upstream nodes of the fourth file distribution task 404 and the fifth file distribution task 405. The third file distribution task 403 may represent the tasks of the upstream nodes of the sixth file distribution task 406 and the seventh file distribution task 407. For these file distribution tasks, the file distribution tasks of the child nodes under each upstream node may be executed only after the tasks of each upstream node are successfully executed.

[0070] According to an embodiment of the present disclosure, the cluster may further include an upstream node of the target node. The above-mentioned determination of the target task execution status information of the target file distribution task may include: obtaining the upstream task execution status information of the upstream file distribution task configured for the upstream node. In response to determining that the upstream task execution status information indicates that the execution is not completed, the upstream task execution status information is read again after a preset time interval. In response to determining that the upstream task execution status information indicates that the execution is successful, the target task execution status information is updated to being executed.

[0071] According to an embodiment of the present disclosure, init, waiting, running, and fail may indicate that the execution is not completed. Done may indicate that the execution is successful.

[0072] For example, see Figure 4 When it is determined that the status of the first file distribution task 401 is any one of init, waiting, running, and fail, at least one of the TaskExecutor used to control the second file distribution task 402 and the TaskExecutor used to control the third file distribution task 403 can check the status of the first file distribution task 401 again after sleeping for a preset time interval until the execution of the first file distribution task 401 is completed.

[0073] According to an embodiment of the present disclosure, done and faildone can both indicate the end of execution.

[0074] For example, see Figure 4 When the status of the first file distribution task 401 is done, the second file distribution task 402 and the third file distribution task 403 can both enter the running state, and the status of the second file distribution task 402 and the status of the third file distribution task 403 can be updated to running, and the file transfer is started to execute the second file distribution task 402 and the third file distribution task 403.

[0075] According to an embodiment of the present disclosure, the above-mentioned determining the target task execution status information of the target file distribution task may also include: in response to determining that the upstream task execution status information indicates execution failure, updating the target task execution status information to execution failure.

[0076] For example, see Figure 4 , when the status of the second file distribution task 402 is faildone, it means that the second file distribution task 402 has failed to execute, and the fourth file distribution task 404 and the fifth file distribution task 405 located downstream of the second file distribution task 402 cannot continue to execute, and the status of the fourth file distribution task 404 and the status of the fifth file distribution task 405 can be updated to faildone. In this case, the second file distribution task 402, the status of the fourth file distribution task 404, and the fifth file distribution task 405 are all executed and ended in a failed state.

[0077] According to an embodiment of the present disclosure, the above-mentioned determining the target task execution status information of the target file distribution task may also include: in response to determining that the number of retries of the target file distribution task is equal to a preset number, updating the target task execution status information to execution failure.

[0078] For example, see Figure 4 When the third file distribution task 403 fails to execute and the number of retries has reached a preset number, the status of the third file distribution task 403 can be updated to faildone.

[0079] According to an embodiment of the present disclosure, the above-mentioned number of retries can be determined by the following method: in response to determining that the target file distribution task has failed to execute and determining that the number of retries is less than a preset number, a second execution instruction for re-executing the target file distribution task is generated, and the number of retries is increased by 1, and the initial value of the number of retries is 0.

[0080] According to the implementation of the present disclosure, each file distribution task may have a corresponding number of retries. When each file distribution task is started, the value of the number of retries corresponding to the file distribution task may be initialized to 0.

[0081] For example, see Figure 4 When the state of the third file distribution task 403 is changed to running, the value of the number of retries corresponding to the third file distribution task 403 may be initialized to 0. When the third file distribution task 403 fails to execute, the value of the number of retries corresponding to the third file distribution task 403 may be increased by 1, and a second execution instruction may be generated to re-execute the third file distribution task 403.

[0082] According to an embodiment of the present disclosure, the above-mentioned number of retries can also be determined by the following method: according to the start time and current time of the target file distribution task, determine the single execution duration of the target file distribution task. In response to determining that the single execution duration reaches the preset duration and determining that the number of retries is less than the preset number, generate a third execution instruction for re-executing the target file distribution task, and increase the number of retries by 1.

[0083] According to an embodiment of the present disclosure, a task may time out on a node due to some abnormal reasons. In this case, when the TaskExecutor of the node converts the task from waiting to running, it can write the start time of the task into the task execution status. When the task execution time exceeds the set timeout threshold parameter, TaskExecutor can restart the execution of the task and increase the number of retries by 1.

[0084] Through the above disclosed embodiments, a timeout retry mechanism is provided, which can effectively handle the problem of timeout in the execution of file distribution tasks, and alleviate the problem that the file transfer work cannot be completed for a long time due to task timeout.

[0085] Figure 5 An overall flow chart of determining the task execution status of the current task according to an embodiment of the present disclosure is schematically shown.

[0086] like Figure 5 As shown, the method includes operations S501 to S511.

[0087] In operation S501, an upstream task upstreamTask is obtained.

[0088] In operation S502, it is determined whether upstreamTask.Status (the status of the upstream task) == 'init'|| 'waiting'|| "running'|| 'fail' is established? If so, operation S503 is executed; if not, operation S504 is executed.

[0089] In operation S503, sleep for a while.

[0090] In operation S504, it is determined whether upstreamTask.Status == 'faildone' is established. If so, operation S505 is executed; if not, operation S506 is executed.

[0091] In operation S505, the current task status is updated to 'faildone'.

[0092] In operation S506, it is determined whether upstreamTask.Status=='done' is established. If so, operation S507 is executed; if not, operation S505 is executed.

[0093] In operation S507, file transmission is performed.

[0094] In operation S508, it is determined whether the execution is successful. If so, operation S509 is executed; if not, operation S510 is executed.

[0095] In operation S509, the current task status is updated to 'done'.

[0096] In operation S510, it is determined whether the maximum number of retries has been reached. If so, operation S505 is executed; if not, operation S511 is executed.

[0097] In operation S511, the current task status is updated to 'fail'.

[0098] Through the above-mentioned embodiments of the present disclosure, orderly and correct execution of various file distribution tasks can be achieved, and higher execution efficiency and better file transmission effect can be achieved.

[0099] According to the embodiments of the present disclosure, in actual scenarios, there may be multiple file transfer jobs running at the same time. In this case, there may be multiple tasks writing to the same file path at the same time. Corresponding to this situation, the problem of task mutual exclusion in this scenario also needs to be considered.

[0100] According to an embodiment of the present disclosure, a target file distribution task may include multiple file distribution tasks generated at multiple times. The above-mentioned determination of the target task execution status information of the target file distribution task may include: according to the task execution path information of each of the multiple file distribution tasks, assigning the file distribution tasks with the same task execution path to the same file distribution task group. According to the preset rules defined for the same file distribution task group, determining the task execution status of the file distribution tasks in the same file distribution task group, the preset rules being rules defined according to the mutual exclusion mechanism.

[0101] According to an embodiment of the present disclosure, the task execution path can be determined based on the source node, destination node, and target storage path in the information of the file distribution task. When the source node, destination node, and target storage path in the information of multiple file distribution tasks are the same, it can be determined that the task execution paths of the multiple file distribution tasks are the same, and the multiple file distribution tasks can be assigned to the same file distribution task group.

[0102] According to an embodiment of the present disclosure, the preset rules determined based on the mutual exclusion mechanism may include any at least one of the following: There can be at most one task in the running state in the same group, referred to as Rule 1. If there is a task in the running state in a group, then the waiting state tasks generated before the generation time of the running state task in this group are updated to the ignored state, indicating that the execution is skipped, referred to as Rule 2. If the upstream task status of a task is ignored, then the actual status of the task should be the final execution status of the running task in the same group that triggered the task to change to ignored, referred to as Rule 3.

[0103] It should be noted that the above preset rules are only exemplary embodiments, but are not limited thereto, and may also include other preset rules that can be determined based on a mutual exclusion mechanism in the art, which are not limited here.

[0104] According to an embodiment of the present disclosure, when multiple file distribution tasks executed on the same Peer write to the same target path, the multiple file distribution tasks are assigned to the same file distribution task group, and preset rules are defined for the same file distribution task group based on a mutual exclusion mechanism. In the process of determining the task execution status of the file distribution tasks in the same file distribution task group based on the preset rules, TaskExecutor can determine the task execution status of each file distribution task in the same file distribution task group through the mutual exclusion mechanism, and can ensure the correctness of the final execution result.

[0105] It should be noted that the above method for determining the status of a file distribution task is only used to determine the status of a file distribution task within a group. The status of any single file distribution task outside the file distribution task group can be determined based on the above method for determining the task execution status of a single file distribution task, which will not be repeated here.

[0106] Through the above embodiments of the present disclosure, the correctness of the final execution result can be guaranteed through the mutual exclusion mechanism.

[0107] According to an embodiment of the present disclosure, corresponding to the above rule 1, the preset rule may include: the task execution status information of at most one file distribution task in the same file distribution task group indicates that it is being executed.

[0108] Through the above-mentioned embodiments of the present disclosure, when multiple file distribution tasks executed on the same peer write to the same target path, the problem of simultaneous writing can be avoided based on the rule.

[0109] According to an embodiment of the present disclosure, the same file distribution task group may include a first file distribution task generated at a first moment and a second file distribution task generated at a second moment. Corresponding to the above rule 2, according to the preset rule defined for the same file distribution task group, determining the task execution status of the file distribution tasks in the same file distribution task group may include: in response to determining that the first task execution status information of the first file distribution task indicates that it is being executed and the first moment is later than the second moment, updating the second task execution status information of the second file distribution task to an ignored state representing skipping execution.

[0110] According to an embodiment of the present disclosure, when the status of the first file distribution task and the second file distribution task are both waiting, the status of the first file distribution task generated most recently (and at the first moment) can be updated to running according to the first moment and the second moment. Then, the status of the second file distribution task can be updated to ignored.

[0111] Through the above-mentioned embodiments of the present disclosure, repeated execution can be avoided and the occurrence of file transmission errors can be effectively reduced.

[0112] According to an embodiment of the present disclosure, corresponding to the above rule three, the above-mentioned determining the task execution status of the file distribution task in the same file distribution task group according to the preset rule defined for the same file distribution task group may also include: in response to determining that the first task execution status information indicates a successful execution, updating the second task execution status information to a successful execution. In response to determining that the first task execution status information indicates a failed execution, updating the second task execution status information to a failed execution.

[0113] Figure 6 The task state transition diagram of a single file distribution task or a task in a file distribution task group according to an embodiment of the present disclosure is schematically shown.

[0114] like Figure 6 As shown, init can represent the initial state of each file distribution task after it is generated. Based on the operation of TaskExecutor obtaining tasks, the file distribution task can be obtained by TaskExecutor, and the state of the file distribution task can be updated to waiting.

[0115] When a file distribution task group is created with a file distribution task in the waiting state, and TaskExecutor determines that there is an updated task in the group, the state of the file distribution task in the waiting state can be updated to ignored.

[0116] Based on the operation scheduled and executed by TaskExecutor, the file distribution task can be started, and the state of the file distribution task in the waiting state can be updated to running.

[0117] When the file distribution task in the running state is executed successfully, the state of the file distribution task in the running state may be updated to done.

[0118] When a file distribution task in the running state fails to execute or times out, the state of the file distribution task in the running state may be updated to fail.

[0119] When TaskExecutor determines that the number of retries of the file distribution task in the failed state has been exhausted, the state of the file distribution task in the failed state may be updated to faildone.

[0120] When TaskExecutor determines that the number of retries of the file distribution task in the failed state has not been exhausted, the state of the file distribution task in the failed state may be updated to waiting.

[0121] When TaskExecutor determines that there is an updated task in the group, the status of the file distribution task in the fail state may be updated to ignored.

[0122] Through the above-mentioned embodiments of the present disclosure, by introducing the new file distribution task state ignored and the concept of file distribution task group, combined with the processing of preset rules, the problem of mutual exclusion of file distribution tasks can be solved. The introduction of the ignored mechanism can effectively improve the file distribution performance of hot paths, especially in the scenario of node downtime recovery, which can effectively improve the file distribution performance in this scenario.

[0123] According to the embodiments of the present disclosure, the above-mentioned file transmission method of the present disclosure can be applied to large-scale cluster scenarios of business operation and maintenance, including batch installation of software, updating of services, distribution of configurations, etc. on the cluster. It can effectively improve the execution efficiency in such scenarios, maximize the use of cluster resources and reduce execution time.

[0124] Figure 7A block diagram of a file transmission device according to an embodiment of the present disclosure is schematically shown.

[0125] like Figure 7 As shown, the file transmission device 700 includes a task information acquisition module 710 and a file sending module 720 .

[0126] The task information acquisition module 710 is used to obtain the information of the target file distribution task configured for the target node in response to determining that the target node of the cluster has obtained the file to be transferred. The cluster also includes the downstream node of the target node, and the information of the target file distribution task includes the downstream node identifier of the downstream node.

[0127] The file sending module 720 is used to send the file to be transmitted to the downstream node according to the downstream node identifier in response to receiving the first execution instruction for executing the target file distribution task.

[0128] According to an embodiment of the present disclosure, the file transmission device further includes a status determination module and a status information sending module.

[0129] The state determination module is used to determine the target task execution state information of the target file distribution task in response to determining that the current time has reached the predefined time.

[0130] The status information sending module is used to send the target task execution status information to the first external storage unit connected to each node of the cluster, so as to send the target task execution status information to each node of the cluster through the first external storage unit.

[0131] According to an embodiment of the present disclosure, the target file distribution task includes multiple file distribution tasks generated at multiple times. The state determination module includes a task group allocation submodule and a state determination submodule.

[0132] The task group allocation submodule is used to allocate file distribution tasks with the same task execution path to the same file distribution task group according to the task execution path information of each of the multiple file distribution tasks.

[0133] The state determination submodule is used to determine the task execution state of the file distribution tasks in the same file distribution task group according to the preset rules defined for the same file distribution task group, and the preset rules are rules defined according to the mutual exclusion mechanism.

[0134] According to an embodiment of the present disclosure, the preset rule includes: the task execution status information of at most one file distribution task in the same file distribution task group indicates that it is being executed.

[0135] According to an embodiment of the present disclosure, the same file distribution task group includes a first file distribution task generated at a first moment and a second file distribution task generated at a second moment. The state determination submodule includes a first state updating unit.

[0136] The first status updating unit is configured to update the second task execution status information of the second file distribution task to an ignore status indicating skipping execution in response to determining that the first task execution status information of the first file distribution task indicates being executed and the first time is later than the second time.

[0137] According to an embodiment of the present disclosure, the state determination submodule further includes a second state updating unit and a third state updating unit.

[0138] A second status updating unit, configured to update the second task execution status information to execution success in response to determining that the first task execution status information indicates execution success; and

[0139] The third status updating unit is configured to update the second task execution status information to execution failure in response to determining that the first task execution status information indicates execution failure.

[0140] According to an embodiment of the present disclosure, the cluster further includes an upstream node of the target node. The state determination module includes an upstream state acquisition submodule, an upstream state reading submodule and a first state update submodule.

[0141] The upstream status acquisition submodule is used to obtain the upstream task execution status information of the upstream file distribution task configured for the upstream node.

[0142] The upstream status reading submodule is used to read the upstream task execution status information again after a preset time interval in response to determining that the upstream task execution status information indicates that the execution is not completed.

[0143] The first status update submodule is configured to update the target task execution status information to being executed in response to determining that the upstream task execution status information indicates successful execution.

[0144] According to an embodiment of the present disclosure, the state determination module further includes a second state update submodule.

[0145] The second status update submodule is configured to update the target task execution status information to execution failure in response to determining that the upstream task execution status information indicates execution failure.

[0146] According to an embodiment of the present disclosure, the state determination module includes a third state update submodule.

[0147] The third status update submodule is used to update the target task execution status information to execution failure in response to determining that the number of retries of the target file distribution task is equal to a preset number of times.

[0148] According to an embodiment of the present disclosure, the file transfer device further includes a first retry submodule.

[0149] The first retry submodule is used to generate a second execution instruction for re-executing the target file distribution task in response to determining that the target file distribution task fails to execute and determining that the number of retries is less than a preset number, and increase the number of retries by 1, and the initial value of the number of retries is 0.

[0150] According to an embodiment of the present disclosure, the file transmission device further includes a task duration determination submodule and a second retry submodule.

[0151] The task duration determination submodule is used to determine the single execution duration of the target file distribution task according to the start time and current time of the target file distribution task.

[0152] The second retry submodule is used to generate a third execution instruction for re-executing the target file distribution task in response to determining that the single execution duration reaches the preset duration and the number of retries is less than the preset number, and increase the number of retries by 1.

[0153] According to an embodiment of the present disclosure, the file transmission device further includes a task generating module and a task information sending module.

[0154] The task generation module is used to generate a target file distribution task in response to receiving a file transfer instruction representing the distribution of a file to be transferred to a cluster and according to the file transfer information represented by the file transfer instruction.

[0155] The task information sending module is used to send the information of the target file distribution task to the second external storage unit connected to each node of the cluster, so as to send the information of the target file distribution task to the nodes of the cluster through the second external storage unit.

[0156] According to an embodiment of the present disclosure, the cluster includes a first node and a second node, and the file transfer information includes a first node identifier of the first node and a second node identifier of the second node. The task generation module includes a first task generation submodule.

[0157] The first task generation submodule is used to generate a target file distribution task with the first node as a source node and the second node as a destination node according to the first node identifier and the second node identifier.

[0158] According to an embodiment of the present disclosure, the file transmission information further includes a target storage address of the file to be transmitted. The task generation module further includes a second task generation submodule.

[0159] The second task generation submodule is used to generate a target file distribution task with the first node as the source node, the second node as the destination node, and the target storage address in the second node as the file storage address of the file to be transmitted according to the first node identifier, the second node identifier and the target storage address.

[0160] According to an embodiment of the present disclosure, the task information sending module includes a task information sending submodule.

[0161] The task information sending submodule is used to send the target file distribution task to the node corresponding to the source node identifier according to the source node identifier of the source node of the target file distribution task.

[0162] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0163] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the file transfer method of the present disclosure.

[0164] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the file transmission method of the present disclosure.

[0165] According to an embodiment of the present disclosure, a computer program product includes a computer program, wherein the computer program is stored in at least one of a readable storage medium and an electronic device, and when the computer program is executed by a processor, the file transmission method of the present disclosure is implemented.

[0166] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0167] like Figure 8As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0168] A number of components in the device 800 are connected to an input / output (I / O) interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0169] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a file transfer method. For example, in some embodiments, the file transfer method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the file transfer method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the file transfer method in any other appropriate manner (e.g., by means of firmware).

[0170] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0171] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0172] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0173] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0174] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0175] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.

[0176] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0177] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A file transmission method, comprising: In response to receiving a file transfer instruction representing the distribution of a file to be transferred to a cluster, generating a target file distribution task according to the file transfer information represented by the file transfer instruction; Sending the target file distribution task information to a second external storage unit connected to each node of the cluster, so as to send the target file distribution task information to the nodes of the cluster through the second external storage unit; In response to determining that a target node of the cluster has obtained a file to be transferred, obtaining information of a target file distribution task configured for the target node, the cluster further comprising a downstream node of the target node, the information of the target file distribution task comprising a downstream node identifier of the downstream node; as well as In response to receiving a first execution instruction for executing the target file distribution task, the file to be transmitted is sent to the downstream node according to the downstream node identifier.

2. The method according to claim 1, further comprising: In response to determining that the current time has reached the predefined time, determining target task execution state information of the target file distribution task; as well as The target task execution status information is sent to a first external storage unit connected to each node of the cluster, so that the target task execution status information is sent to each node of the cluster through the first external storage unit.

3. The method according to claim 2, wherein: The target file distribution task includes multiple file distribution tasks generated at multiple times; the target task execution status information for determining the target file distribution task includes: According to the task execution path information of each of the plurality of file distribution tasks, the file distribution tasks having the same task execution path are assigned to the same file distribution task group; and According to a preset rule defined for the same file distribution task group, the task execution status of the file distribution task in the same file distribution task group is determined, and the preset rule is a rule defined according to a mutual exclusion mechanism.

4. The method according to claim 3, wherein: The preset rule includes: the task execution status information of at most one file distribution task in the same file distribution task group indicates that it is being executed.

5. The method according to claim 3 or 4, wherein: The same file distribution task group includes a first file distribution task generated at a first moment and a second file distribution task generated at a second moment; and determining the task execution status of the file distribution tasks in the same file distribution task group according to a preset rule defined for the same file distribution task group includes: In response to determining that the first task execution status information of the first file distribution task indicates being executed and the first time is later than the second time, the second task execution status information of the second file distribution task is updated to an ignore state indicating skipping execution.

6. The method according to claim 5, wherein: The determining, according to a preset rule defined for the same file distribution task group, the task execution status of the file distribution tasks in the same file distribution task group further comprises: In response to determining that the first task execution status information indicates execution success, updating the second task execution status information to execution success; and In response to determining that the first task execution status information indicates execution failure, the second task execution status information is updated to execution failure.

7. The method according to claim 2, wherein: The cluster also includes an upstream node of the target node; the target task execution status information for determining the target file distribution task includes: Acquire upstream task execution status information of the upstream file distribution task configured for the upstream node; In response to determining that the upstream task execution status information indicates that the execution is not completed, reading the upstream task execution status information again after a preset time interval; and In response to determining that the upstream task execution status information indicates successful execution, the target task execution status information is updated to being executed.

8. The method according to claim 7, wherein: The determining of the target task execution status information of the target file distribution task also includes: In response to determining that the upstream task execution status information indicates execution failure, the target task execution status information is updated to execution failure.

9. The method according to claim 2, 7 or 8, wherein: The target task execution status information of the target file distribution task is determined as follows: In response to determining that the number of retries of the target file distribution task is equal to a preset number, the target task execution status information is updated to execution failure.

10. The method according to claim 9, further comprising: In response to determining that the number of retries of the target file distribution task is equal to the preset number, before updating the target task execution status information to execution failure, In response to determining that the target file distribution task fails to execute and determining that the number of retries is less than the preset number, a second execution instruction for re-executing the target file distribution task is generated, and the number of retries is increased by 1, and the initial value of the number of retries is 0.

11. The method according to claim 9, further comprising: In response to determining that the number of retries of the target file distribution task is equal to the preset number, before updating the target task execution status information to execution failure, Determining a single execution duration of the target file distribution task according to the start time of the target file distribution task and the current time; as well as In response to determining that the single execution duration reaches a preset duration and determining that the number of retries is less than the preset number, a third execution instruction for re-executing the target file distribution task is generated, and the number of retries is increased by 1.

12. The method according to claim 1, wherein: The cluster includes a first node and a second node, and the file transfer information includes a first node identifier of the first node and a second node identifier of the second node; Generating the target file distribution task according to the file transfer information represented by the file transfer instruction includes: A target file distribution task is generated according to the first node identifier and the second node identifier, with the first node being a source node and the second node being a destination node.

13. The method according to claim 12, wherein: The file transfer information also includes a target storage address of the file to be transferred; and generating the target file distribution task according to the file transfer information represented by the file transfer instruction also includes: According to the first node identifier, the second node identifier and the target storage address, a target file distribution task is generated with the first node as the source node, the second node as the destination node, and the target storage address in the second node as the file storage address of the file to be transferred.

14. The method according to claim 12 or 13, wherein: The step of sending the target file distribution task information to the nodes of the cluster includes: According to the source node identifier of the source node of the target file distribution task, the target file distribution task is sent to a node corresponding to the source node identifier.

15. A file transmission device, comprising: A task generation module, configured to generate a target file distribution task in response to receiving a file transfer instruction representing the distribution of a file to be transferred to a cluster, according to the file transfer information represented by the file transfer instruction; A task information sending module, used to send the information of the target file distribution task to a second external storage unit connected to each node of the cluster, so as to send the information of the target file distribution task to the nodes of the cluster through the second external storage unit; A task information acquisition module, configured to, in response to determining that a target node of a cluster has obtained a file to be transferred, acquire information of a target file distribution task configured for the target node, wherein the cluster further includes a downstream node of the target node, and the information of the target file distribution task includes a downstream node identifier of the downstream node; as well as The file sending module is used for sending the file to be transmitted to the downstream node according to the downstream node identifier in response to receiving a first execution instruction for executing the target file distribution task.

16. The apparatus according to claim 15, further comprising: A state determination module, configured to determine target task execution state information of the target file distribution task in response to determining that the current time has reached a predefined time; as well as The status information sending module is used to send the target task execution status information to a first external storage unit connected to each node of the cluster, so as to send the target task execution status information to each node of the cluster through the first external storage unit.

17. The device according to claim 16, wherein: The target file distribution task includes multiple file distribution tasks generated at multiple times; the state determination module includes: a task group allocation submodule, configured to allocate the file distribution tasks having the same task execution path to the same file distribution task group according to the task execution path information of each of the plurality of file distribution tasks; and The state determination submodule is used to determine the task execution state of the file distribution task in the same file distribution task group according to the preset rules defined for the same file distribution task group, and the preset rules are rules defined according to the mutual exclusion mechanism.

18. The device according to claim 17, wherein: The preset rule includes: the task execution status information of at most one file distribution task in the same file distribution task group indicates that it is being executed.

19. The device according to claim 17 or 18, wherein: The same file distribution task group includes a first file distribution task generated at a first moment and a second file distribution task generated at a second moment; The state determination submodule comprises: The first status updating unit is configured to update the second task execution status information of the second file distribution task to an ignore status indicating skipping execution in response to determining that the first task execution status information of the first file distribution task indicates being executed and the first time is later than the second time.

20. The device according to claim 19, wherein The state determination submodule also includes: a second status updating unit, configured to update the second task execution status information to execution success in response to determining that the first task execution status information indicates execution success; and The third status updating unit is configured to update the second task execution status information to execution failure in response to determining that the first task execution status information indicates execution failure.

21. The device according to claim 16, wherein: The cluster also includes an upstream node of the target node; the state determination module includes: An upstream status acquisition submodule, used to acquire upstream task execution status information of an upstream file distribution task configured for the upstream node; an upstream status reading submodule, configured to read the upstream task execution status information again after a preset time interval in response to determining that the upstream task execution status information indicates that the execution is not completed; and The first status update submodule is configured to update the target task execution status information to being executed in response to determining that the upstream task execution status information indicates successful execution.

22. The device according to claim 21, wherein The state determination module also includes: The second status update submodule is configured to update the target task execution status information to execution failure in response to determining that the upstream task execution status information indicates execution failure.

23. The device according to claim 16 or 21 or 22, wherein: The state determination module comprises: The third status update submodule is used to update the target task execution status information to execution failure in response to determining that the number of retries of the target file distribution task is equal to a preset number of times.

24. The apparatus according to claim 23, further comprising: The first retry submodule is used to generate a second execution instruction for re-executing the target file distribution task in response to determining that the target file distribution task fails to execute and determining that the number of retries is less than the preset number, and add 1 to the number of retries, where the initial value of the number of retries is 0.

25. The apparatus of claim 23, further comprising: A task duration determination submodule, used to determine a single execution duration of the target file distribution task according to the start time and current time of the target file distribution task; as well as The second retry submodule is used to generate a third execution instruction for re-executing the target file distribution task in response to determining that the single execution duration reaches a preset duration and that the number of retries is less than the preset number, and increase the number of retries by 1.

26. The device according to claim 15, wherein: The cluster includes a first node and a second node, and the file transfer information includes a first node identifier of the first node and a second node identifier of the second node; The task generation module includes: The first task generation submodule is used to generate a target file distribution task with the first node as a source node and the second node as a destination node according to the first node identifier and the second node identifier.

27. The device according to claim 26, wherein: The file transfer information also includes a target storage address of the file to be transferred; The task generation module also includes: The second task generation submodule is used to generate a target file distribution task with the first node as the source node, the second node as the destination node, and the target storage address in the second node as the file storage address of the file to be transmitted according to the first node identifier, the second node identifier and the target storage address.

28. The device according to claim 26 or 27, wherein The task information sending module includes: The task information sending submodule is used to send the target file distribution task to a node corresponding to the source node identifier of the source node of the target file distribution task according to the source node identifier of the source node of the target file distribution task.

29. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.

30. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-14.

31. A computer program product, comprising a computer program, wherein the computer program is stored on at least one of a readable storage medium and an electronic device, and when the computer program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.