File transmission method and device, electronic equipment and storage medium

By using custom scanning technology and transmission protocols, the client directory is monitored in real time. File IDs and cache are used to manage file status, solving the problem of not being able to synchronize new files or content changes in a timely manner during file transfer. This achieves efficient and secure file transfer and improves operational efficiency.

CN119946041BActive Publication Date: 2026-01-23中国邮政储蓄银行股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411888224.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2026-01-23
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Existing technologies cannot monitor directory changes in a timely manner during file transfer, resulting in new files or changes in file content not being automatically synchronized to the server, which increases the workload and cost of data center operation and maintenance.

Method used

By using custom scanning technology and transmission protocols, the client directory is monitored in real time to promptly detect new files or files with changed content, and automatically transmits them incrementally to the server. Using file IDs as unique identifiers and combining them with cache management of file status, timely file synchronization and cross-platform compatibility are achieved.

Benefits of technology

It improves file transfer efficiency, reduces operation and maintenance costs, and has cross-platform compatibility and asynchronous notification capabilities, ensuring the timeliness and security of file transfer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946041B_ABST
    Figure CN119946041B_ABST
Patent Text Reader

Abstract

The application discloses a file transmission method and device, electronic equipment and a storage medium. The method comprises the following steps: in response to a file data transmission instruction of a data center, starting a file scanning device to obtain a file ID of file data under a current directory; transmitting the file data to a file sending device according to the file ID of the file data; in response to a sending result of the file sending device, saving a file state and a file ID of the file data to a cache; in the case that the file state is updated, determining a file ID of file data that needs to be retransmitted, and transmitting incremental file data corresponding to the file ID to a server. Through the above method, incremental file data can be found in time in the process of file transmission. Meanwhile, the application also provides a file transmission scheme for a data center operation and maintenance scene, which guarantees the safety of file data transmission and reduces the operation and maintenance workload.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of file transmission, and particularly relates to a file transmission method and device, electronic equipment and a storage medium. BACKGROUND

[0002] With the increasing scale of data center infrastructure, the file transmission demand in the operation and maintenance scene presents unprecedented diversification and complexity. At present, the file transmission realized by the commands such as FTP, SFTP and SCP in the industry can synchronize all files under the directory to the server at one time.

[0003] In the process of file transmission, it is impossible to monitor the directory, and when a new file is generated or the file content is changed under the monitored directory, it is impossible to discover and automatically synchronize it to the server in time. This increases the file transmission workload in the data center operation and maintenance scene. SUMMARY

[0004] The embodiments of the present application provide a file transmission method, device, electronic equipment and storage medium, so as to discover incremental file data in time in the process of file transmission, and improve the data transmission security in the operation and maintenance scene of the data center.

[0005] The embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, the embodiments of the present application provide a file transmission method, and the method comprises the following steps:

[0007] In response to a file data transmission instruction of a data center, a file scanning device is started to obtain a file ID of file data under a current directory;

[0008] According to the file ID of the file data, the file data is transmitted to a file sending device;

[0009] In response to a sending result of the file sending device, a file state and a file ID of the file data are saved to a cache;

[0010] In the case of file state updating, a file ID of file data that needs to be retransmitted is determined, so as to transmit incremental file data corresponding to the file ID to a server.

[0011] In some embodiments, in response to the file data transmission instruction of the data center, the file scanning device is started to obtain the file ID of the file data under the current directory, which comprises the following steps:

[0012] A specified directory is obtained according to the file data transmission instruction of the data center;

[0013] The file scanning device starts to monitor a file ID of each file in the specified directory, the file ID being composed of a file path, a file size, and a last modification time of the file;

[0014] The file ID is used as unique identification information of the file, and when any one of the file ID changes, it is regarded as a new file or an updated file and is transmitted to the file sending device.

[0015] In some embodiments, in response to the sending result of the file sending device, the file state and the file ID of the file data are saved to a cache, including:

[0016] When the sending result of the file sending device is a successful or failed transmission, the file state of the successful or failed transmission of the file data is updated, and the updated file state and the file ID are saved to the cache;

[0017] The file scanning device starts again to obtain the file state of the successful or failed transmission of the file data.

[0018] In some embodiments, in the case of the file state update, the file ID of the file data that needs to be retransmitted is determined, so that the incremental file data corresponding to the file ID is transmitted to the server, including:

