File transmission method and device, computer device, readable storage medium and program product
By selecting the source storage device based on the storage device status for file verification and synchronization in a low-code platform, the problems of duplicate uploads and information leakage in multi-user, multi-device file synchronization are solved, achieving efficient and secure file transfer.
Patent Information
- Application Number
- CN202411754538.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-12-02
AI Technical Summary
In low-code platforms, when multiple users view and modify files on multiple devices, issues such as duplicate uploads, asynchronous file content, and information leakage arise, affecting user experience and posing information security risks.
The scheduling device selects the source storage device based on the usage status of the storage device, performs file verification and storage, and adds the file to the synchronization queue under certain conditions, synchronizing it to the target storage device in real time or with a delay. The distributed architecture is used to achieve encrypted synchronization of files between multiple devices.
It improves the efficiency and security of low-code application file synchronization, reduces repetitive work and errors caused by file inconsistencies, ensures the continuity and reliability of the synchronization process, and enhances the user experience and security.
Smart Images

Figure CN119652882B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data transmission, and in particular to a file transmission method and device, a computer device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] In a low-code platform, a designer can upload various types of attachments in a page of a low-code application, and a user of the low-code application can preview and download the attachments when opening the application.
[0003] Since the low-code application can be viewed and modified by multiple users on multiple terminals, there may be problems such as repeated uploading and unsynchronized file contents, and there may be information leakage problems in the transmission process. These factors will affect the user experience and have information security risks. SUMMARY
[0004] Therefore, it is necessary to provide an efficient, flexible and secure document transmission method, device, computer device, computer readable storage medium and computer program product to solve the above technical problems.
[0005] In a first aspect, the present application provides a file transmission method applied to a source storage device, comprising:
[0006] In a case of establishing a connection with a terminal, a file uploaded by the terminal is received; wherein the source storage device is selected from a plurality of storage devices by a scheduling device according to a usage state of each storage device; the usage state includes at least one of a load or an available space;
[0007] The file is verified, and a file that passes the verification is stored; wherein the storage mode includes direct storage or block storage.
[0008] In one embodiment, the method further comprises:
[0009] The file is added to a synchronization queue;
[0010] In a case of meeting a file synchronization condition, the content in the synchronization queue is sent to a target storage device to instruct the target storage device to synchronize and store the corresponding content, and a synchronization confirmation message is returned; the file synchronization condition includes a file change or a current delay file synchronization task to be executed, the file change includes storage of a newly uploaded file, and the content in the synchronization queue includes a file and file change information;
[0011] The synchronization confirmation message is received, a synchronization state record is updated, and the synchronization state record is sent to the scheduling device.
[0012] In one of the embodiments, the method further comprises:
[0013] In the process of file synchronization with the target storage device, a connection detection message is sent to the target storage device;
[0014] In the case where no connection normal message returned by the target storage device for the connection detection message is received, the file synchronization process between the target storage device is interrupted, and interruption information is recorded;
[0015] The target storage device is reselected from the remaining storage devices, and file synchronization is performed with the reselected target storage device.
[0016] In one of the embodiments, the method further comprises:
[0017] In the case where the connection between the target storage device corresponding to the interruption information is resumed, the corresponding file synchronization process is resumed based on the interruption information.
[0018] In a second aspect, the application further provides a file transmission method applied to a target storage device, comprising:
[0019] Receiving content sent by a source storage device based on a synchronization queue, and synchronously storing the corresponding content; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition includes file change or current need to perform a delayed file synchronization task, and the file change includes storing a newly uploaded file; the content in the synchronization queue includes a file and file change information;
[0020] Returning a synchronization confirmation message to the source storage device, the synchronization confirmation message being used to instruct the source storage device to update a synchronization state record and send the synchronization state record to a scheduling device.
[0021] In one of the embodiments, the method further comprises:
[0022] In the process of file synchronization with the source storage device, a connection detection message sent by the source storage device is received;
[0023] In the case where the connection between the source storage device is normal, a connection normal message is returned to the source storage device, the connection normal message being used to instruct the source storage device to continue to perform the file synchronization process;
[0024] In the case where the connection between the source storage device is abnormal, resulting in that the source storage device does not receive the connection normal message, the file synchronization process between the source storage device is interrupted.
[0025] In one of the embodiments, the method further comprises:
[0026] updating the synchronously stored content to the local file system and database.
[0027] In a third aspect, the present application provides a file transmission device applied to a source storage device, the device comprising:
[0028] a receiving module configured to receive a file uploaded by a terminal in a case where a connection is established with the terminal; wherein the source storage device is selected from a plurality of storage devices by a dispatch device according to a usage state of each storage device; the usage state comprises at least one of a load or an available space;
[0029] a storage module configured to check the file and store a file that passes the check; wherein the storage mode comprises direct storage or block storage.
[0030] In a fourth aspect, the present application provides a file transmission device applied to a target storage device, the device comprising:
[0031] a receiving module configured to receive content sent by a source storage device based on a synchronization queue and synchronously store corresponding content; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition comprises a file change or a current need to perform a delayed file synchronization task, the file change comprising storage of a newly uploaded file, and the content in the synchronization queue comprising a file and file change information;
[0032] a sending module configured to return a synchronization confirmation message to the source storage device, the synchronization confirmation message being used to instruct the source storage device to update a synchronization state record and send the synchronization state record to a dispatch device.
[0033] In a fifth aspect, the present application provides a computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the first aspect or the second aspect when executing the computer program.
[0034] In a sixth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the first aspect or the second aspect.
[0035] In a seventh aspect, the present application provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the steps of the first aspect or the second aspect.
[0036] The file transmission method, device, computer equipment, computer readable storage medium and computer program product, first, in the case of establishing a connection with the terminal, receiving the file uploaded by the terminal; wherein the source storage device is selected from a plurality of storage devices by the scheduling device according to the use state of each storage device; the use state includes at least one of the load or the available space; the file is checked, and the file that passes the check is stored; wherein the storage mode includes direct storage or block storage. In this way, the source storage device is selected from a plurality of storage devices, and the encryption synchronization of the file between multiple terminals is realized through a distributed architecture, which effectively improves the efficiency and security of the low-code application synchronization file process. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0038] Figure 1 The application environment diagram of the file transmission method in an embodiment;
[0039] Figure 2 The flowchart of the file transmission method in an embodiment;
[0040] Figure 3 The flowchart of the file synchronization upload in an embodiment;
[0041] Figure 4 The flowchart of the file synchronization method in an embodiment;
[0042] Figure 5 The structural block diagram of the file transmission device applied to the source storage device in an embodiment;
[0043] Figure 6 The structural block diagram of the file transmission device applied to the target storage device in an embodiment;
[0044] Figure 7 The internal structure diagram of the computer equipment in an embodiment. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0046] The file transmission method provided by the embodiments of the present application can be applied to the application environment as shown in Figure 1 The source storage device 102 and the target storage device 104 communicate with the server 106 through a network. The source storage device is only one, and the number of target storage devices can be multiple. The data storage system can store data required to be processed by the server 106. The data storage system can be integrated on the server 106, or placed on the cloud or other network servers. The source storage device 102 and the target storage device 104 can be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 106 can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0047] In an exemplary embodiment, as shown in Figure 2 A file transmission method is provided. Taking the source storage device 102 in Figure 1 as an example, the method includes the following steps 202 to 204. Wherein:
[0048] Step 202, receiving a file uploaded by a terminal in a connection established with the terminal; wherein the source storage device is selected from multiple storage devices by a scheduling device according to the usage state of each storage device; the usage state includes at least one of load or available space.
[0049] In some embodiments, the connection with the terminal is established, and the file uploaded by the terminal, i.e., the file to be synchronized, is received.
[0050] Further, the source storage device is a storage device selected by a scheduling server on the scheduling device according to the usage state of each storage device. The usage state includes at least one of the load or available space of the storage device; the load refers to the workload or burden borne by the storage device.
[0051] Step 204, verifying the file, and storing the file that passes the verification; wherein the storage mode includes direct storage or block storage.
[0052] In some embodiments, the source storage device will verify the file to be synchronized, and store the file that passes the verification to the local database.
[0053] In the storage process, the entire file can be stored completely or the file can be stored in blocks according to specific storage requirements.
[0054] In the file transmission method, the file uploaded by the terminal is received in the case of establishing a connection with the terminal. The source storage device is selected from a plurality of storage devices by the scheduling device according to the usage state of each storage device. The usage state includes at least one of the load or the available space. The file is verified, and the file that passes the verification is stored. The storage mode includes direct storage or block storage. In this way, the source storage device is selected from a plurality of storage devices, and the encrypted synchronization of the file between multiple terminals is realized through a distributed architecture, effectively improving the efficiency and security of the low-code application synchronization file process.
[0055] In an exemplary embodiment, the file transmission method further comprises: adding the file to the synchronization queue; in the case of meeting the file synchronization condition, sending the content in the synchronization queue to the target storage device to instruct the target storage device to synchronize the storage of the corresponding content, and returning a synchronization confirmation message; the file synchronization condition includes that the file is changed or the current needs to perform a delayed file synchronization task, the file change includes storing a newly uploaded file, and the content in the synchronization queue includes the file and the file change information; receiving the synchronization confirmation message, updating the synchronization state record, and sending the synchronization state record to the scheduling device.
[0056] In actual implementation, after receiving the synchronization file, the source storage device stores the synchronization file and the metadata information of the synchronization file in the local database according to the preset rules. After the storage is completed, the synchronization file is added to the synchronization queue. When the file upload is completed, the file is modified, or the file needs to be synchronized, the content in the synchronization queue is sent to the target storage device to instruct the target storage device to synchronize the storage of the corresponding content, and a synchronization confirmation message is returned. The metadata information includes the file name, size, type, storage path, and a series of information related to the synchronization file. The content in the synchronization queue includes the synchronization file, the metadata information of the synchronization file, and the change information of the synchronization file.
[0057] Further, the source storage device receives the synchronization confirmation message, updates the synchronization state record, and sends the synchronization state record to the scheduling device.
[0058] In the above embodiment, by synchronizing the file of the source storage device to the target storage device in real time, the repeated work and errors caused by inconsistent files are reduced, and the work efficiency is improved.
[0059] In some example embodiments, the file transmission method further comprises: sending a connection detection message to the target storage device in the process of file synchronization with the target storage device; in the case that a connection normal message returned by the target storage device for the connection detection message is not received, interrupting the file synchronization process between the source storage device and the target storage device, and recording interruption information; reselecting a target storage device from the remaining storage devices, and performing file synchronization with the reselected target storage device.
[0060] In actual implementation, the source storage device sends a connection detection message to the target storage device every interval of a preset time in the process of file synchronization with the target storage device. When a connection normal message returned by the target storage device for the connection detection message is not received, the file synchronization process between the source storage device and the target storage device is interrupted, and interruption information is recorded. The interruption information can be information related to subsequent continuous transmission, such as the transmission progress of the file, and the example embodiments of the present application do not limit this.
[0061] For example, the file interruption can be caused by network failure or the like.
[0062] Further, the file synchronization with the remaining target is continued.
[0063] In the above example embodiments, the continuity and reliability of the synchronization process are ensured by uninterrupted connection normal confirmation between the source storage device and the target storage device.
[0064] In some example embodiments, the file transmission method further comprises: in the case that the connection between the source storage device and the target storage device corresponding to the interruption information is restored, resuming the execution of the corresponding file synchronization process based on the interruption information.
[0065] In actual implementation, when the source storage device is restored to the target storage device corresponding to the interruption information, the synchronization process of the corresponding target storage device is continued based on the recorded interruption information.
[0066] In the above example embodiments, the source storage device continues to synchronize files on the corresponding target storage device in the case of interruption recovery, thereby ensuring the integrity of the entire synchronization process.
[0067] In some example embodiments, the file transmission method comprises: receiving content sent by a source storage device based on a synchronization queue, and synchronizing the corresponding content; wherein the synchronization process is initiated by the source storage device based on file synchronization conditions; the file synchronization conditions include file change or current need to perform a delayed file synchronization task, the file change includes storage of newly uploaded files, and the content in the synchronization queue includes files and file change information; returning a synchronization confirmation message to the source storage device, the synchronization confirmation message being used to instruct the source storage device to update a synchronization state record, and sending the synchronization state record to a scheduling device.
[0068] In actual implementation, the target storage device receives the content sent by the source storage device based on the synchronization queue, and synchronously stores the corresponding content. After the storage is completed, a synchronization confirmation message is returned to the source storage device, which is used to instruct the source storage device to update the synchronization state record and send the synchronization state record to the scheduling device.
[0069] In the above embodiment, the content sent by the source storage device based on the synchronization queue is received, and the corresponding content is synchronously stored; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition includes that a file is changed or a delay file synchronization task needs to be performed at present, the file is changed includes that a newly uploaded file is stored, and the content in the synchronization queue includes a file and file change information; a synchronization confirmation message is returned to the source storage device, which is used to instruct the source storage device to update the synchronization state record and send the synchronization state record to the scheduling device. In this way, the encryption synchronization of the file between multiple target storage devices is realized through a distributed architecture, and the efficiency and security of the low-code application synchronization file process are effectively improved.
[0070] In some exemplary embodiments, the file transmission method further includes: in the process of file synchronization with the source storage device, receiving a connection detection message sent by the source storage device; in the case that the connection between the source storage device is normal, returning a connection normal message to the source storage device, the connection normal message being used to instruct the source storage device to continue to perform the file synchronization process; in the case that the connection between the source storage device is abnormal, resulting in that the source storage device does not receive the connection normal message, the file synchronization process between the source storage device is interrupted.
[0071] In actual implementation, the target storage device receives a connection detection message sent by the source storage device in the process of file synchronization with the source storage device; in the case that the connection between the source storage device is normal, a connection normal message is returned to the source storage device. In the case that the connection between the source storage device is abnormal, resulting in that the source storage device does not receive the connection normal message, the file synchronization process between the target storage device and the source storage device is interrupted.
[0072] In the above embodiment, the connection detection information sent by the source storage device is received every preset time, and the fault is discovered and processed in time.
[0073] In some exemplary embodiments, the file transmission method includes: updating the synchronously stored content to the local file system and the database.
[0074] In some embodiments, when the target storage device receives the synchronously stored content, the synchronously stored content is updated to the local file system and the database.
[0075] In the above embodiments, by storing the synchronized content to the database local to the target storage device, it is more convenient to call when the target storage device needs to use the synchronized file.
[0076] In some exemplary embodiments, the above file transmission method can also be applied to a terminal, and a specific file uploading process is shown in Figure 3 .
[0077] Exemplarily, the terminal obtains a file to be uploaded in response to a file uploading operation. The terminal sends a file uploading request to a scheduling device to instruct the scheduling server to determine IP address and port information of a storage server as an uploading target.
[0078] The terminal receives IP address and port information of the source storage device returned by the scheduling device, establishes a connection with the source storage device according to the IP address and port information, uploads the file to the source storage device to instruct the source storage device to store the file and generate a corresponding file identifier, and receives the file identifier returned by the source storage device when the source storage device successfully stores the file.
[0079] In some embodiments, the above file transmission method can also be applied to the scheduling device.
[0080] Exemplarily, the scheduling device receives a file uploading request sent by a terminal. The scheduling device selects a source storage device from a plurality of storage devices according to a usage state of each storage device, the usage state including at least one of a load or available space. The scheduling device sends corresponding IP address and port information of the source storage device to the terminal to instruct the terminal to establish a connection with the source storage device and send a file to be uploaded to the source storage device for file uploading.
[0081] To describe the file transmission method in the present application in detail, an embodiment is described below. Exemplarily, the present application describes a file transmission method in a specific file transmission scenario.
[0082] First, the terminal obtains a file to be uploaded in response to a file uploading operation. The terminal sends a file uploading request to a scheduling device to instruct the scheduling server to determine IP address and port information of a storage server as an uploading target.
[0083] The scheduling device receives a file uploading request sent by a terminal. The scheduling device selects a source storage device from a plurality of storage devices according to a usage state of each storage device, the usage state including at least one of a load or available space. The scheduling device sends corresponding IP address and port information of the source storage device to the terminal to instruct the terminal to establish a connection with the source storage device and send a file to be uploaded to the source storage device for file uploading.
[0084] receive the IP address and port information of the source storage device returned by the scheduling device, establish a connection with the source storage device according to the IP address and port information, upload the file to the source storage device to instruct the source storage device to store the file, and generate a corresponding file identifier; when the source storage device successfully stores the file, receive the file identifier returned by the source storage device.
[0085] The specific synchronization process is shown in FIG. 2. After receiving the synchronization file, the source storage device stores the synchronization file and the metadata information of the synchronization file in the local database according to a preset rule. After the storage is completed, the synchronization file is added to the synchronization queue. When the file uploading is completed, the file is modified, or the synchronization file needs to be delayed, the content in the synchronization queue is sent to the target storage device to instruct the target storage device to synchronously store the corresponding content, and a synchronization confirmation message is returned. Figure 4
[0086] Further, the source storage device receives the synchronization confirmation message, updates the synchronization state record, and sends the synchronization state record to the scheduling device.
[0087] During the file synchronization process between the source storage device and the target storage device, the source storage device sends a connection detection message to the target storage device at a preset interval. When no connection normal message returned by the target storage device for the connection detection message is received, the file synchronization process between the source storage device and the target storage device is interrupted, and interruption information is recorded, and the file synchronization process with the remaining target is continued.
[0088] When the source storage device recovers the target storage device corresponding to the interruption information, the source storage device continues to perform the synchronization process of the corresponding target storage device according to the recorded interruption information.
[0089] The target storage device receives the content sent by the source storage device based on the synchronization queue, and synchronously stores the corresponding content. After the storage is completed, a synchronization confirmation message is returned to the source storage device. The synchronization confirmation message is used to instruct the source storage device to update the synchronization state record, and send the synchronization state record to the scheduling device.
[0090] During the file synchronization process between the source storage device and the target storage device, the target storage device receives the connection detection message sent by the source storage device; in the case that the connection between the source storage device and the target storage device is normal, a connection normal message is returned to the source storage device. In the case that the connection between the source storage device and the target storage device is abnormal, resulting in that the source storage device does not receive the connection normal message, it is indicated that the file synchronization process between the source storage device and the target storage device is interrupted.
[0091] When the target storage device receives the synchronously stored content, the target storage device updates the synchronously stored content to the local file system and the database.
[0092] The present application optimizes system performance by intelligently selecting a synchronization strategy, such as real-time synchronization, timed synchronization, or on-demand synchronization, according to various factors.
[0093] By constructing an efficient, flexible, and reliable architecture, real-time, accurate, and secure synchronization of files between multiple terminals is achieved. Users can perform file operations on multiple terminals without worrying about information leakage in the files, effectively improving the operation experience and security of low-code applications.
[0094] It should be understood that although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0095] Based on the same inventive concept, the present application also provides a file transmission device for implementing the above-mentioned file transmission method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more file transmission device embodiments provided below can refer to the limitations of the file transmission method in the above text, which will not be repeated here.
[0096] In an exemplary embodiment, as shown in Figure 5 A file transmission device is provided, applied to a source storage device, comprising: a receiving module 501 and a storage module 502, wherein:
[0097] The receiving module is configured to receive a file uploaded by a terminal in a connected state with the terminal; wherein the source storage device is selected from a plurality of storage devices by a scheduling device according to the usage state of each storage device; the usage state includes at least one of load capacity or available space;
[0098] The storage module is configured to verify the file and store the file that passes the verification; wherein the storage mode includes direct storage or block storage.
[0099] In some embodiments, the apparatus further comprises a confirmation module configured to add the file into a synchronization queue; send content in the synchronization queue to the target storage device to instruct the target storage device to synchronize storage of the corresponding content and return a synchronization confirmation message, when a file synchronization condition is met; the file synchronization condition comprises a file change or a current need to perform a delayed file synchronization task, the file change comprises storage of a newly uploaded file, and the content in the synchronization queue comprises the file and file change information; receive the synchronization confirmation message, update a synchronization state record, and send the synchronization state record to the scheduling device.
[0100] In some embodiments, the confirmation module is further configured to, during the file synchronization with the target storage device, send a connection detection message to the target storage device; when no connection normal message returned by the target storage device in response to the connection detection message is received, interrupt the file synchronization process with the target storage device and record interruption information; reselect a target storage device from the remaining storage devices and perform file synchronization with the reselected target storage device.
[0101] In some embodiments, the apparatus further comprises a recovery module configured to, when a connection with the target storage device corresponding to the interruption information is restored, resume the corresponding file synchronization process based on the interruption information.
[0102] In an exemplary embodiment, as shown in Figure 6 FIG. 1, a file transmission apparatus is provided, which is applied to a target storage device and comprises a receiving module 601 and a sending module 602.
[0103] The receiving module is configured to receive content sent by a source storage device based on a synchronization queue and synchronize storage of the corresponding content; the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition comprises a file change or a current need to perform a delayed file synchronization task, the file change comprises storage of a newly uploaded file, and the content in the synchronization queue comprises the file and file change information.
[0104] The sending module is configured to return a synchronization confirmation message to the source storage device, the synchronization confirmation message being used to instruct the source storage device to update a synchronization state record and send the synchronization state record to a scheduling device.
[0105] In some embodiments, the receiving module is further configured to receive a connection detection message sent by the source storage device during the file synchronization process with the source storage device; and return a connection normal message to the source storage device in a case where the connection between the source storage device and the target storage device is normal, the connection normal message being used to instruct the source storage device to continue the file synchronization process. In a case where the connection between the source storage device and the target storage device is abnormal, causing the source storage device to not receive the connection normal message, the file synchronization process between the source storage device and the target storage device is interrupted.
[0106] In some embodiments, the apparatus further comprises an updating module configured to update the synchronized content to the local file system and the database.
[0107] The modules in the file transmission apparatus can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.
[0108] In an exemplary embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 7 The computer device comprises a processor, a memory, an input / output interface (I / O), and a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data of the synchronized file. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a file transmission method.
[0109] The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0110] Those skilled in the art can understand that,Figure 7 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0111] In one exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0112] In the case of establishing a connection with the terminal, receiving a file uploaded by the terminal; wherein the source storage device is selected from a plurality of storage devices by a scheduling device according to a usage state of each storage device; the usage state includes at least one of load capacity or available space;
[0113] Verifying the file, and storing the file that passes the verification; wherein the storage mode includes direct storage or block storage.
[0114] In one embodiment, the processor further implements the following steps when executing the computer program:
[0115] Receiving content sent by the source storage device based on the synchronization queue, and synchronously storing the corresponding content; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition includes a file change or a current need to perform a delayed file synchronization task, the file change includes storing a newly uploaded file, and the content in the synchronization queue includes a file and file change information;
[0116] Returning a synchronization confirmation message to the source storage device, the synchronization confirmation message being used to instruct the source storage device to update a synchronization state record and send the synchronization state record to the scheduling device.
[0117] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0118] In the case of establishing a connection with the terminal, receiving a file uploaded by the terminal; wherein the source storage device is selected from a plurality of storage devices by a scheduling device according to a usage state of each storage device; the usage state includes at least one of load capacity or available space;
[0119] Verifying the file, and storing the file that passes the verification; wherein the storage mode includes direct storage or block storage.
[0120] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0121] The source storage device sends content based on the synchronization queue, and the corresponding content is synchronized; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition includes a file change or a current need to perform a delayed file synchronization task, and the file change includes storing a newly uploaded file; the content in the synchronization queue includes a file and file change information;
[0122] A synchronization confirmation message is returned to the source storage device, and the synchronization confirmation message is used to instruct the source storage device to update a synchronization state record and send the synchronization state record to a scheduling device.
[0123] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the following steps:
[0124] In a case of establishing a connection with a terminal, a file uploaded by the terminal is received; wherein the source storage device is selected from a plurality of storage devices by a scheduling device according to a usage state of each storage device; the usage state includes at least one of a load or an available space;
[0125] The file is checked, and a file that passes the check is stored; wherein the storage mode includes direct storage or block storage.
[0126] In one embodiment, the computer program, when executed by the processor, implements the following steps:
[0127] The source storage device sends content based on the synchronization queue, and the corresponding content is synchronized; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition includes a file change or a current need to perform a delayed file synchronization task, and the file change includes storing a newly uploaded file; the content in the synchronization queue includes a file and file change information;
[0128] A synchronization confirmation message is returned to the source storage device, and the synchronization confirmation message is used to instruct the source storage device to update a synchronization state record and send the synchronization state record to a scheduling device.
[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0131] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0132] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A file transfer method characterized by, The method applied to a source storage device comprises: In a case of establishing a connection with a terminal, receiving a file uploaded by the terminal; wherein the source storage device is selected from a plurality of storage devices by a scheduling device according to a usage state of each storage device; the usage state comprises at least one of a load or an available space; Checking the file, and storing a file whose checking is successful; wherein the storage mode comprises direct storage or block storage; Adding the file to a synchronization queue; Storing the file and metadata information of the file to a local database according to a preset rule, in a case of meeting a file synchronization condition, sending content in the synchronization queue to a target storage device to instruct the target storage device to synchronously store corresponding content, and returning a synchronization confirmation message; the file synchronization condition comprises a file change or a current delay file synchronization task to be executed, the file change comprises storing a newly uploaded file, and the content in the synchronization queue comprises a file and file change information; Receiving the synchronization confirmation message, updating a synchronization state record, and sending the synchronization state record to the scheduling device.
2. The method of claim 1, wherein, The method further comprises: In a process of synchronizing files with the target storage device, sending a connection detection message to the target storage device; In a case of not receiving a connection normal message returned by the target storage device for the connection detection message, interrupting the file synchronization process between the target storage device, and recording interruption information; Re-selecting a target storage device from remaining storage devices, and synchronizing files with the re-selected target storage device.
3. The method of claim 2, wherein, The method further comprises: In a case of resuming a connection with the target storage device corresponding to the interruption information, resuming the corresponding file synchronization process based on the interruption information.
4. A file transfer method characterized by, The method applied to a target storage device comprises: Receiving content sent by a source storage device based on a synchronization queue, and synchronously storing corresponding content; wherein the synchronization process is initiated by the source storage device based on a file synchronization condition; the file synchronization condition comprises a file change or a current delay file synchronization task to be executed, the file change comprises storing a newly uploaded file, and the content in the synchronization queue comprises a file and file change information; Returning a synchronization confirmation message to the source storage device, the synchronization confirmation message being used to instruct the source storage device to update a synchronization state record, and send the synchronization state record to a scheduling device.
5. The method of claim 4, wherein, The method further comprises: In a process of synchronizing files with the source storage device, receiving a connection detection message sent by the source storage device; In a case of a normal connection between the source storage device, returning a connection normal message to the source storage device, the connection normal message being used to instruct the source storage device to continue the file synchronization process; In a case of an abnormal connection between the source storage device, interrupting the file synchronization process with the source storage device.
6. The method of claim 4, wherein, The method further comprises: updating the locally stored content to the file system and the database. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
8. 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 of any one of claims 1 to 6.
9. 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 of any one of claims 1 to 6. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Distributed file synchronization method and device, computer equipment and storage medium
CN112380183A
File storage method and device, computer equipment and storage medium
CN118550879A