File transmission method and device, equipment, medium and program product
By building a highly available architecture and a real-time monitoring mechanism, the system automatically switches to backup resources, resolving network jitter and server failure issues in dedicated line file transmission. This enables real-time and reliable transmission of data files, improving the system's robustness and business continuity.
Patent Information
- Application Number
- CN202511878254.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-01-30
AI Technical Summary
In existing technologies, dedicated line file transmission suffers from problems such as network jitter, bandwidth fluctuations, single points of failure in servers, and resource contention, leading to transmission interruptions and data inconsistencies, which affect the reliability and continuity of data exchange.
A highly available architecture is constructed, employing server clusters and backup dedicated lines. Transmission status is monitored in real time, and automatic switching to other servers or backup dedicated lines is performed in case of abnormalities. At the same time, a temporary file mechanism and an atomic renaming strategy are adopted to ensure the integrity of data files and reliable transmission.
It enables real-time and reliable transmission of data files in complex network environments, improves the robustness and business continuity of the system, reduces the risk of transmission interruption, and ensures the integrity and timeliness of data files.
Smart Images

Figure CN121441900A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of distributed or cloud computing technology, and more specifically to a file transfer method, apparatus, device, medium, and program product. Background Technology
[0002] As enterprises become increasingly information-driven, the demand for secure and reliable data exchange between entities is growing. Therefore, point-to-point file transfer via dedicated network connections and specific file transfer protocols is a widely adopted data exchange model. However, in practical applications, such dedicated network file transfer has several limitations. First, the instability of the underlying network environment, such as network jitter and bandwidth fluctuations, can directly lead to transmission session interruptions. Second, during peak business hours, dedicated network bandwidth may be heavily consumed by other high-priority services (such as online transactions), causing file transfer services to be delayed or fail due to insufficient resources. Furthermore, the source system, as the service provider, may have a single point of failure risk; a hardware or software failure, such as a system crash, will render the entire file transfer service unavailable. Summary of the Invention
[0003] In view of the above problems, embodiments of this disclosure provide a file transfer method, apparatus, device, medium, and program product.
[0004] According to a first aspect of this disclosure, a file transfer method is provided, comprising: in response to a file generating end generating a data file, initiating the transfer of the data file to a file receiving end via a target leased line; during the transfer process, transferring the data file based on a high-availability architecture and monitoring the status during the transfer process, wherein the high-availability architecture includes a clustered transfer server and at least one backup leased line; when a first abnormal state related to the current transfer server and / or a second abnormal state related to the target leased line is detected, automatically switching the transfer task to another transfer server in the cluster and / or switching to the backup leased line; and transferring the data file to the file receiving end in the form of a temporary file, and after determining that the data file transfer is complete, renaming the temporary file to the target file name via a target instruction.
[0005] According to embodiments of this disclosure, the file transfer method further includes: creating an independent transfer task for each data file when there are multiple data files to be transferred; and executing multiple transfer tasks simultaneously through parallel transfer threads or processes.
[0006] According to embodiments of this disclosure, when a first abnormal state related to the current transmission server is detected, the transmission task is automatically switched to another transmission server in the cluster, including: monitoring the liveness of the current transmission server based on a preset heartbeat detection mechanism; determining that the current transmission server is in a first abnormal state when the current transmission server is not responding; and in response to determining the first abnormal state, retrieving the unfinished transmission task interrupted by the current transmission server from the shared task queue through other transmission servers in the cluster, and continuing to execute the transmission of the data file.
[0007] According to embodiments of this disclosure, monitoring the liveness of the current transmission server based on a preset heartbeat detection mechanism includes: sending a heartbeat probe message to the current transmission server based on a preset time interval; starting a timer and listening for heartbeat response messages from the current transmission server within a preset timeout period; determining that the heartbeat detection has failed if no heartbeat response message meeting the preset response conditions is received within the timeout period; and determining that the current transmission server is unresponsive when the number of consecutive heartbeat detection failures reaches a preset retry threshold.
[0008] According to embodiments of this disclosure, when a second abnormal state related to the target leased line is detected, the transmission task is automatically switched to the backup leased line, including: sending probe data packets to the peer gateway of the target leased line to obtain performance parameters characterizing the link quality of the target leased line; comparing the performance parameters with preset switching conditions; determining that the target leased line is in a second abnormal state when the comparison result meets the switching conditions; and in response to determining the second abnormal state, generating and executing a routing switching instruction to route subsequent transmission traffic to the file receiving end to the backup leased line.
[0009] According to embodiments of this disclosure, the file transfer method further includes: in response to determining that the data file transfer has failed, retransmitting the failed data file according to a preset retransmission strategy until the transfer is successful or a preset termination condition is met.
[0010] According to embodiments of this disclosure, the file transfer method further includes: generating alarm information in response to detecting a first abnormal state and / or a second abnormal state; and sending the alarm information to at least one preset operation and maintenance terminal.
[0011] A second aspect of this disclosure provides a file transfer apparatus, comprising: an initiation module, configured to initiate the transfer of a data file to a file receiving end via a target leased line in response to the generation of a data file at a file generating end; a monitoring module, configured to transfer the data file based on a high-availability architecture during the transfer process and monitor the status during the transfer process, wherein the high-availability architecture includes a clustered transfer server and at least one backup leased line; a switching module, configured to automatically switch the transfer task to another transfer server in the cluster and / or to a backup leased line when a first abnormal state related to the current transfer server and / or a second abnormal state related to the target leased line is detected; and a renaming module, configured to transfer the data file to the file receiving end in the form of a temporary file, and rename the temporary file to the target file name via a target instruction after confirming that the data file transfer is complete.
[0012] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the file transfer method described above.
[0013] A fourth aspect of this disclosure also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the file transfer method described above.
[0014] The fifth aspect of this disclosure also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the file transfer method described above.
[0015] According to the file transfer method, apparatus, device, medium, and program products provided in the embodiments of this disclosure, by constructing a highly available architecture consisting of a server cluster and a backup leased line and implementing real-time status monitoring, seamless switching can be automatically performed when a transmission server failure or leased line anomaly is detected. At the same time, combined with an integrity protection strategy based on temporary files and atomic renaming mechanisms, the problems of transmission interruption and data inconsistency caused by network jitter, single point of failure, and resource contention are effectively solved. Ultimately, the end-to-end real-time, reliable, and complete transmission of data files in complex network environments is achieved, significantly improving the robustness and business continuity of the system. Attached Figure Description
[0016] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0017] Figure 1 The illustrations depict application scenarios of file transfer methods, apparatuses, devices, media, and program products according to embodiments of the present disclosure.
[0018] Figure 2 A flowchart illustrating a file transfer method according to an embodiment of the present disclosure is shown schematically.
[0019] Figure 3 A flowchart illustrating the monitoring of the current liveness status of a transmission server according to an embodiment of this disclosure is shown schematically.
[0020] Figure 4 A schematic block diagram of a file transfer apparatus according to an embodiment of the present disclosure is shown; and
[0021] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a file transfer method according to an embodiment of the present disclosure. Detailed Implementation
[0022] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0023] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0024] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0025] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0026] It should be noted that the file transfer method and apparatus specified in this disclosure can be used in the financial field in the fields of distributed or cloud computing technology, or in any field other than the financial field. The application fields of the file transfer method and apparatus disclosed in this disclosure are not limited.
[0027] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.
[0028] In the technical solution disclosed herein, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, and corresponding measures have been taken to ensure that they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse.
[0029] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this disclosure all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0030] This disclosure provides a file transfer method, apparatus, device, medium, and program product. By constructing a highly available transmission architecture that includes real-time monitoring, automatic switching, failure retransmission, and integrity verification, it can effectively cope with various abnormal situations that may occur during dedicated line file transfer, such as network jitter, server failure, and link interruption. This ensures that data files can be delivered to the receiving end in real time, accurately, and reliably in various complex environments, significantly improving the success rate of file transfer and business continuity, and enhancing the user experience.
[0031] Figure 1 The illustrations depict application scenarios of file transfer methods, apparatuses, devices, media, and program products according to embodiments of the present disclosure.
[0032] like Figure 1As shown, application scenario 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 serves as a medium for providing 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 or wireless communication links, or fiber optic cables, etc.
[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can interact with the file transfer server 105 via the network 104 to achieve reliable file transfer. For example, the file-generating end initiates a file transfer request through the first terminal device 101, and the file transfer server 105 transfers the file to the second terminal device 102, which is the file-receiving end, via a dedicated network. At the same time, the system administrator can monitor and manage the transfer process through the third terminal device 103.
[0034] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices that support file transfer protocols, including but not limited to servers, personal computers, industrial control computers, etc.
[0035] Server 105 can be a server that provides highly available file transfer services and is responsible for managing the entire file transfer process, including but not limited to: responding to file generation events at the file-generating end and initiating file transfer via a dedicated line; implementing status monitoring during the transfer process; automatically performing server switching or dedicated line switching when a transfer anomaly is detected; and ensuring the integrity of file transfer through a temporary file mechanism.
[0036] It should be noted that the file transfer method provided in this embodiment can generally be executed by server 105. Correspondingly, the file transfer device provided in this embodiment can generally be located in server 105. The file transfer method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the file transfer device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0037] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0038] The following will be based on Figure 1 The described scene, through Figures 2 to 3 The file transfer method according to the embodiments of this disclosure will be described in detail.
[0039] Figure 2 A flowchart illustrating a file transfer method according to an embodiment of the present disclosure is shown schematically.
[0040] like Figure 2 As shown, the file transfer method of this embodiment includes operations S210 to S240.
[0041] In operation S210, in response to the generation of a data file at the file generating end, the data file is transmitted to the file receiving end via the target leased line.
[0042] In embodiments of this disclosure, user consent or authorization may be obtained before acquiring the data file. For example, a request to acquire the data file may be sent to the user before operation S210. If the user consents or authorizes the acquisition of the data file, operation S210 is performed.
[0043] For example, the file generating end can be a banking system, while the file receiving end can be a corporate client server. In business transactions between banks and corporate clients, the bank frequently needs to transmit various data files to the corporate clients, such as account transaction details and financial statements. Therefore, a dedicated bank line service can be established between the bank and the corporate client to facilitate file transfer.
[0044] The moment a file is successfully generated, the file generator sends a notification signal to the file transfer service, immediately triggering the subsequent transfer process. This "event-driven" mechanism minimizes the delay between data file generation and entry into the transfer process, achieving near real-time file push and ensuring that customers receive files immediately, laying the foundation for timely processing of subsequent business operations.
[0045] For example, when a bank completes a transaction and generates the corresponding transaction details file, the system can trigger a transmission action instantly, using a pre-set target dedicated line to quickly send the file to the receiving end of the corporate customer.
[0046] In operating S220, during the transmission process, data files are transmitted based on a high-availability architecture, and the status during the transmission process is monitored. The high-availability architecture includes a clustered transmission server and at least one backup dedicated line.
[0047] The high-availability architecture consists of a cluster of transport servers and at least one backup leased line. The cluster of transport servers is a load-balanced cluster of multiple transport servers that can jointly handle file push tasks. In addition, besides the currently used target leased line, a physically or logically independent backup communication link can be pre-configured as a backup leased line.
[0048] During transmission, the transmission status can be continuously monitored, and key performance indicators can be collected, such as the CPU / memory utilization and heartbeat status of the transmission server, as well as the network latency, packet loss rate, and bandwidth utilization of the target leased line. Real-time monitoring of these statuses allows for the timely detection of potential problems, providing data support for subsequent anomaly handling.
[0049] In operation S230, when a first abnormal state related to the current transmission server and / or a second abnormal state related to the target leased line are detected, the transmission task is automatically switched to another transmission server in the cluster and / or switched to a backup leased line.
[0050] The first abnormal state can include server crashes, unresponsive service processes, and resource exhaustion, while the second abnormal state can include link interruptions, packet loss rates exceeding thresholds, and excessively high latency.
[0051] For example, if the primary transport server goes down, the load balancer or heartbeat arbitration mechanism in the cluster can immediately mark it as "unavailable" and redistribute all queued and subsequently added transport tasks on that server to other normal server instances in the cluster, thus achieving task takeover.
[0052] For example, if the target leased line is detected to be unavailable or its quality is severely degraded, such as due to an unexpected disconnection of the leased line or network congestion causing transmission obstruction, the system (such as the leased line gateway) can dynamically update the routing policy to direct the next hop of subsequent outbound traffic to the gateway address of the backup leased line, thereby achieving rapid link switching.
[0053] This mechanism ensures that the failure of a single component (server or leased line) will not affect the continuity of the overall file transfer service, greatly improving the robustness of the system.
[0054] In operation S240, the data file is transmitted to the file receiving end as a temporary file. After confirming that the data file transmission is complete, the temporary file is renamed to the target file name through the target instruction.
[0055] In the embodiments of this disclosure, a corresponding operation entry point can be provided to the user, allowing the user to choose to agree to or reject the automated decision result. That is, before executing the processing / decision of renaming the temporary file to the target file name via the target instruction, the user's instruction to agree to or reject the processing / decision can be obtained through the corresponding operation entry point. If the user agrees to the processing / decision, the processing / decision of renaming the temporary file to the target file name via the target instruction is executed, i.e., step S240 is executed. If the user rejects the processing / decision, the expert decision-making process is entered.
[0056] The system can transfer data files as temporary files (e.g., by adding a .tmp extension to the original filename) to a directory specified by the receiving end. Only after the system confirms that the entire file content has been successfully transferred without errors will a rename command be used to change the name of the temporary file to the final target filename. Then, the complete data file can be used for accounting, data analysis, and other tasks.
[0057] The temporary file mechanism achieves "atomicity" in file transfer. That is, for the receiving end, a file is either completely invisible (still in transit, a temporary file) or fully usable (transfer complete, a formal file). This effectively prevents the receiving application from misreading half-read or corrupted files due to listening for file creation events, thus avoiding subsequent data processing errors.
[0058] In some exemplary embodiments, a large bank adopted the file transfer method disclosed herein to meet the high-frequency data interaction needs with its corporate clients. Specifically, the bank's end-of-day processing system can trigger the transfer process immediately after generating settlement files. During the transfer to corporate clients via the primary financial leased line, the system can continuously monitor the link status: when a surge in network latency or a packet loss rate exceeding a preset threshold is detected, the system can automatically switch the transmission link to a backup leased line within 3 seconds; when a server node fails during concurrent transmission, the cluster scheduler can seamlessly migrate the transmission task of that node to other healthy nodes. Simultaneously, all files can exist as temporary files with the .tmp extension during the transmission phase. After file integrity verification is passed, the system can rename them to official files, ensuring the integrity and reliability of the data received by the corporate clients.
[0059] It is understood that the file transfer method provided in this disclosure ensures the stability of the transmission process through the redundancy design of server clusters and backup links. Simultaneously, a temporary file mechanism is employed during the file transfer phase, with atomic renaming operations performed after the transfer is complete, effectively preventing the receiver from processing incomplete data. Ultimately, this ensures that enterprise customers receive data files in real time and accurately, significantly improving the reliability of data transmission and business continuity.
[0060] In embodiments of this disclosure, the file transfer method further includes: creating an independent transfer task for each data file when there are multiple data files to be transferred; and executing multiple transfer tasks simultaneously through parallel transfer threads or processes.
[0061] When the system detects multiple data files that need to be transferred to the client, it can create a dedicated transfer task for each file. Each transfer task can include relevant information about the data file, such as file size, destination address, and transfer priority, ensuring that each file has a clear destination and defined purpose during the transfer process.
[0062] After creating independent transfer tasks, multiple transfer tasks can be executed simultaneously using parallel transfer threads or processes. Multithreading allows multiple threads to run concurrently within a single process, each handling the transfer of a data file independently. They can share process resources, such as memory space, but each has its own independent execution path and state. Multiprocessing, on the other hand, creates multiple independent processes, each responsible for transferring one data file. These processes are independent of each other, possessing their own memory space and system resources.
[0063] For example, in financial business scenarios, banks may generate a large number of data files in a short period of time. For instance, during daily transaction settlement, numerous customer transaction details and account statement files are generated. If a traditional serial transmission method is used, where one file is transmitted before the next, the transmission time increases significantly with the number of files, easily leading to transmission congestion. This prevents customers from obtaining the required files in a timely manner, thus affecting the normal operation of business. However, by adopting the concurrent transmission method of this embodiment, when multiple data files are generated at the same time, these files can be transmitted simultaneously. This fully utilizes network bandwidth and system resources, greatly shortening the overall transmission time and effectively avoiding transmission congestion caused by an excessive number of files. This ensures the efficiency and timeliness of data transmission, providing a strong guarantee for the stable operation of financial business.
[0064] Understandably, by using a high-concurrency processing mechanism, the system can significantly improve the throughput of file transfers, avoid transmission delays or congestion caused by a surge in the number of files at any given time, and thus ensure that enterprise customers can receive all data files quickly and stably even during peak business hours, thereby improving transmission efficiency in multi-file scenarios.
[0065] Based on the above embodiments, in this embodiment, when a first abnormal state related to the current transmission server is detected, the transmission task is automatically switched to other transmission servers in the cluster, including: monitoring the liveness status of the current transmission server based on a preset heartbeat detection mechanism; determining that the current transmission server is in a first abnormal state when the current transmission server is not responding; and in response to determining the first abnormal state, retrieving the unfinished transmission task interrupted by the current transmission server from the shared task queue through other transmission servers in the cluster, and continuing to execute the transmission of data files.
[0066] The heartbeat detection mechanism periodically sends detection signals to the current transmission server at preset time intervals. Upon receiving this signal, the transmission server is required to return an acknowledgment signal to indicate that it is in normal working order, thus allowing the system to monitor the transmission server's operational status. Only when the system fails to receive an acknowledgment signal from the current transmission server after sending multiple detection signals is the system determined to be unresponsive and its status marked as the first abnormal state.
[0067] In other embodiments, if the system fails to receive a response signal from the current transmission server multiple times consecutively, it can be determined that the current transmission server is unresponsive. In this case, other relevant indicators can be further analyzed comprehensively, such as the transmission server's resource usage (CPU utilization, memory usage, etc.) and network connection status, for multi-dimensional confirmation. If these indicators also show abnormalities and cannot support the transmission server in performing normal transmission tasks, then the system can determine that the current transmission server is in a first abnormal state.
[0068] A shared task queue can be set up within the cluster. This queue, implemented using a distributed cache or database, stores information on all tasks awaiting and currently being transmitted. During the execution of a transmission task, the current transmission server updates relevant task information, such as file identifier, transmission progress, and destination address, to the shared task queue in real time. When the current transmission server encounters an anomaly (i.e., enters the first anomaly state), other transmission servers in the cluster can proactively retrieve the unfinished transmission tasks interrupted by the current server from the shared task queue. After retrieving the tasks, other transmission servers can accurately pinpoint the interruption point based on the transmission progress and other information recorded in the task queue, and continue transmitting the data files, ensuring that the data files are successfully and completely transmitted to the target client.
[0069] Understandably, the heartbeat detection mechanism can detect the transmission server at short intervals and switch to other servers in a timely manner when an anomaly is detected. This achieves full-link automation from fault detection to service recovery, thereby minimizing the impact on file transfer services and effectively ensuring the high availability of the system.
[0070] Based on the above embodiments, in this embodiment, the current transmission server's liveness status is monitored based on a preset heartbeat detection mechanism, including: sending heartbeat probe messages to the current transmission server based on a preset time interval; starting a timer and listening for heartbeat response messages from the current transmission server within a preset timeout period; determining heartbeat detection failure in response to not receiving a heartbeat response message that meets the preset response conditions within the timeout period; and determining that the current transmission server is unresponsive when the number of consecutive heartbeat detection failures reaches a preset retry threshold.
[0071] The time interval should consider several factors. On one hand, it needs to ensure timely detection. If the time interval is too long, the system might only perform a detection after a serious problem has already occurred on the transmission server, leading to an inability to handle anomalies promptly. On the other hand, it's also important to avoid excessively frequent detections that could unnecessarily burden the network and transmission server. For example, in scenarios with relatively stable network conditions and moderate transmission server load, the time interval can be set to 10 seconds, allowing for timely problem detection without significantly impacting system performance. The sent heartbeat probe messages typically contain specific identification information so that the transmission server recognizes it as a heartbeat detection request.
[0072] Furthermore, a timer can be started to listen for heartbeat response messages from the current transmission server within a preset timeout period. The timeout period can be set based on the normal latency of network transmission and the processing time of the transmission server. For example, the timeout period can be set to 3 seconds. If no response message is received after this time, the system can proceed to the next step of judgment.
[0073] The system determines that the heartbeat detection has failed if it does not receive a heartbeat response message that meets the preset response conditions within the timeout period. The preset response conditions determine the validity of the heartbeat response message and may include the correctness of the message format and the inclusion of specific verification information. For example, the response message must contain identification information consistent with that in the heartbeat detection message, and its format must conform to predefined specifications. If the received response message does not meet these conditions, it can be considered an invalid response, and the heartbeat detection will also be deemed a failure.
[0074] To avoid misjudgments caused by momentary network failures or temporary anomalies, the system can adopt a consecutive failure counting strategy. Only when the number of consecutive heartbeat detection failures reaches a preset retry threshold (e.g., 3 consecutive times) is it determined that the current transmission server has a problem of not responding normally, and then subsequent processing measures are taken, such as switching the transmission task to other transmission servers in the cluster.
[0075] Understandably, by sending heartbeat probe messages at preset time intervals, the system can continuously and regularly and proactively probe the status of the transmission server. Furthermore, setting a preset retry threshold for consecutive failed heartbeat detections before determining that the server is unresponsive effectively improves the system's fault tolerance.
[0076] Figure 3 A flowchart illustrating the monitoring of the current liveness status of a transmission server according to an embodiment of this disclosure is shown schematically.
[0077] Based on the above embodiments, in this embodiment, as follows: Figure 3 As shown, when a second abnormal state related to the target leased line is detected, the transmission task is automatically switched to the backup leased line. This includes: sending probe data packets to the peer gateway of the target leased line to obtain performance parameters characterizing the link quality of the target leased line; comparing the performance parameters with preset switching conditions; determining that the target leased line is in a second abnormal state when the comparison result meets the switching conditions; and generating and executing a routing switching instruction in response to determining the second abnormal state, routing subsequent transmission traffic to the file receiving end to the backup leased line.
[0078] The size, format, and sending frequency of probe packets can be optimized to ensure accurate acquisition of link quality information for the target leased line without placing excessive burden on the network. For example, the probe packet size can be set to 512 bytes. The sending frequency can be dynamically adjusted based on the actual usage of the target leased line and the network environment. During peak traffic periods, the sending frequency can be appropriately reduced to avoid affecting the transmission of normal business data; during off-peak periods, the sending frequency can be appropriately increased to detect link problems more promptly.
[0079] Upon receiving a probe packet, the peer gateway can process it and return a corresponding response. By parsing the response, performance parameters characterizing the quality of the target leased link can be obtained, such as latency, packet loss rate, and bandwidth utilization. Latency refers to the time required for a data packet to travel from the sender to the receiver, reflecting the network's transmission speed. For example, excessively high latency may cause stuttering in services with high real-time requirements (such as video conferencing and online games). Packet loss rate refers to the proportion of data packets lost during data transmission out of the total number of transmitted data packets; an excessively high packet loss rate will affect data integrity and accuracy. Bandwidth utilization indicates the current usage of network bandwidth; excessively high bandwidth utilization may lead to network congestion and affect data transmission efficiency.
[0080] Then, the acquired performance parameters can be compared with preset switching conditions, which can be formulated based on business needs and network environment characteristics. For example, for latency, if the business has extremely high real-time requirements, such as a financial transaction system, the preset switching condition can be set to trigger switching when the latency exceeds 10 milliseconds; while for some businesses with relatively low real-time requirements, such as file backup, the latency threshold can be set to 100 milliseconds. For packet loss rate, if the business has strict requirements for data integrity, such as medical image transmission, the preset switching condition can be to switch when the packet loss rate exceeds 0.1%; while for some businesses that can tolerate a certain amount of data loss, such as video streaming, the packet loss rate threshold can be increased to 1%.
[0081] When the comparison results meet the switching conditions, the target leased line can be determined to be in the second abnormal state. At this time, a route switching command can be generated based on factors such as the status information of the backup leased line, the current service requirements, and the network topology. For example, the system can first check whether the backup leased line is in a normal and available state. If the backup leased line itself is faulty or has poor link quality, switching cannot be performed. Simultaneously, the system can also consider the current service's requirements for bandwidth, latency, and other performance indicators, selecting the most suitable backup leased line for switching. After generating the route switching command, it can be executed immediately, redirecting traffic by modifying the routing table, routing subsequent transmission traffic destined for the file receiver to the backup leased line. For example, the system can send corresponding configuration commands to the router to direct traffic destined for the file receiver to the port connected to the backup leased line. During the switching process, the system can monitor the switching effect in real time to ensure that traffic can be successfully switched to the backup leased line and that the backup leased line can normally carry this traffic. If problems occur during the switching process, the system can make timely adjustments and handle them, such as reselecting a backup leased line or attempting to restore the target leased line to use.
[0082] Understandably, after determining the second abnormal state, a route switching instruction is generated and executed to route the transmission traffic to the backup leased line, effectively reducing the risk of data transmission interruption caused by the failure of the target leased line.
[0083] In embodiments of this disclosure, the file transfer method further includes: in response to determining that the data file transfer has failed, retransmitting the failed data file according to a preset retransmission strategy until the transfer is successful or a preset termination condition is met.
[0084] During file transmission, various factors, including network jitter, can cause data file transfer failures. For example, in a complex network environment, data files may pass through multiple routers and switches during transmission. A sudden increase in network traffic or a brief malfunction of some network devices can trigger network jitter. In such cases, the data file may not arrive at the receiving end as expected, resulting in a push failure.
[0085] Once a push failure is detected due to network jitter or other factors, a retransmission mechanism can be automatically triggered immediately. Specifically, information about the failed data file can be recorded, including the file's identifier, size, and transmission time. Then, based on a preset retransmission strategy, the transmission path and transmission time can be replanned. For example, the system can choose to retransmit during periods of relatively low network traffic to improve the success rate; or it can select a more stable and reliable transmission path based on the real-time network topology.
[0086] To avoid endless retransmissions due to network problems that cannot be resolved in the short term, thus wasting network and system resources, a maximum number of retransmissions can be preset. For example, setting the maximum number of retransmissions to 5 means that if a data file fails to be transmitted after 5 retransmissions, the preset termination condition is met. At this point, the system can stop retransmissions and record relevant error information for subsequent analysis and processing. Furthermore, some data files may be time-sensitive, such as news articles or real-time market data. If a data file fails to be transmitted for various reasons and expires or becomes invalid after a certain period, continuing retransmission is also pointless. In this case, the termination condition can also be met, and retransmissions can be stopped.
[0087] Understandably, automatic file retransmission ensures that customers do not miss receiving any files, guaranteeing the integrity and timeliness of file reception.
[0088] In embodiments of this disclosure, the file transfer method further includes: generating alarm information in response to detecting a first abnormal state and / or a second abnormal state; and sending the alarm information to at least one preset operation and maintenance terminal.
[0089] The first abnormal state can involve server-level anomalies, such as persistently high CPU usage exceeding a preset safety threshold, which may lead to decreased server performance and affect the overall system response speed; or, memory leaks on the server, gradually consuming a large amount of memory resources and eventually causing the server to crash. The second abnormal state can focus on network leased lines, such as a sudden and significant drop in leased line bandwidth, failing to meet normal data transmission needs; or frequent packet loss on the leased line, severely impacting the integrity and accuracy of data transmission.
[0090] Once any one or both of the above-mentioned abnormal states are detected simultaneously, detailed and accurate alarm information can be generated according to preset rules and templates. The alarm information can not only clearly indicate the type of anomaly, such as "abnormal CPU utilization of the server" or "insufficient dedicated line bandwidth," but also include key information such as the time of occurrence and the scope of impact, so that operations and maintenance personnel can quickly understand the severity of the anomaly and its potential impact. Then, the alarm information can be promptly sent to at least one preset operations and maintenance terminal, including but not limited to mobile phones, tablets, or dedicated operations and maintenance management computers used by operations and maintenance personnel. The sending methods can also be diverse; in addition to common SMS notifications, messages can be pushed through instant messaging tools, or detailed alarm reports can be sent via email. Furthermore, to prevent operations and maintenance personnel from missing important alarms due to negligence, alarm SMS messages can be continuously sent at a preset frequency until operations and maintenance personnel confirm receipt and handle the anomaly.
[0091] Understandably, alarm notifications ensure that the system can promptly and effectively notify maintenance personnel when faced with various abnormal situations, thereby enabling immediate manual intervention and ensuring the stable operation of the system.
[0092] Based on the above file transfer method, this disclosure also provides a file transfer apparatus. The following will be combined with... Figure 4 The device is described in detail.
[0093] Figure 4 A schematic block diagram of a file transfer apparatus according to an embodiment of the present disclosure is shown.
[0094] like Figure 4 As shown, the file transfer device 400 of this embodiment includes an initiation module 410, a monitoring module 420, a switching module 430, and a renaming module 440.
[0095] The initiation module 410 is used to initiate the transmission of a data file to the file receiving end via the target leased line in response to the generation of a data file at the file generating end. In one embodiment, the initiation module 410 can be used to perform the operation S210 described above, which will not be repeated here.
[0096] The monitoring module 420 is used to transmit data files based on a high-availability architecture during the transmission process and to monitor the status of the transmission process. The high-availability architecture includes a clustered transmission server and at least one backup dedicated line. In one embodiment, the monitoring module 420 can be used to perform the operation S220 described above, which will not be repeated here.
[0097] The switching module 430 is used to automatically switch the transmission task to another transmission server in the cluster and / or to a backup leased line when a first abnormal state related to the current transmission server and / or a second abnormal state related to the target leased line is detected. In one embodiment, the switching module 430 can be used to perform the operation S230 described above, which will not be repeated here.
[0098] The renaming module 440 is used to transmit the data file to the file receiving end as a temporary file. After confirming that the data file transmission is complete, it renames the temporary file to the target file name according to the target instruction. In one embodiment, the renaming module 440 can be used to perform the operation S240 described above, which will not be repeated here.
[0099] According to embodiments of this disclosure, the initiating module 410 can also be used to: create an independent transmission task for each data file when there are multiple data files to be transmitted; and execute multiple transmission tasks simultaneously through parallel transmission threads or processes.
[0100] According to embodiments of this disclosure, the monitoring module 420 can be specifically used to: monitor the current status of the transmission server based on a preset heartbeat detection mechanism; determine that the current transmission server is in a first abnormal state when the current transmission server is not responding; and in response to determining the first abnormal state, retrieve the unfinished transmission tasks interrupted by the current transmission server from the shared task queue through other transmission servers in the cluster, and continue to execute the transmission of data files.
[0101] According to embodiments of this disclosure, the monitoring module 420 can be specifically used to: send a heartbeat detection message to the current transmission server based on a preset time interval; start a timer and listen for heartbeat response messages from the current transmission server within a preset timeout period; determine that the heartbeat detection has failed if no heartbeat response message meeting the preset response conditions is received within the timeout period; and determine that the current transmission server is unresponsive when the number of consecutive heartbeat detection failures reaches a preset retry threshold.
[0102] According to an embodiment of this disclosure, the monitoring module 420 can be specifically used to: send probe data packets to the peer gateway of the target leased line to obtain performance parameters characterizing the link quality of the target leased line; compare the performance parameters with preset switching conditions; when the comparison result meets the switching conditions, determine that the target leased line is in a second abnormal state; and in response to determining the second abnormal state, generate and execute a routing switching instruction to route subsequent transmission traffic to the file receiving end to the backup leased line.
[0103] According to embodiments of this disclosure, the renaming module 440 can also be used to: in response to determining that the data file transmission has failed, retransmit the failed data file according to a preset retransmission strategy until the transmission is successful or a preset termination condition is met.
[0104] According to embodiments of this disclosure, the renaming module 440 can also be used to: generate alarm information in response to detecting a first abnormal state and / or a second abnormal state; and send the alarm information to at least one preset operation and maintenance terminal.
[0105] According to embodiments of this disclosure, any plurality of modules among the initiation module 410, monitoring module 420, switching module 430, and renaming module 440 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules may be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the initiation module 410, monitoring module 420, switching module 430, and renaming module 440 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods or a suitable combination of any of them. Alternatively, at least one of the initiation module 410, monitoring module 420, switching module 430, and renaming module 440 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0106] Figure 5 A block diagram of an electronic device for a file transfer method according to an embodiment of the present disclosure is shown schematically.
[0107] like Figure 5 As shown, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0108] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 502 and / or RAM 503. It should be noted that programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
[0109] According to embodiments of this disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.
[0110] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0111] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include the memory (ROM) 502 and / or random access memory (RAM) 503 described above and / or one or more memories other than memory (ROM) 502 and random access memory (RAM) 503.
[0112] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the file transfer method provided in the embodiments of this disclosure.
[0113] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0114] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0115] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0116] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0118] Those skilled in the art will understand that the features described in the various embodiments of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0119] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A file transfer method characterized by, The method comprises: In response to a file generation end generating a data file, initiating transmission of the data file to a file receiving end through a target private line; During transmission, transmitting the data file based on a high-availability architecture, and monitoring a state during the transmission, wherein the high-availability architecture comprises a cluster-deployed transmission server and at least one backup private line; When a first abnormal state related to a current transmission server and / or a second abnormal state related to the target private line is monitored, automatically switching a transmission task to other transmission servers in the cluster and / or to the backup private line; and Transmitting the data file to the file receiving end in the form of a temporary file, and renaming the temporary file to a target file name through a target instruction after determining that the data file transmission is complete.
2. The method of claim 1, wherein, The method further comprises: When there are multiple data files to be transmitted, creating an independent transmission task for each data file; and Simultaneously executing multiple transmission tasks through parallel transmission threads or processes.
3. The method according to claim 1 or 2, characterized in that, When the first abnormal state related to the current transmission server is monitored, automatically switching the transmission task to other transmission servers in the cluster, comprising: Monitoring a survival state of the current transmission server based on a preset heartbeat detection mechanism; When the current transmission server is determined to be unresponsive, determining that the current transmission server is in the first abnormal state; and In response to determining the first abnormal state, obtaining an unfinished transmission task interrupted by the current transmission server from a shared task queue through other transmission servers in the cluster, and continuing to execute transmission of the data file.
4. The method of claim 3, wherein, Monitoring the survival state of the current transmission server based on the preset heartbeat detection mechanism, comprising: Sending a heartbeat probe packet to the current transmission server based on a preset time interval; Starting a timer and listening for a heartbeat response packet from the current transmission server within a preset timeout period; In response to not receiving a heartbeat response packet satisfying a preset response condition within the timeout period, determining that heartbeat detection fails; and When the number of consecutive heartbeat detection failures reaches a preset retry threshold, determining that the current transmission server is unresponsive.
5. The method according to claim 1 or 2, characterized in that, When the second abnormal state related to the target private line is monitored, automatically switching the transmission task to the backup private line, comprising: Sending a probe data packet to a peer gateway of the target private line to obtain a performance parameter representing a link quality of the target private line; Comparing the performance parameter with a preset switching condition; When the comparison result satisfies the switching condition, determining that the target private line is in the second abnormal state; and In response to determining the second abnormal state, generating and executing a routing switching instruction to route transmission traffic sent to the file receiving end subsequently to the backup private line.
6. The method of claim 1, wherein, The method further comprises: In response to determining that the data file transmission fails, retransmitting the data file that fails in transmission according to a preset retransmission strategy until the transmission is successful or a preset termination condition is satisfied.
7. The method according to claim 1 or 6, characterized in that, The method further comprises: generate alarm information in response to monitoring the first abnormal state and / or the second abnormal state; and send the alarm information to at least one preset operation and maintenance terminal.
8. A file transfer apparatus characterized by comprising: The device comprises: An initiating module for initiating transmission of a data file to a file receiving end through a target private line in response to the file generating end generating the data file; A monitoring module for monitoring a state during transmission based on a high-availability architecture during transmission, wherein the high-availability architecture comprises a cluster-deployed transmission server and at least one backup private line; A switching module for automatically switching a transmission task to other transmission servers in the cluster and / or to the backup private line when a first abnormal state related to a current transmission server and / or a second abnormal state related to the target private line is monitored; and A renaming module for transmitting the data file to the file receiving end in the form of a temporary file, and renaming the temporary file to a target file name through a target instruction after determining that the data file is completely transmitted. 9.An electronic device comprising: one or more processors; a storage device for storing one or more computer programs, characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method according to any one of claims 1-7.
11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method according to any one of claims 1-7. The computer program is executed by the processor to implement the steps of the method according to any one of claims 1-7.