[0019] In the case of the file state update, if the file state transmission is successful, the current file data is filtered;

[0020] In the case of the file state update, if the file state transmission fails, the incremental file data corresponding to the file ID is transmitted to the server.

[0021] In some embodiments, the method further includes

[0022] The file sending device transmits the file data to the server based on a custom transmission protocol, and the custom transmission protocol is used to implement in an operation and maintenance scene of a data center.

[0023] In some embodiments, the method further includes

[0024] In response to an asynchronous notification request submitted by a file receiving device, an asynchronous message is synchronously pushed to a third-party association system.

[0025] In some embodiments, the method includes:

[0026] Through the file receiving device, file data of a data center sent by a file sending device of a client is received;

[0027] Return the receiving result of the file data to the file sending device of the client to update the file state of the file data in the cache;

[0028] In response to the file state of the file data, receive the incremental file data corresponding to the file ID of the file data that needs to be retransmitted.

[0029] In a second aspect, the embodiments of the present application further provide a file transmission device, wherein the device comprises:

[0030] A first response module is configured to, in response to a file data transmission instruction of a data center, start a file scanning device to acquire a file ID of file data under a current directory;

[0031] A transmission module is configured to, according to the file ID of the file data, transmit the file data to a file sending device;

[0032] A second response module is configured to, in response to a sending result of the file sending device, save the file state and the file ID of the file data to a cache;

[0033] A determination module is configured to, in a case where the file state is updated, determine a file ID of file data that needs to be retransmitted, so as to transmit incremental file data corresponding to the file ID to a server.

[0034] In a third aspect, the embodiments of the present application further provide an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, which, when executed, cause the processor to perform the above method.

[0035] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium storing one or more programs, which, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the above method.

[0036] The above at least one technical scheme adopted by the embodiments of the present application can achieve the following beneficial effects: by responding to a file data transmission instruction of a data center, a file scanning device is started to acquire a file ID of file data under a current directory. Then, according to the file ID of the file data, the file data is transmitted to a file sending device. Further, in response to a sending result of the file sending device, the file state and the file ID of the file data are saved to a cache, so that in a case where the file state is updated, a file ID of file data that needs to be retransmitted can be determined, so as to transmit incremental file data corresponding to the file ID to a server. Through the above method, new files can be found in time and automatically transmitted to the server, thereby reducing the operation and maintenance cost and improving the transmission efficiency of file data. BRIEF DESCRIPTION OF DRAWINGS

[0037] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0038] Figure 1 A schematic diagram of a client and a server in a file transmission method in an embodiment of the application;

[0039] Figure 2 A schematic flow diagram of a file transmission method (client) in an embodiment of the application;

[0040] Figure 3 A schematic flow diagram of a file transmission method (server) in an embodiment of the application;

[0041] Figure 4 A schematic structural diagram of a file transmission device in an embodiment of the application;

[0042] Figure 5 A timing diagram of an implementation process of a file transmission method in an embodiment of the application;

[0043] Figure 6 A schematic structural diagram of an electronic device in an embodiment of the application. DETAILED DESCRIPTION

[0044] To make the objects, technical solutions and advantages of the application clearer, the following will clearly and completely describe the technical solutions of the application with specific embodiments of the application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.

[0045] The technical terms involved in the application are as follows:

[0046] FTP: File Transfer Protocol, is a widely used standard protocol for file transfer in a network, which allows users to connect to an FTP server through client software to perform file upload, download, deletion, renaming and other operations.

[0047] SFTP: (SSH File Transfer Protocol), is a secure file transfer protocol.

[0048] SCP (Secure Copy Protocol) is primarily used for the secure transfer of files between hosts on a computer network.

[0049] Monitoring transmission: This refers to the ability to monitor a specified directory in real time during file upload tasks. When there are new files or files with changed content in the monitored directory, the system can detect them promptly and automatically transmit them to the server.

[0050] In data center operations and maintenance scenarios, personnel typically use shell or batch scripts and FTP, SFTP, and SCP commands to transfer local files to the target server. However, this method lacks the ability to monitor the local directory during file transfer and automatically transfer new files from the local directory to the server. While FTP, SFTP, and SCP commands can transfer files from the client directory to the server in a single transaction or at regular intervals, they cannot promptly detect and automatically incrementally synchronize new files or changes to file content. Furthermore, current operations and maintenance transfer methods lack compatibility with different operating systems and fail to provide asynchronous notifications upon completion of each file transfer, failing to provide a universal method for notifying third-party systems to proceed with further processing.

[0051] To address the aforementioned shortcomings, this application provides a file transfer method that, through customized scanning technology and transmission protocols, enables real-time monitoring of the client's directory, timely detection of new files or files with changed content, and automatic incremental transfer to the server. This improves the efficiency of file transfer in operational scenarios, reduces operational costs, and provides cross-platform compatibility and asynchronous notification capabilities.

[0052] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0053] like Figure 1 As shown, the file data transfer process mainly involves a client and a server. The client transmits the file data to the server via a transfer protocol. Both the client and server components include a file transfer client and a file transfer server, and both have basic file transfer components. When the client sends a file to the server, the specific process is as follows:

[0054] S1: The client scans the monitored local directories. If the file ID (which mainly consists of the file's full path, file size, and last modified time) does not exist in the cache (including but not limited to the local Ehcache cache or Redis cache), the file needs to be transferred and submitted to the client's pending send queue.

[0055] S2, the client file sending component retrieves the tasks to be sent from the queue and creates a new file transfer thread.

[0056] S3, a client file transmission thread, establishes a connection with the server through a custom socket protocol.

[0057] S4, the server performs identity authentication on the client after receiving the connection request, ensures the security of the connection, and completes the connection request with the client after passing.

[0058] S5, after establishing a connection with the server, the client encapsulates information such as the client path of the file to be sent, the server path to be received, the file size, and the file MD5 into a message and sends it to the server.

[0059] S6, the server performs permission check on the upload directory requested by the client to ensure the legality of data access, and returns the check result to the client.

[0060] S7, if the server returns a check failure, the transmission ends; if the check succeeds, the file content transmission begins. During the file transmission process, the system will calculate and update the transmission progress in real time, and display it to the user through an intuitive progress bar or percentage, so that the user can clearly understand the current transmission status.

[0061] S8, after the server file reception is completed, the file message information transmitted by the client and the received file are subjected to integrity check, and if the check succeeds, the transmission process ends normally, otherwise the client is notified to retransmit.

[0062] S9, after the server file transmission is completed, the asynchronous notification function is executed, and the third party system can perform subsequent processing according to the notification.

[0063] S10, after the client file transmission is completed, the file state in the cache is updated (i.e. the correspondence between the file ID and the file state).

[0064] The embodiment of the application provides a file transmission method, as shown in Figure 2 The embodiment of the application provides a file transmission method, as shown in

[0065] Step S210, in response to the file data transmission instruction of the data center, a file scanning device is started to obtain the file ID of the file data under the current directory.

[0066] The file transmission process refers to the process of transmitting a file from one computer system to another computer system, usually the process of transmitting a file from a client to a server. There are a large number of file backup and file recovery needs in data center operation scenarios. For example, off-site backup and recovery of databases. Data backup is needed between databases deployed in different regions, and data recovery is needed when data anomalies occur. If new file data or old file data with changes cannot be found and transmitted in time during the file transmission process, the operation and maintenance cost is increased.

[0067] The client starts the file scanning device in the client according to the file data transmission instruction of the data center, to obtain the file ID of the file data under the current directory. The "file data transmission instruction" includes but is not limited to the process of transmitting a plurality of or a certain file data from the client to the server.

[0068] The file scanning device is deployed in the client and is mainly used for periodically scanning (caching) to obtain the file ID of the file data under the specified directory. The file ID serves as the unique identifier of the file data and can be used to distinguish different file data.

[0069] Step S220, according to the file ID of the file data, the file data is transmitted to the file sending device.

[0070] The client selects the file data that needs to be transmitted according to the file ID of the file data, and transmits the file data to the file sending device in the client. The file sending device is used to receive the file data that needs to be transmitted determined by the file ID sent by the file scanning device.

[0071] It can be understood that the file ID can be used to filter the successfully transmitted files, so as to determine the files that need to be transmitted. Preferably, an operation and maintenance table of the file ID and the file data is established, so that the file data corresponding to the file ID can be quickly located.

[0072] Step S230, in response to the sending result of the file sending device, the file state and the file ID of the file data are saved to the cache.

[0073] The client saves the file state and the file ID of the file data to the cache according to the sending result of the file sending device, such as success or failure. The file state in the cache is determined according to the sending result of the file sending device of the client, and whether the file ID changes is monitored by the scanning device of the client.

[0074] It can be understood that the cache includes but is not limited to a local Ehcache cache or a Redis cache.

[0075] Step S240, in the case of the file status update, determining the file ID of the file data that needs to be retransmitted, so as to transmit the incremental file data corresponding to the file ID to the server.

[0076] In the case of the file status update, the client determines the file ID of the file data that needs to be retransmitted, so as to find the corresponding incremental file data through the file ID, and transmit the incremental file data to the server.

[0077] Through the above method, in response to the file data transmission instruction of the data center, the file scanning device is started to obtain the file ID of the file data under the current directory, and in response to the transmission result of the file sending device, the file status and the file ID of the file data are saved to the cache. In this way, in the case of the file status update, the file ID of the file data that needs to be retransmitted is determined, so as to transmit the incremental file data corresponding to the file ID to the server. Based on the file transmission in the data center operation and maintenance scenario, the file synchronization demand can be solved in time, and the data center operation and maintenance efficiency is improved.

[0078] Through the above method, in response to the file data transmission instruction of the data center, the file scanning device is started to obtain the file ID of the file data under the current directory; and according to the file ID of the file data, the file data is transmitted to the file sending device, so that the file scanning device can monitor the specified directory of the client. When a new file or an old file with changed content under the monitored directory is found, it can be automatically transmitted to the server in time.

[0079] Through the above method, in the data center operation and maintenance scenario, new files can be found in time and automatically transmitted to the server. That is, all files, subdirectories, and all files under the subdirectories in directory a under host 1 are synchronized to the corresponding directory b under host 2 in time, and the server is notified for analysis and processing after each file synchronization is completed.

[0080] Unlike the FTP, SFTP, SCP and other tools used in related technologies, when using these file data transmission protocols, only full file synchronization can be achieved, and it is difficult to achieve timely and incremental synchronization. Through the above method, new files or old files with changed content can be found in time and automatically transmitted to the server in an incremental manner.

[0081] In an embodiment of the present application, the file scanning device is started to acquire the file ID of the file data in the current directory in response to the file data transmission instruction of the data center, including: acquiring a specified directory according to the file data transmission instruction of the data center; starting the file scanning device to monitor the file ID of the file data in each file in the specified directory, which is composed of the file full path, the file size and the file last modification time; the file ID is used as the unique identification of the file information, and when any one of the file ID changes, it is considered as a new file or a file update and is transmitted to the file sending device.

[0082] To better, the file scanning device in the client periodically scans all files, subdirectories and all file data in the subdirectories in the specified directory. The specified directory is acquired according to the file data transmission instruction of the data center; the file scanning device is started to monitor the file ID of the file data in each file in the specified directory, which is composed of the file full path, the file size and the file last modification time.

[0083] Based on the file full path, the file size and the file last modification time, the file scanning device in the client combines each file in the specified directory of the client into a file ID, which is used to uniquely identify a file. That is, when any one of the three information changes, it is considered as a new file or a file update, and the file is submitted to the sending device for automatic transmission. In addition, after the file transmission is completed, the file ID and the file transmission state are combined and cached, so that the file scanning device in the client can filter the successfully transmitted files according to the cached data in subsequent file scanning.

[0084] It should be noted that the above three kinds of information are only examples and do not limit the scope of protection in the embodiments of the present application.

[0085] In an embodiment of the present application, the file scanning device is started to acquire the file ID of the file data in the current directory in response to the file data transmission instruction of the data center, including: acquiring a specified directory according to the file data transmission instruction of the data center; starting the file scanning device to monitor the file ID of the file data in each file in the specified directory, which is composed of the file full path, the file size and the file last modification time; the file ID is used as the unique identification of the file information, and when any one of the file ID changes, it is considered as a new file or a file update and is transmitted to the file sending device.

[0086] The file status mainly includes transmission success or failure, which is determined by the sending result of the file sending device of the client. After updating the file status of the success or failure transmission of the file data, the updated file status and the file ID are saved to the cache and the file ID is saved to the cache. Further, the file scanning device of the client will periodically start again to obtain the file status of the success or failure transmission of the file data. If the file status changes, there may be file data that needs to be retransmitted or the file data has been successfully transmitted and does not need to be transmitted again.

[0087] In an embodiment of the present application, in the case of updating the file status, the file ID of the file data that needs to be retransmitted is determined to transmit the incremental file data corresponding to the file ID to the server, comprising: in the case of updating the file status, if the file status transmission is successful, the current file data is filtered; and in the case of updating the file status, if the file status transmission fails, the incremental file data corresponding to the file ID is transmitted to the server.

[0088] When the client file sending is completed, the file status in the cache is updated, i.e. the correspondence between the file ID and the file status. If the result obtained is that the file status transmission is successful, the current file data is filtered. If the result obtained is that the file status transmission fails, the incremental file data corresponding to the file ID is transmitted to the server, at which time it is considered that the incremental file data corresponding to the file ID needs to be retransmitted. The "incremental file data" refers to a new file or an old file with changed file content. In addition, in addition to the incremental file data, the transmission failure of the data may also be caused by the transmission protocol or network problem between the client and the server, so the file data corresponding to the file ID needs to be retransmitted.

[0089] Through the above method, in the file transmission device of the client, the states of the transmitted files (including transmission success and transmission failure) are cached. The file scanning device of the client scans the files by referring to the file status information, and the file sending device of the client also updates the file status after transmitting the files.

[0090] In an embodiment of the present application, the method further comprises transmitting the file data to the server based on a self-defined transmission protocol, and the self-defined transmission protocol is used to implement in the operation and maintenance scene of the data center.

[0091] Considering the unique nature of data center operations, particularly in the financial sector where systems typically transmit data over internal networks, a custom socket protocol is used between the client and server to ensure data transmission security and compatibility across different systems. The client first connects to the server; after protocol authentication and permission verification, the server performs the actual file transfer. Upon successful transfer, the client updates the file status in its cache. If the transfer fails, a scheduled retransmission is performed until successful. After receiving the file, the server sends an asynchronous notification, which third-party systems can use for subsequent logic processing.

[0092] It is understood that the socket protocol is merely an example of a file data transmission protocol and is not intended to be included within the scope of protection of this application's embodiments. Custom socket protocols are related to specific business needs, and those skilled in the art can configure the transmission interface and protocol according to the actual usage scenario.

[0093] In one embodiment of this application, the method further includes synchronously pushing an asynchronous message to a third-party associated system in response to an asynchronous notification request submitted by the file receiving device.

[0094] Asynchronous notification refers to treating file transfer as an independent method and system, providing a timely and decoupled notification function after each successful file transfer to inform related systems for subsequent processing. Asynchronous notification typically includes, but is not limited to, providing a RESTful API and pushing messages to a Kafka message queue. It can be understood that "third-party related systems" refers to collaborative systems that need to synchronously obtain file data status, such as off-exchange transaction systems.

[0095] Using the method described above, asynchronous notifications can be sent to third-party systems upon completion of each file transfer, allowing these systems to perform subsequent logical processing. Unlike related technologies that use file data transfer protocols that cannot meet cross-platform compatibility and asynchronous notification requirements, the method described above fully satisfies these needs without any modifications or customizations.

[0096] Unlike related technologies that involve security risks due to direct or passwordless transmission, the above method utilizes a custom transmission protocol developed in Java, without relying on specific operating system features. This ensures cross-platform compatibility across multiple operating systems.

[0097] like Figure 3 As shown, an embodiment of this application also provides a file transfer method, wherein the method includes:

[0098] Step S310, receiving, by the file receiving device, the file data of the data center sent by the file sending device of the client.

[0099] The file receiving device of the server receives the file data of the data center sent by the file sending device of the client. After receiving the sending request of the client, the file receiving device of the server performs permission verification and other operations according to the configuration, and then starts to receive the file. After the file is received, the file receiving device of the server performs file integrity verification and executes asynchronous notification.

[0100] Step S320, returning the receiving result of the file data to the file sending device of the client to update the file state of the file data in the cache.

[0101] The server returns the receiving result of the file data to the file sending device of the client to update the file state of the file data in the cache. In this way, the client saves the file state and the file ID of the file data to the cache according to the sending result of the file sending device, such as success or failure. The file state in the cache is determined according to the sending result of the file sending device of the client, and whether the file ID changes is monitored by the scanning device of the client.

[0102] Step S330, in response to the file state of the file data, receiving the incremental file data corresponding to the file ID of the file data that needs to be retransmitted.

[0103] The server can continue to receive the incremental file data according to the file state of the file data. The incremental file data is the incremental file data corresponding to the file ID of the file data that needs to be retransmitted.

[0104] The application also provides a file transmission device 400, as shown in the accompanying drawings, a structural schematic diagram of the file transmission device in the application is provided, and the file transmission device 400 at least comprises a first response module 410, a transmission module 420, a second response module 430 and a determination module 440, wherein: Figure 4

[0105] In one embodiment of the application, the first response module 410 is specifically used for starting the file scanning device to obtain the file ID of the file data in the current directory in response to the file data transmission instruction of the data center.

[0106] ​The file transmission process refers to the process of transmitting a file from one computer system to another computer system, usually the process of transmitting a file from a client to a server. There are a large number of file backup and file recovery needs in data center operation scenarios. For example, off-site backup and recovery of databases. Data backup is needed between databases deployed in different regions, and data recovery is needed when data anomalies occur. If new file data or old file data with changed content cannot be found and transmitted in time during the file transmission process, the operation and maintenance cost is increased.

[0107] The client starts a file scanning device in the client according to the file data transmission instruction of the data center, to obtain the file ID of the file data under the current directory. The "file data transmission instruction" includes but is not limited to the process of transmitting a plurality of or a certain file data from the client to the server.

[0108] The file scanning device is deployed in the client and is mainly used for periodically scanning (caching) to obtain the file ID of the file data under the specified directory. The file ID serves as a unique identifier of the file data and can be used to distinguish different file data.

[0109] In an embodiment of the present application, the transmission module 420 is specifically configured to transmit the file data to a file sending device according to the file ID of the file data.

[0110] The client selects the file data that needs to be transmitted according to the file ID of the file data, and transmits the file data to the file sending device in the client. The file sending device is used to receive the file data that needs to be transmitted determined according to the file ID and sent by the file scanning device.

[0111] It can be understood that the file ID can be used to filter the successfully transmitted files, so as to determine the files that need to be transmitted and have not been successfully transmitted. Preferably, an operation and maintenance table of the file ID and the file data is established, so that the file data corresponding to the file ID can be quickly queried and located.

[0112] In an embodiment of the present application, the second response module 430 is specifically configured to save the file state and the file ID of the file data to the cache in response to the sending result of the file sending device.

[0113] The client saves the file state and the file ID of the file data to the cache according to the sending result of the file sending device, such as success or failure. The file state in the cache is determined according to the sending result of the file sending device of the client, and whether the file ID changes is obtained by monitoring the scanning device of the client.

[0114] It can be understood that the cache includes but is not limited to a local Ehcache cache or a Redis cache.

[0115] In an embodiment of the present application, the determining module 440 is specifically configured to determine the file ID of the file data that needs to be retransmitted in the case of the file status update, so as to transmit the incremental file data corresponding to the file ID to the server.

[0116] The client determines the file ID of the file data that needs to be retransmitted in the case of the file status update, so as to find the corresponding incremental file data through the file ID and transmit the incremental file data to the server.

[0117] In an embodiment of the present application, the second response module 430 is further configured to

[0118] According to the file data transmission instruction of the data center, a specified directory is obtained; a file scanning device is started to monitor the file ID of the file data in each file in the specified directory, the file ID being composed of the file full path, the file size and the file last modification time; the file ID is used as unique identification of file information, and when any one of the file ID changes, it is regarded as a new file or a file update and is transmitted to the file sending device.

[0119] In an embodiment of the present application, the second response module 430 is further configured to

[0120] When the sending result of the file sending device is transmission success or failure, the file status of the success or failure transmission of the file data is updated, and the updated file status and file ID are saved to the cache; the file scanning device is started again to obtain the file status of the success or failure transmission of the file data.

[0121] In an embodiment of the present application, the determining module 440 is further configured to

[0122] In the case of the file status update, if the file status transmission is successful, the current file data is filtered; in the case of the file status update, if the file status transmission fails, the incremental file data corresponding to the file ID is transmitted to the server.

[0123] In an embodiment of the present application, further comprising a transmission module configured to

[0124] The file sending device transmits the file data to the server based on a self-defined transmission protocol, and the self-defined transmission protocol is used to realize in the operation and maintenance scene of the data center.

[0125] In an embodiment of the present application, further comprising an asynchronous module configured to

[0126] In response to the asynchronous notification request submitted by the file receiving device, the asynchronous message is synchronously pushed to the third-party contact system.

[0127] It can be understood that the file transmission device can realize each step of the file transmission method provided in the foregoing embodiments, and the related explanations about the file transmission method are all applicable to the file transmission device, which will not be described here again.

[0128] As shown in Figure 5 , it is a business process of the file transmission method in the embodiment of the present application, which includes a file scanning device, a file state management, a file sending device, a file receiving device, and an asynchronous notification state.

[0129] The file scanning device deployed on the client: all files under the directory are uniquely coded, the monitored directory of the client is scanned, and the file state management is compared with each file state to timely filter out new files or files with changed content, and the incremental files found are submitted to the file sending device for subsequent logical processing.

[0130] The file sending device deployed on the client: including a to-be-sent queue, a file sending component, and a file state updating component. The to-be-sent queue sequentially stores the to-be-transmitted tasks submitted by the file scanning device; the file sending component extracts the tasks from the to-be-sent queue, connects the server according to the target address, target port, receiving directory, transmission speed limit, file integrity check identifier, and permission check of the basic configuration parameters, sends the file, and calculates the transmission progress in real time; after the file transmission is completed, the file state updating component updates the file state to the file state management.

[0131] The file receiving device deployed on the server: after receiving the sending request from the client, the server file receiving device first performs permission check and other operations according to the configuration, then starts receiving the file, performs file integrity check after the receiving is completed, and executes asynchronous notification.

[0132] The file state management on the client: the transmitted files (including transmission success and transmission failure) are cached, and the file scanning device scans the files by referring to the file state information; in addition, the file state is updated after the file sending device on the client sends the file.

[0133] The asynchronous notification on the client: after receiving the asynchronous notification request submitted by the file receiving device, the asynchronous notification is pushed to let the third-party contact system know in time for the next step.

[0134] Figure 6 It is a structural schematic diagram of an electronic device of an embodiment of the present application. Please refer to Figure 6At the hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The memory can include a memory such as a random-access memory (RAM), and can further include a non-volatile memory such as at least one disk memory. Of course, the electronic device can further include other hardware required by a business.

[0135] The processor, the network interface, and the memory can be connected to each other through the internal bus, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, and a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0136] The memory is used to store a program. Specifically, the program can include program code including computer operation instructions. The memory can include a memory and a non-volatile memory, and provide instructions and data to the processor.

[0137] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms a file transmission device at the logical level. The processor executes the program stored in the memory, and is specifically used to perform the following operations:

[0138] In response to a file data transmission instruction of the data center, the file scanning device is started to obtain a file ID of file data under a current directory;

[0139] According to the file ID of the file data, the file data is transmitted to the file sending device;

[0140] In response to a sending result of the file sending device, a file state and a file ID of the file data are saved to a cache;

[0141] In the case of updating the file state, a file ID of file data that needs to be retransmitted is determined, and incremental file data corresponding to the file ID is transmitted to the server.

[0142] Or,

[0143] The file receiving device receives file data of the data center sent by the file sending device of the client;

[0144] The receiving result of the file data is returned to the file sending device of the client to update the file state of the file data in the cache;

[0145] In response to the file state of the file data, the incremental file data corresponding to the file ID of the file data that needs to be retransmitted is received. Figure 2 Or Figure 3 The method performed by the file transmission device disclosed in the embodiments of the present application can be applied to a processor or implemented by the processor. The processor can be an integrated circuit chip with processing capability. In the implementation process, the steps of the above method can be completed by the integrated logic circuit or the instruction of the software form in the processor. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method.

[0146] The electronic device can also perform the method performed by the file transmission device in Figure 2 Or Figure 3 and realize the functions of the file transmission device in Figure 2 Or Figure 3 the embodiments shown in the present application. The embodiments of the present application will not be repeated here.

[0147] The embodiment of the present application further provides a computer readable storage medium, which stores one or more programs, and the one or more programs comprise instructions, which, when executed by an electronic device comprising a plurality of application programs, can enable the electronic device to perform the method executed by the file transmission device in the embodiment shown in the drawings, and specifically perform the following steps: Figure 2 or Figure 3 the method executed by the file transmission device in the embodiment shown in the drawings, and specifically perform the following steps:

[0148] In response to a file data transmission instruction of the data center, starting a file scanning device to acquire a file ID of file data under a current directory;

[0149] According to the file ID of the file data, transmitting the file data to a file sending device;

[0150] In response to a transmission result of the file sending device, saving a file state and the file ID of the file data to a cache;

[0151] In the case of updating the file state, determining a file ID of file data that needs to be retransmitted, and transmitting incremental file data corresponding to the file ID to a server.

[0152] or

[0153] Through a file receiving device, receiving file data of the data center transmitted by a file sending device of a client;

[0154] Returning a receiving result of the file data to the file sending device of the client, so as to update a file state of the file data in the cache;

[0155] In response to the file state of the file data, receiving incremental file data corresponding to a file ID of file data that needs to be retransmitted.

[0156] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0157] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0158] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0159] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0160] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0161] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.

[0162] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0163] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0164] Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system or computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.

[0165] The above description is only an embodiment of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims

1. A file transfer method, wherein, The method is applied to a client in an operation and maintenance scene of a data center, and comprises the following steps: In response to a file data transmission instruction of the data center, a file scanning device is started to obtain a file ID of file data under a current directory; According to the file ID of the file data, the file data is transmitted to a file sending device; In response to a sending result of the file sending device, a file state and the file ID of the file data are saved to a cache; The step of starting the file scanning device to obtain the file ID of the file data under the current directory in response to the file data transmission instruction of the data center comprises the following steps: A specified directory is obtained according to the file data transmission instruction of the data center; The file scanning device is started to monitor a file ID of file data in each file under the specified directory, the file data being composed of a file full path, a file size and a file last modification time; The file ID is used as unique identification of file information, and when any item in the file ID changes, it is regarded as a new file or an updated file and is transmitted to the file sending device; When the sending result of the file sending device is transmission success or failure, a file state of successful or failed transmission of the file data is updated, and the updated file state and the file ID are saved to the cache; The file scanning device is started again to obtain the file state of successful or failed transmission of the file data; In the case of file state update, a file ID of file data that needs to be retransmitted is determined, so that incremental file data corresponding to the file ID is transmitted to a server; In the case of file state update, if the file state transmission is successful, the current file data is filtered; In the case of file state update, if the file state transmission fails, the incremental file data corresponding to the file ID is transmitted to the server.

2. The method of claim 1, wherein, The method further comprises the following steps: The file sending device transmits the file data to the server based on a self-defined transmission protocol, and the self-defined transmission protocol is used to implement the operation and maintenance scene of the data center.

3. The method of claim 2, wherein, The method further comprises the following steps: In response to an asynchronous notification request submitted by a file receiving device, an asynchronous message is synchronously pushed to a third-party association system.

4. A file transfer apparatus, wherein, The device is applied to a client in an operation and maintenance scene of a data center, and comprises the following steps: A first response module is configured to start a file scanning device to obtain a file ID of file data under a current directory in response to a file data transmission instruction of the data center; A transmission module is configured to transmit the file data to a file sending device according to the file ID of the file data; A second response module is configured to save a file state and the file ID of the file data to a cache in response to a sending result of the file sending device; The step of starting the file scanning device to obtain the file ID of the file data under the current directory in response to the file data transmission instruction of the data center comprises the following steps: A specified directory is obtained according to the file data transmission instruction of the data center; The file scanning device is started to monitor a file ID of file data in each file under the specified directory, the file data being composed of a file full path, a file size and a file last modification time; The file ID is used as unique identification of file information, and when any item in the file ID changes, it indicates that a new file appears or a file is updated, and is transmitted to the file sending device; When the sending result of the file sending device is successful or failed, the file state of the successful or failed transmission of the file data is updated, and the updated file state and file ID are saved to the cache; The file scanning device is started again to obtain the file state of the successful or failed transmission of the file data; A determining module is configured to determine the file ID of the file data that needs to be retransmitted in the case of file state update, so as to transmit the incremental file data corresponding to the file ID to the server; In the case of file state update, if the file state transmission is successful, the current file data is filtered; In the case of file state update, if the file state transmission fails, the incremental file data corresponding to the file ID is transmitted to the server. 5.An electronic device, comprising: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1-3. 6.A computer readable storage medium storing one or more programs, the one or more programs, when executed by an electronic device including multiple applications, causing the electronic device to perform the method of any of claims 1-3.

Citation Information

Patent Citations

  • File updating method and transmission system

    CN101360127A

  • Trusted file transfer method and system

    CN109309730A

  • Business file updating method and system of file server and related components

    CN112612763A