CN114745374A - File transmission method and device, electronic equipment and storage medium - Google Patents

File transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114745374A
CN114745374A CN202210652646.2A CN202210652646A CN114745374A CN 114745374 A CN114745374 A CN 114745374A CN 202210652646 A CN202210652646 A CN 202210652646A CN 114745374 A CN114745374 A CN 114745374A
Authority
CN
China
Prior art keywords
transmitted
file
information
fragment
transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210652646.2A
Other languages
Chinese (zh)
Other versions
CN114745374B (en
Inventor
陈立军
陈涛
钟楷锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Barda Technology Co ltd
Original Assignee
Wuhan Sitong Information Service Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Sitong Information Service Co ltd filed Critical Wuhan Sitong Information Service Co ltd
Priority to CN202210652646.2A priority Critical patent/CN114745374B/en
Publication of CN114745374A publication Critical patent/CN114745374A/en
Application granted granted Critical
Publication of CN114745374B publication Critical patent/CN114745374B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The invention discloses a file transmission method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of receiving a fragment transmission request, and acquiring file information, user information, transmission information and fragment information of each file to be transmitted in the plurality of files to be transmitted, then determining a target basic link corresponding to each file to be transmitted according to the server information of the first server, the file information of each file to be transmitted, the user information and the fragment information, generating target fragment signature links of the fragments to be transmitted corresponding to the files to be transmitted according to the transmission event identifications, the file information, the target basic links and the fragment information corresponding to the files to be transmitted, sequentially activating the target fragment signature links according to the user information and the transmission information of the files to be transmitted, and the terminal sequentially transmits the corresponding fragments to be transmitted to the first server through the sequentially activated target fragment signature links. According to the embodiment of the application, the file transmission efficiency in the cloud service is improved.

Description

File transmission method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a file transmission method and apparatus, an electronic device, and a storage medium.
Background
Among the currently used storage technologies, cloud services are one of the most popular storage technologies at present due to the convenience of storage modes and the friendliness to user services.
The main process of file transfer is the decision of user experience in cloud services. Specifically, the file transmission mode in the cloud service is as follows: the method comprises the steps of transmitting files to be uploaded by a user at the front end to a back-end server, uploading the files to a designated file server through the back-end server, and uploading the files through the transfer of the back-end server. However, the file transmission method has many disadvantages, for example, when a failure occurs in the file transmission process of the front end or a network failure occurs in the file transmission process, progress data of file transmission may be lost, so that the whole file transmission needs to be performed again, the efficiency of file transmission in cloud service is seriously affected, and thus the user experience is reduced.
Disclosure of Invention
The embodiment of the invention aims to provide a file transmission method, a file transmission device, electronic equipment and a storage medium, so as to improve the file transmission efficiency in cloud service.
In a first aspect, to achieve the above object, an embodiment of the present invention provides a file transmission method applied in a first server, where the file transmission method includes:
receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
acquiring server information of the first server, and determining a target basic link corresponding to each file to be transmitted according to the server information, file information and user information of each file to be transmitted, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link and the fragment information corresponding to each file to be transmitted, wherein the target fragment signature link is unique;
and sending the target fragment signature link corresponding to each file to be transmitted to a terminal through the second server, and sequentially activating each target fragment signature link according to the user information and the transmission information of each file to be transmitted, so that the terminal sequentially transmits the corresponding fragment to be transmitted to the first server through the sequentially activated target fragment signature links.
Further, the user information includes user level information, the transmission information includes transmission progress information, and the sequentially activating each target fragment signature link according to the user information and the transmission information of each file to be transmitted includes:
if the user level information of the files to be transmitted is the same, determining the priority of the files to be transmitted according to the transmission progress information of the files to be transmitted;
if the user grade information of the files to be transmitted is different, determining the priority of the files to be transmitted according to the user grade information of the files to be transmitted;
and sequentially activating target fragment signature links corresponding to the files to be transmitted according to the priority of the files to be transmitted, wherein the sequential activation is to activate the target fragment signature links corresponding to the next fragments to be transmitted after the transmission of the last fragments to be transmitted is finished.
Further, sequentially activating the target fragment signature link corresponding to each file to be transmitted according to the priority of each file to be transmitted includes:
determining the transmission quantity of the fragments to be transmitted which can be simultaneously transmitted by the first server according to the server information of the first server;
distributing corresponding transmission weight for each file to be transmitted according to the priority of each file to be transmitted;
and distributing the activation denominations with the same transmission quantity to the files to be transmitted according to the transmission weights of the files to be transmitted, and sequentially activating target fragment signature links corresponding to the files to be transmitted containing the activation denominations.
Further, the file transmission method further includes:
acquiring transmission progress information of each file to be transmitted in real time;
and if the transmission progress information does not change within a preset time period, deleting data related to the corresponding file to be transmitted in the first server.
Further, the determining a link in the first server includes a link determining model, the link determining model includes a link feature extractor and a link decision maker, and determining a target basic link corresponding to each file to be transmitted according to the server information, the file information and the user information of each file to be transmitted, and the fragment information of the fragment to be transmitted corresponding to each file to be transmitted includes:
inputting the server information, the file information of each file to be transmitted, the user information and the fragment information of the fragment to be transmitted corresponding to each file to be transmitted to a link characteristic extractor in a link determination model for processing to obtain link characteristic information;
and inputting the link characteristic information into a link decision maker in the link determination model for processing so as to obtain a target basic link corresponding to each file to be transmitted.
Further, the fragment information includes a fragment number and a fragment serial number, where the fragment serial number of each to-be-transmitted fragment in the same to-be-transmitted file is different, and the target fragment signature link of the to-be-transmitted fragment corresponding to each to-be-transmitted file is generated according to the transmission event identifier, the file information, the target base link, and the fragment information corresponding to each to-be-transmitted file, including:
carrying out signature processing on the file information of each file to be transmitted to obtain a file signature identifier of each file to be transmitted;
and carrying out field splicing treatment on the target basic link, the file signature identifier, the transmission event identifier and the fragment serial number of each file to be transmitted to obtain target fragment signature links of each file to be transmitted, wherein the target fragment signature links are the same as the fragments of each file to be transmitted in number, and each target fragment signature link in each file to be transmitted corresponds to one fragment serial number of each file to be transmitted.
Further, the file transmission method further includes:
receiving a file merging request, wherein the file merging request comprises a transmission event identifier of a file to be merged;
determining a target fragment of a file to be merged transmitted by a corresponding target fragment signature link according to the transmission event identifier;
and merging the corresponding target fragments according to the fragment serial numbers in the corresponding target fragment signature links to obtain a merged file, wherein the merged file is the file to be transmitted.
In a second aspect, to solve the same technical problem, an embodiment of the present invention provides a file transmission apparatus, applied to a first server, including:
the first receiving module is used for receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
the first acquisition module is used for acquiring server information of the first server and determining a target basic link corresponding to each file to be transmitted according to the server information, file information and user information of each file to be transmitted and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
the first determining module is used for generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link and the fragment information corresponding to each file to be transmitted, wherein the target fragment signature link is unique;
and the second determining module is used for sending the target fragment signature link corresponding to each file to be transmitted to the terminal through the second server, and sequentially activating each target fragment signature link according to the user information and the transmission information of each file to be transmitted so that the terminal sequentially transmits the corresponding fragment to be transmitted to the first server through the sequentially activated target fragment signature links.
In a third aspect, to solve the same technical problem, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the memory is coupled to the processor, and the processor executes the computer program to implement the steps in the file transfer method described in any one of the above.
In a fourth aspect, to solve the same technical problem, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when the computer program runs, a device in which the computer-readable storage medium is located is controlled to execute the steps in the file transmission method described in any one of the foregoing descriptions.
The embodiment of the invention provides a file transmission method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of obtaining file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to fragment transmission requests, fragment information of fragments to be transmitted corresponding to each file to be transmitted, then determining target basic links corresponding to each file to be transmitted according to server information of a first server, the file information and the user information of each file to be transmitted and the fragment information of the fragments to be transmitted corresponding to each file to be transmitted, generating target fragment signature links of the fragments to be transmitted corresponding to each file to be transmitted according to transmission event identifications, the file information, the target basic links and the fragment information corresponding to each file to be transmitted, and transmitting the corresponding fragments to be transmitted to the first server through the target fragment signature links by the terminal directly, and the transfer is not required to be carried out through a second server, so that the file transmission efficiency in the cloud service is improved. In addition, by transmitting the fragments to be transmitted in the files to be transmitted instead of transmitting the whole files to be transmitted, the data which are transmitted again can be avoided, and the file transmission efficiency in the cloud service is further improved. In addition, according to the user information and the transmission information of each file to be transmitted, the signature links of each target fragment are sequentially activated, and the terminal can sequentially upload the designated fragments to be transmitted, so that the designated files to be transmitted are preferentially transmitted, the file transmission efficiency of the designated files is improved, and the user experience is improved.
Drawings
Fig. 1 is a schematic view of an application scenario of a file transmission method according to an embodiment of the present invention;
FIG. 2 is a simplified flowchart of a file transmission method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a file transmission method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a file transmission method according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a file transfer device according to an embodiment of the present invention;
FIG. 6 is a schematic view of another structure of a document transportation device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the various steps recited in method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
In the related technology, a file transmission mode in the cloud service is mainly to transmit a file which needs to be uploaded by a user at the front end to a back-end server, and then upload the file to a designated file server through the back-end server, so that the file is uploaded through the transfer of the back-end server. However, this way of transferring reduces the efficiency of file transfer.
In order to solve technical problems in the related art, embodiments of the present invention provide a file transmission method, apparatus, server, system, and storage medium. Any file transmission device provided by the embodiment of the invention can be integrated in a corresponding server. The server comprises a first server and a second server, wherein the first server and the second server can be independent physical servers, can also be a server cluster or a distributed system formed by a plurality of physical servers, and can also be cloud servers for providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (content delivery network) and big data and artificial intelligence platforms. For example, the first server is a cloud server providing a cloud database, such as a file server, the file server may be a MonIO file server, and the like, and the second server is a cloud server providing a cloud service, such as a cloud application server.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a file transmission method according to an embodiment of the present invention, where the application scenario includes a first server such as a file server, a second server such as a cloud application server, and a terminal, where the terminal includes but is not limited to a smart phone, a Pad, a wearable device, a robot, a smart television, a smart air conditioner, a smart car device, a Personal Computer (PC), a conference terminal, and the like.
Specifically, as shown in fig. 1, the first server is in communication connection with the second server, the second server is in communication connection with the terminal of the user, and after the terminal obtains the target fragment signature link, the terminal may also be in communication connection with the first server through the target fragment signature link.
Referring to fig. 2 and fig. 3, fig. 2 is a simplified flowchart of a file transmission method according to an embodiment of the present invention, fig. 3 is a flowchart of a file transmission method according to an embodiment of the present invention, the file transmission method according to an embodiment of the present invention includes steps 101 to 104, and specifically, referring to fig. 3 with reference to fig. 2, the method steps in fig. 3 are described below.
Step 101, receiving a file fragment transmission request from a second server, and obtaining file information, user information, transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted.
In this embodiment, please continue to refer to fig. 2, where the received file fragment transmission request is generated by the terminal and transmitted to the first server via the second server, and the specific process includes: the method comprises the steps of firstly obtaining file information of each file to be transmitted and user information of the file to be transmitted in a plurality of files to be transmitted corresponding to file transmission instructions through a terminal, then generating target file summary information (unique MD5 value) of each file to be transmitted by using a summary algorithm such as an MD5 algorithm, and then transmitting the MD5 value of each file to be transmitted to a second server. After receiving the MD5 value, the second server detects whether the MD5 value exists, and returns a first detection result to the terminal (the first detection result represents a detection result whether the MD5 value of each to-be-transmitted file exists in the second server), and after receiving a first detection result representing that the MD5 value does not exist in the second server, the terminal performs fragmentation processing on each to-be-transmitted file, for example, fragments data of each to-be-transmitted file is performed in a data size of 5M/fragment mode (finally, a fragment to be transmitted which does not reach 5M is also used as a to-be-transmitted fragment), obtains fragmentation information of each to-be-transmitted file and each to-be-transmitted fragment, and continues to generate target file digest information (unique MD5 value) of each to-be-transmitted fragment by using an MD5 algorithm. Then the terminal sends the MD5 value of each fragment to be transmitted to the second server for detection, so as to obtain a second detection result returned by the second server (the second detection result represents a detection result of whether the MD5 value of each fragment to be transmitted exists in the second server), and when the MD5 value of the fragment to be transmitted does not exist in the second server, then the transmission information of each file to be transmitted is generated, for example, the MD5 value of the fragments to be transmitted in each file to be transmitted is in the proportion of the number of the fragments to be transmitted in the second server to the total fragments to be transmitted, then generating a file fragment transmission request according to the fragment information, the user information, the file information and the transmission information of the corresponding fragment to be transmitted (i.e. the fragment to be transmitted which is not transmitted), and sending the file fragment transmission request to a second server so that the second server sends the file fragment transmission request to the first server.
The file information includes file size, file name, file type, etc., and the file type may include, but is not limited to, jpg,. doc,. xlsx,. mp4,. wmv, asf, asx, etc., and relates to picture, document, audio, video, etc. User information includes, but is not limited to, user identification, user rating, user identification card, etc. information that may indicate user identity and/or rating or indicate user priority. The user identification includes, but is not limited to, a username. The fragment information includes fragment type, fragment number, fragment sequence number, and the like. The fragment type can represent information such as the importance degree of data in the fragment; the fragment sequence numbers are distributed in sequence, the fragment sequence numbers of the same file to be transmitted are not repeated, for example, the fragment sequence number of the first fragment to be transmitted of the file to be transmitted is 1, the fragment sequence number of the second fragment to be transmitted is 2, and so on, and merging needs to be performed according to the fragment sequence numbers during subsequent merging.
It should be noted that the second server provided in this embodiment is mainly used for storing the fragment summary information of all files that have been successfully transmitted by the terminal, for example, the MD5 value, where the MD5 value of the file to be transmitted or the fragment to be transmitted may be stored in the second server when it is detected that the file to be transmitted or the fragment to be transmitted is completely transmitted, so as to detect whether the file to be transmitted has been transmitted in real time during subsequent file transmission, and avoid transmitting the transmitted file again.
Optionally, after receiving the file fragment transmission request, the first server performs two main operations: triggering fragment uploading initialization operation and generating target fragment signature link operation. The fragment uploading initialization operation is used for telling the first server how many fragments to be transmitted need to be uploaded next, and generating a transmission event identifier uploadID of each file to be transmitted. And the transmission event identifications of the fragments to be transmitted of the same file to be transmitted are the same. And then the transmission event identifier uploadID of each file to be transmitted is sent to the second server, so that the transmission event identifier uploadID of each file to be transmitted is sent to the terminal through the second server.
Step 102, obtaining server information of a first server, and determining a target basic link corresponding to each file to be transmitted according to the server information, file information and user information of each file to be transmitted, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted.
In this embodiment, the target basic link includes an IP, a port, a specific directory, and the like of the first server that stores the file to be transmitted. The first server is connected by IP and port, and the folder in the directory in the corresponding first server is opened by the specific directory. The server information, the file information, the fragment information and the user information can be input into the link determination model to be processed so as to output the target basic link corresponding to the file to be transmitted, or the target basic link corresponding to the file to be transmitted can be generated according to other modes according to the server information, the file information, the fragment information and the user information.
Specifically, the first server includes a link determining model, the link determining model includes a link feature extractor and a link decision maker, and the step of determining the target basic link corresponding to each file to be transmitted according to the server information, the file information and the user information of each file to be transmitted, and the fragment information of the fragment to be transmitted corresponding to each file to be transmitted specifically includes: inputting server information, file information of each file to be transmitted, user information and fragment information of the fragment to be transmitted corresponding to each file to be transmitted into a link characteristic extractor in a link determination model for processing to obtain link characteristic information; and inputting the link characteristic information into a link decision maker in the link determination model for processing so as to obtain a target basic link corresponding to each file to be transmitted.
It can be understood that the sizes of the files are different, the types of the fragments are different, the priorities of the users are different, the information of the servers is different, the IP addresses of the first servers for storing the files to be transmitted, which are determined in the link determination model, may be different, the specific storage paths may also be different, and these factors all affect the final determination of the target basic link.
Wherein the link determination model is pre-trained for direct use. The method for determining the model by training the link specifically comprises the following steps: inputting file information, fragment information and user information of transmission file samples in a file sample set into a link determination model to be trained, wherein the link determination model to be trained is a machine learning model such as a neural network model, each transmission file sample corresponds to a basic link label, and the basic link label comprises a first basic link or a plurality of basic links capable of storing the transmission file samples; processing by using a link characteristic extractor in a link determination model to be trained to obtain sample link characteristic information; inputting the sample link characteristic information into a link decision maker in a link determining model to be trained for processing so as to obtain a sample basic link corresponding to a transmission file sample; calculating the similarity between the sample basic link and the basic link label, and stopping training if the similarity is within a preset similarity range to obtain a link determination model; otherwise, continuing training, and continuously optimizing the model parameters of the link determination model to be trained according to the loss of the training process until convergence. It should be noted that the server information of the first server when the basic link label of the file sample is obtained is substantially the same as the server information when the link determination model to be trained is trained, for example, the sizes of the remaining storage spaces are not different or the same.
And 103, generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link and the fragment information corresponding to each file to be transmitted.
The fragment information comprises the number of fragments and fragment serial numbers, the fragment serial numbers of the fragments to be transmitted in the same file to be transmitted are different, each fragment serial number corresponds to one fragment to be transmitted, each fragment serial number corresponds to one target fragment signature link, and the target fragment signature link is unique.
In this embodiment, the step of generating a target fragment signature link of a fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link, and the fragment information corresponding to each file to be transmitted specifically includes: carrying out signature processing on file information of each file to be transmitted to obtain a file signature identifier of each file to be transmitted; and carrying out field splicing treatment on the target basic links, the file signature identifications, the transmission event identifications and the fragment serial numbers of the files to be transmitted to obtain target fragment signature links of the files to be transmitted, wherein the target fragment signature links are the same as the fragments of the files to be transmitted in number, and each target fragment signature link in each file to be transmitted corresponds to one fragment serial number of each file to be transmitted.
Specifically, the MD5 digest algorithm processing is performed on the file information or the file information is subjected to hash processing to obtain a file signature identifier, the file signature identifier is used for representing a specific file name, the file signature identifier is unique, then the field splicing processing is performed on the target base link, the file signature identifier, the transmission event identifier and one of the fragment serial numbers of each file to be transmitted to obtain a target fragment signature link corresponding to the fragment serial number, and each fragment serial number corresponds to one target fragment signature link to obtain the target fragment signature links with the same number as the fragments. If 6 fragment serial numbers are provided, 6 target fragment signature links are generated, and because the file signature identifier is unique, the 6 target fragment signature links are also unique.
For example, the target fragment signature link of the fragment to be transmitted corresponding to the fragment sequence number of 1 may be http://145.170.34.124:9000/23-45678/cd3abf8-ddde-1653-a05b-4ffd2a1 ebe 1-W.P.S9915.120.12.2019.exe
Figure DEST_PATH_IMAGE002
uploadID= 771234567891011
Figure 737820DEST_PATH_IMAGE002
partnumber = 1. The target fragment signature link respectively represents an IP (Internet protocol) and a port of a first server, directory folder information for storing the fragment to be transmitted, a file signature identifier corresponding to a file name, a transmission event identifier and a fragment sequence number. Where uploadID and partnumber are the corresponding fields, "=" is followed by the value of the corresponding field. It should be noted that for the sake of explanation, some fields and values of the fields in the target fragment signature link are not encrypted, and in some other embodiments, these data may be encrypted to improve security.
Each target fragment signature link is only corresponding to the transmission of a fragment to be transmitted of a corresponding fragment serial number in a specific file to be transmitted, and cannot be used for other purposes, for example, the target fragment signature link cannot be used for the transmission of other fragments to be transmitted, so that the safety of data transmission is ensured.
Optionally, each target fragment signature link is configured with a time to live, when the target fragment signature link is generated or sent, a timer is started to time, if the time to live reaches the time to live, the target fragment signature link is set to be invalid, and after the time is invalid, the target fragment signature link becomes invalid and is not used any more. Different survival times can be set according to the file type of the file to be transmitted, for example, the survival time of the file type of the video class is 10 minutes, the survival time of the file type of the document class is 1 minute, and the like.
And 104, sending the target fragment signature links corresponding to the files to be transmitted to the terminal through the second server, and sequentially activating the target fragment signature links according to the user information and the transmission information of the files to be transmitted so that the terminal sequentially transmits the corresponding fragments to be transmitted to the first server through the sequentially activated target fragment signature links.
In this embodiment, the user information includes user level information, the transmission information includes transmission progress information, and the step of sequentially activating each target segment signature link according to the user information and the transmission information of each file to be transmitted specifically includes: if the user level information of the files to be transmitted is the same, determining the priority of the files to be transmitted according to the transmission progress information of the files to be transmitted; if the user grade information of the files to be transmitted is different, determining the priority of the files to be transmitted according to the user grade information of the files to be transmitted; and sequentially activating target fragment signature links corresponding to the files to be transmitted according to the priority of the files to be transmitted.
The transmission progress information represents the percentage of the number of the fragments to be transmitted, which are completely transmitted, in the file to be transmitted in the total number of the fragments to be transmitted in the file to be transmitted. And sequentially activating target fragment signature links corresponding to the next fragment to be transmitted after the last fragment to be transmitted is transmitted.
When the user grades of the files to be transmitted are the same, the file to be transmitted which is quickly uploaded can be preferentially transmitted by taking the transmission progress as the priority of the files to be transmitted, so that the file to be transmitted which is quickly completed is prevented from being transmitted again after a network fault or transmission interruption, the file transmission efficiency is improved, and the file transmission experience of a user is ensured; by taking the user grade information as the priority of the file to be transmitted corresponding to the user grade information, the data with high user grade can be transmitted preferentially, so that the transmission requirements of different user grades are met, various problems such as network faults, equipment faults and the like encountered by high-grade users in the subsequent file transmission process are reduced, and the file transmission safety of the high-grade users is ensured.
As an optional embodiment, the step of sequentially activating the target fragment signature link corresponding to each file to be transmitted according to the priority of each file to be transmitted specifically includes: determining the transmission quantity of the fragments to be transmitted simultaneously by the first server according to the server information of the first server; distributing corresponding transmission weight for each file to be transmitted according to the priority of each file to be transmitted; and distributing the activation denominations with the same transmission quantity to the files to be transmitted according to the transmission weight of the files to be transmitted, and sequentially activating target fragment signature links corresponding to the files to be transmitted containing the activation denominations.
For example, if there are 3 files to be transmitted: each file to be transmitted comprises 3 fragments to be transmitted and needs to be uploaded to a first server, and the first server can simultaneously transmit 6 fragments to be transmitted at the same time, namely the first server can simultaneously process the transmission of the 6 fragments to be transmitted. At this time, it is necessary to calculate the transmission weight of each file to be transmitted according to the priority of each file to be transmitted, for example, the transmission weight of file 1 is 10, the transmission weight of file 2 is 50, and the transmission weight of file 3 is 99. Thus, according to the transmission capability of the first server (the first server can simultaneously process the transmission of 6 fragments to be transmitted), the activation denominations are distributed for the file 1, the file 2 and the file 3 according to the transmission weight of each file to be transmitted, so that the file 1 obtains 1 activation denomination, the file 2 obtains 2 activation denominations, and the file 3 obtains 3 activation denominations. And finally, sequentially activating the target fragment signature links with the same number as the activation denominations in the files to be transmitted according to the activation denominations of the files to be transmitted, namely sequentially activating 1 target fragment signature link in the file 1, sequentially activating 2 target fragment signature links in the file 2 and sequentially activating 3 target fragment signature links in the file 3. Therefore, file transmission with different proportions can be carried out according to the priority of each file to be transmitted, and the transmission requirements of the files to be transmitted with different priorities are met.
The transmission weight to be transmitted corresponds to the priority of each file to be transmitted, and the priority of each file to be transmitted can be preset by a user or can be automatically generated according to the user information of each file to be transmitted. Specifically, the priority setting mode of the file to be transmitted may be set according to a specific application scenario, and is not specifically limited herein.
In this embodiment, in the process of uploading the target fragment of the target file, if the user cancels the uploading of the target file on the terminal or closes the browser that is currently uploading by the terminal, the transmission of the target file will be cancelled. In order to implement the breakpoint resume function, after the upload operation is cancelled, the target fragment of the target file that has been transmitted is stored in the first server, so that when the transmission operation on the target file is performed next time, only the target fragment that has not been transmitted needs to be subjected to file transmission, and the whole target file does not need to be transmitted again from the beginning.
However, when there are too many files in the first server to transmit only half of the files (the first server stores a plurality of incomplete files), a lot of server resources are occupied, and the files are difficult to clean after a long time. Therefore, referring to fig. 4 for solving the technical problem, fig. 4 is another schematic flow chart of the file transmission method according to the embodiment of the present invention, and as shown in fig. 4, the file transmission method according to the embodiment further includes steps 105 to 106.
And 105, acquiring the transmission progress information of each file to be transmitted in real time.
And acquiring the transmission progress information of each file to be transmitted in real time so as to monitor whether the transmission work of each file to be transmitted is normally operated.
And step 106, if the transmission progress information does not change within the preset time period, deleting the data related to the corresponding file to be transmitted in the first server.
When it is detected that the transmission progress information of a certain file to be transmitted is unchanged all the time, the duration time that the transmission progress information of the file to be transmitted is kept unchanged is judged, if the transmission progress information of the file to be transmitted is unchanged within a preset time period, if the transmission progress information of the file to be transmitted is 1 month long, the transmission process of the file to be transmitted is judged to be abnormal, the transmission-completed fragment to be transmitted of the file to be transmitted in the first server is directly deleted, and meanwhile, the second server is informed to delete the MD5 value of the corresponding fragment to be transmitted. Therefore, the available resources of the server can be effectively improved.
After the transmission of the fragments to be transmitted of the whole file to be transmitted is completed, all the fragments to be transmitted of the file to be transmitted need to be merged in a certain sequence, so that the whole file to be transmitted is stored in the first server. Specifically, please refer to fig. 4, the file transmission method provided in this embodiment further includes steps 107 to 109, and steps 107 to 109 in fig. 4 are a flow of the merging process of the fragments to be transmitted.
Step 107, receiving a file merging request.
The file merging request comprises a transmission event identifier of a file to be merged. The file merging request is generated after the terminal finishes transmitting all the fragments to be transmitted of the file to be transmitted, and the generated file merging request can be sent to the first server through the second server. Therefore, after the first server receives the file merging request, all the files to be transmitted in the file merging request are uploaded to the first server, the files to be transmitted can also be understood as the files to be merged, and the transmission event identifier of the files to be transmitted is also the transmission event identifier of the files to be merged.
And 108, determining the target fragment of the file to be merged transmitted by the corresponding target fragment signature link according to the transmission event identifier.
Taking the fragments to be transmitted with the same transmission event identification in the target fragment signature link as target fragments, wherein the transmission event identifications are the same, which means the same file to be transmitted; and merging the corresponding target fragments according to the fragment serial numbers in the target fragment signature link and the sequence of the fragment serial numbers to obtain a merged file. And merging according to the sequence of the fragment sequence numbers, so that the merged files can be merged according to a correct sequence, and the damage of the merged files is avoided.
And step 109, merging the corresponding target fragments according to the fragment serial numbers in the corresponding target fragment signature links to obtain a merged file.
The merged file is a file to be transmitted.
And the transmission of the whole file to be transmitted is finished.
To sum up, in the file transmission method provided in the embodiment of the present invention, file information, user information, transmission information of each to-be-transmitted file in a plurality of to-be-transmitted files corresponding to the fragment transmission request, and fragment information of a to-be-transmitted fragment corresponding to each to-be-transmitted file are obtained, then a target base link corresponding to each to-be-transmitted file is determined according to server information of the first server, file information, user information of each to-be-transmitted file, and fragment information of a to-be-transmitted fragment corresponding to each to-be-transmitted file, and a target fragment signature link of a to-be-transmitted fragment corresponding to each to-be-transmitted file is generated according to a transmission event identifier, file information, a target base link, and fragment information corresponding to each to-be-transmitted file, so that the terminal can directly transmit the corresponding to-be-transmitted fragment to the first server through the target fragment signature link, and the transfer is not required to be carried out through a second server, so that the file transmission efficiency in the cloud service is improved. In addition, by transmitting the fragments to be transmitted in the files to be transmitted instead of transmitting the whole files to be transmitted, the data which are transmitted again can be avoided, and the file transmission efficiency in the cloud service is further improved. In addition, according to the user information and the transmission information of each file to be transmitted, the signature links of each target fragment are sequentially activated, and the terminal can sequentially upload the designated fragments to be transmitted, so that the designated files to be transmitted are preferentially transmitted, the file transmission efficiency of the designated files is improved, and the user experience is improved.
According to the method described in the foregoing embodiment, the embodiment will be further described from the perspective of a file transfer device, where the file transfer device may be specifically implemented as an independent entity, or may be implemented by being integrated in an electronic device, such as a terminal, and the terminal may include a mobile phone, a tablet computer, and the like.
In order to solve the technical problems in the related art, an embodiment of the present invention further provides a file transfer apparatus, where the file transfer apparatus is applied to the first server in fig. 1 and 2. Specifically, referring to fig. 5, fig. 5 is a schematic structural diagram of a file transmission device according to an embodiment of the present invention, and as shown in fig. 5, a file transmission device 500 according to an embodiment of the present invention includes: a first receiving module 501, a first obtaining module 502, a first determining module 503, and a second determining module 504.
The first receiving module 501 is configured to receive a file fragment transmission request from a second server, and obtain file information, user information, transmission information of each to-be-transmitted file in a plurality of to-be-transmitted files corresponding to the file fragment transmission request, and fragment information of a to-be-transmitted fragment corresponding to each to-be-transmitted file.
The first obtaining module 502 is configured to obtain server information of a first server, and determine a target base link corresponding to each file to be transmitted according to the server information, file information of each file to be transmitted, user information, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted.
In this embodiment, the first server includes a link determination model, and the link determination model includes a link feature extractor and a link decider. The first obtaining module 502 is specifically configured to: inputting server information, file information of each file to be transmitted, user information and fragment information of the fragment to be transmitted corresponding to each file to be transmitted into a link characteristic extractor in a link determination model for processing to obtain link characteristic information; and inputting the link characteristic information into a link decision maker in the link determination model for processing so as to obtain target basic links corresponding to the files to be transmitted.
The first determining module 503 is configured to generate a target fragment signature link of a fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link, and the fragment information corresponding to each file to be transmitted.
Wherein, the target fragment signature link is unique.
In this embodiment, the fragment information includes the number of fragments and the sequence numbers of the fragments, and the sequence numbers of the fragments to be transmitted in the same file to be transmitted are different. The first determining module 503 is specifically configured to: carrying out signature processing on file information of each file to be transmitted to obtain a file signature identifier of each file to be transmitted; and performing field splicing treatment on the target basic link, the file signature identifier, the transmission event identifier and the fragment serial number of each file to be transmitted to obtain target fragment signature links of each file to be transmitted, wherein the target fragment signature links are the same as the fragments of each file to be transmitted in number, and each target fragment signature link in each file to be transmitted corresponds to one fragment serial number of each file to be transmitted.
The second determining module 504 is configured to send the target fragment signature links corresponding to the files to be transmitted to the terminal through the second server, and sequentially activate the target fragment signature links according to the user information and the transmission information of the files to be transmitted, so that the terminal sequentially transmits the corresponding fragments to be transmitted to the first server through the sequentially activated target fragment signature links.
In this embodiment, the user information includes user level information, the transmission information includes transmission progress information, and the second determining module 504 is specifically configured to: if the user level information of the files to be transmitted is the same, determining the priority of the files to be transmitted according to the transmission progress information of the files to be transmitted; if the user grade information of the files to be transmitted is different, determining the priority of the files to be transmitted according to the user grade information of the files to be transmitted; and sequentially activating target fragment signature links corresponding to the files to be transmitted according to the priority of the files to be transmitted, and sequentially activating target fragment signature links corresponding to the next fragment to be transmitted after the last fragment to be transmitted is transmitted.
Optionally, the second determining module 504 is further specifically configured to: determining the transmission quantity of the fragments to be transmitted simultaneously by the first server according to the server information of the first server; distributing corresponding transmission weight for each file to be transmitted according to the priority of each file to be transmitted; and distributing the activation denominations with the same transmission quantity to the files to be transmitted according to the transmission weight of the files to be transmitted, and sequentially activating target fragment signature links corresponding to the files to be transmitted containing the activation denominations.
Referring to fig. 6, fig. 6 is another schematic structural diagram of a file transmission device according to an embodiment of the present invention, and as shown in fig. 6, the file transmission device according to the embodiment of the present invention further includes: a second obtaining module 505, a detecting module 506, a second receiving module 507, a third determining module 508 and a combining module 509.
The second obtaining module 505 is configured to obtain transmission progress information of each file to be transmitted in real time.
The detecting module 506 is configured to delete the data related to the corresponding file to be transmitted in the first server if the transmission progress information does not change within a preset time period.
The second receiving module 507 is configured to receive a file merge request.
The file merging request comprises a transmission event identifier of a file to be merged.
The third determining module 508 is configured to determine, according to the transmission event identifier, a target segment of the file to be merged transmitted through the corresponding target segment signature link.
The merging module 509 is configured to merge the corresponding target fragments according to the fragment serial numbers in the corresponding target fragment signature links to obtain a merged file.
The merged file is a file to be transmitted.
In specific implementation, each module and/or unit may be implemented as an independent entity, or may be implemented as one or multiple entities by any combination, where the specific implementation of each module and/or unit may refer to the foregoing method embodiment, and specific achievable beneficial effects also refer to the beneficial effects in the foregoing method embodiment, which are not described herein again.
In addition, referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be a mobile terminal such as a smart phone, a tablet computer, and the like. As shown in fig. 7, the electronic device 700 includes a processor 701, a memory 702. The processor 701 is electrically connected to the memory 702.
The processor 701 is a control center of the electronic device 700, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device 700 and processes data by running or loading an application program stored in the memory 702 and calling data stored in the memory 702, thereby performing overall monitoring of the electronic device 700.
In this embodiment, the processor 701 in the electronic device 700 loads instructions corresponding to processes of one or more application programs into the memory 702 according to the following steps, and the processor 701 runs the application programs stored in the memory 702, thereby implementing various functions:
receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of fragments to be transmitted corresponding to each file to be transmitted;
acquiring server information of a first server, and determining target basic links corresponding to the files to be transmitted according to the server information, the file information of the files to be transmitted, user information and fragment information of fragments to be transmitted corresponding to the files to be transmitted;
generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link and the fragment information corresponding to each file to be transmitted;
and sending the target fragment signature links corresponding to the files to be transmitted to the terminal through the second server, and sequentially activating the target fragment signature links according to the user information and the transmission information of the files to be transmitted so that the terminal sequentially transmits the corresponding fragments to be transmitted to the first server through the sequentially activated target fragment signature links.
The electronic device 700 can implement the steps in any embodiment of the file transmission method provided in the embodiment of the present invention, and therefore, the beneficial effects that can be achieved by any file transmission method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
Referring to fig. 8, fig. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 8, fig. 8 is a specific structural block diagram of the electronic device according to the embodiment of the present invention, where the electronic device may be used to implement the file transmission method provided in the foregoing embodiment. The electronic device 800 may be a mobile terminal such as a smart phone or a notebook computer.
The RF circuit 810 is used for receiving and transmitting electromagnetic waves, and performing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. RF circuit 810 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuit 810 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (e.g., IEEE802.11 a, IEEE802.11 b, IEEE802.11g and/or IEEE802.11 n), Voice over Internet Protocol (VoIP), world wide Internet Protocol (Microwave Access for micro), and other short message protocols for instant messaging, as well as any other suitable communication protocols, and may even include those that have not yet been developed.
The memory 820 may be used for storing software programs and modules, such as program instructions/modules corresponding to the file transmission method in the above embodiment, and the processor 880 executes various functional applications and file transmission by operating the software programs and modules stored in the memory 820, that is, implementing the following functions:
receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
acquiring server information of a first server, and determining target basic links corresponding to the files to be transmitted according to the server information, the file information of the files to be transmitted, user information and fragment information of fragments to be transmitted corresponding to the files to be transmitted;
generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link and the fragment information corresponding to each file to be transmitted;
and sending the target fragment signature links corresponding to the files to be transmitted to the terminal through the second server, and sequentially activating the target fragment signature links according to the user information and the transmission information of the files to be transmitted so that the terminal sequentially transmits the corresponding fragments to be transmitted to the first server through the sequentially activated target fragment signature links.
The memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 820 may further include memory located remotely from the processor 880, which may be connected to the electronic device 800 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 830 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 830 may include a touch-sensitive surface 831 as well as other input devices 832. The touch-sensitive surface 831, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 831 (e.g., operations by a user on or near the touch-sensitive surface 831 using a finger, a stylus, or any other suitable object or attachment) and drive the corresponding connection device according to a predefined program. Alternatively, the touch-sensitive surface 831 can include two portions, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 880, and can receive and execute commands from the processor 880. In addition, the touch-sensitive surface 831 can be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 830 may include other input devices 832 in addition to the touch-sensitive surface 831. In particular, other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 840 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device 800, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 840 may include a Display panel 841, and the Display panel 841 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like, as an option. Further, touch-sensitive surface 831 can overlay display panel 841 and, upon detecting a touch operation on or near touch-sensitive surface 831, communicate to processor 880 to determine the type of touch event, whereupon processor 880 can provide a corresponding visual output on display panel 841 in accordance with the type of touch event. Although the touch-sensitive surface 831 and the display panel 841 are shown as two separate components to implement input and output functions, in some embodiments the touch-sensitive surface 831 may be integrated with the display panel 841 to implement input and output functions.
The electronic device 800 may also include at least one sensor 850, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 841 according to the brightness of ambient light, and a proximity sensor that may generate an interrupt when the folder is closed or closed. As one of the motion sensors, the gravity acceleration sensor may detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile phone is stationary, and may be used for applications of recognizing gestures of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor that may be further configured to the electronic device 800, which are not described herein again.
The audio circuitry 860, speaker 861, microphone 862 may provide an audio interface between a user and the electronic device 800. The audio circuit 860 can transmit the electrical signal converted from the received audio data to the speaker 861, and the electrical signal is converted into a sound signal by the speaker 861 and output; on the other hand, the microphone 862 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 860, and outputs the audio data to the processor 880 for processing, and then transmits the audio data to, for example, another terminal via the RF circuit 810, or outputs the audio data to the memory 820 for further processing. The audio circuitry 860 may also include an earbud jack to provide communication of a peripheral headset with the electronic device 800.
The electronic device 800, via the transport module 870 (e.g., a Wi-Fi module), may assist the user in receiving requests, sending information, etc., which provides the user with wireless broadband internet access. Although the transmission module 870 is illustrated in the drawing, it is understood that it does not belong to the essential constitution of the electronic device 800 and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 880 is a control center of the electronic device 800, connects various parts of the entire cellular phone using various interfaces and lines, performs various functions of the electronic device 800 and processes data by operating or executing software programs and/or modules stored in the memory 820 and calling data stored in the memory 820, thereby integrally monitoring the electronic device. Optionally, processor 880 may include one or more processing cores; in some embodiments, processor 880 may integrate an application processor, which handles primarily the operating system, user interfaces, applications, etc., and a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 880.
Electronic device 800 also includes a power supply 890 (e.g., a battery) for powering various components, which in some embodiments may be logically coupled to processor 880 via a power management system that provides power management functions such as charging, discharging, and power consumption management. Power supply 890 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 800 further includes a camera (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the display unit of the electronic device is a touch screen display, the mobile terminal further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
acquiring server information of a first server, and determining target basic links corresponding to the files to be transmitted according to the server information, the file information and the user information of the files to be transmitted and the fragment information of the fragments to be transmitted corresponding to the files to be transmitted;
generating target fragment signature links of the fragments to be transmitted corresponding to the files to be transmitted according to the transmission event identifications, the file information, the target basic links and the fragment information corresponding to the files to be transmitted;
and sending the target fragment signature links corresponding to the files to be transmitted to the terminal through the second server, and sequentially activating the target fragment signature links according to the user information and the transmission information of the files to be transmitted so that the terminal sequentially transmits the corresponding fragments to be transmitted to the first server through the sequentially activated target fragment signature links.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps of any embodiment of the file transmission method provided in the embodiment of the present invention.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any embodiment of the file transmission method provided in the embodiment of the present invention, beneficial effects that can be achieved by any file transmission method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The foregoing describes in detail a file transfer method, a file transfer apparatus, an electronic device, and a storage medium provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principles and implementations of the present application, and the description of the foregoing embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and the application scope may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present application. Moreover, it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the invention, and such modifications and adaptations are intended to be within the scope of the invention.

Claims (10)

1. A file transmission method is applied to a first server, and comprises the following steps:
receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
acquiring server information of the first server, and determining a target basic link corresponding to each file to be transmitted according to the server information, file information and user information of each file to be transmitted, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link and the fragment information corresponding to each file to be transmitted, wherein the target fragment signature link is unique;
and sending the target fragment signature link corresponding to each file to be transmitted to a terminal through the second server, and sequentially activating each target fragment signature link according to the user information and the transmission information of each file to be transmitted so that the terminal sequentially transmits the corresponding fragment to be transmitted to the first server through the sequentially activated target fragment signature links.
2. The file transmission method according to claim 1, wherein the user information includes user level information, the transmission information includes transmission progress information, and the sequentially activating each target fragment signature link according to the user information and the transmission information of each file to be transmitted includes:
if the user level information of the files to be transmitted is the same, determining the priority of the files to be transmitted according to the transmission progress information of the files to be transmitted;
if the user grade information of the files to be transmitted is different, determining the priority of the files to be transmitted according to the user grade information of the files to be transmitted;
and sequentially activating target fragment signature links corresponding to the files to be transmitted according to the priority of the files to be transmitted, wherein the sequential activation is to activate the target fragment signature links corresponding to the next fragments to be transmitted after the transmission of the last fragments to be transmitted is finished.
3. The file transmission method according to claim 2, wherein the sequentially activating the target fragment signature link corresponding to each of the files to be transmitted according to the priority of each of the files to be transmitted includes:
determining the transmission quantity of the fragments to be transmitted which can be simultaneously transmitted by the first server according to the server information of the first server;
distributing corresponding transmission weight for each file to be transmitted according to the priority of each file to be transmitted;
and distributing the activation denominations with the same transmission quantity to the files to be transmitted according to the transmission weights of the files to be transmitted, and sequentially activating target fragment signature links corresponding to the files to be transmitted containing the activation denominations.
4. The file transfer method according to claim 2, further comprising:
acquiring transmission progress information of each file to be transmitted in real time;
and if the transmission progress information does not change within a preset time period, deleting data related to the corresponding file to be transmitted in the first server.
5. The file transmission method according to any one of claims 1 to 4, wherein the first server includes a link determination model, the link determination model includes a link feature extractor and a link decision maker, and determining the target basic link corresponding to each file to be transmitted according to the server information, the file information and the user information of each file to be transmitted, and the fragment information of the fragment to be transmitted corresponding to each file to be transmitted includes:
inputting the server information, the file information of each file to be transmitted, the user information and the fragment information of the fragment to be transmitted corresponding to each file to be transmitted to a link characteristic extractor in a link determination model for processing to obtain link characteristic information;
and inputting the link characteristic information into a link decision maker in the link determination model for processing so as to obtain a target basic link corresponding to each file to be transmitted.
6. The file transmission method according to claim 5, wherein the fragment information includes a fragment number and a fragment serial number, and the fragment serial number of each fragment to be transmitted in the same file to be transmitted is different, and the generating a target fragment signature link of the fragment to be transmitted corresponding to each file to be transmitted according to the transmission event identifier, the file information, the target basic link, and the fragment information corresponding to each file to be transmitted includes:
carrying out signature processing on the file information of each file to be transmitted to obtain a file signature identifier of each file to be transmitted;
and carrying out field splicing treatment on the target basic link, the file signature identifier, the transmission event identifier and the fragment serial number of each file to be transmitted to obtain target fragment signature links of each file to be transmitted, wherein the target fragment signature links are the same as the fragments of each file to be transmitted in number, and each target fragment signature link in each file to be transmitted corresponds to one fragment serial number of each file to be transmitted.
7. The file transfer method according to claim 5, further comprising:
receiving a file merging request, wherein the file merging request comprises a transmission event identifier of a file to be merged;
determining a target fragment of a file to be merged transmitted by a corresponding target fragment signature link according to the transmission event identifier;
and merging the corresponding target fragments according to the fragment serial numbers in the corresponding target fragment signature links to obtain a merged file, wherein the merged file is the file to be transmitted.
8. A file transmission device is applied to a first server and comprises:
the first receiving module is used for receiving a file fragment transmission request from a second server, and acquiring file information, user information and transmission information of each file to be transmitted in a plurality of files to be transmitted corresponding to the file fragment transmission request, and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
the first acquisition module is used for acquiring server information of the first server and determining a target basic link corresponding to each file to be transmitted according to the server information, file information and user information of each file to be transmitted and fragment information of a fragment to be transmitted corresponding to each file to be transmitted;
the first determining module is used for generating a target fragment signature link of the fragments to be transmitted corresponding to the files to be transmitted according to the transmission event identification, the file information, the target basic link and the fragment information corresponding to the files to be transmitted, wherein the target fragment signature link is unique;
and the second determining module is used for sending the target fragment signature link corresponding to each file to be transmitted to the terminal through the second server, and sequentially activating each target fragment signature link according to the user information and the transmission information of each file to be transmitted so that the terminal sequentially transmits the corresponding fragment to be transmitted to the first server through the sequentially activated target fragment signature links.
9. An electronic device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the memory being coupled to the processor, and the processor implementing the steps of the file transfer method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, wherein when the computer program runs, a device in which the computer-readable storage medium is located is controlled to execute the steps in the file transfer method according to any one of claims 1 to 7.
CN202210652646.2A 2022-06-10 2022-06-10 File transmission method and device, electronic equipment and storage medium Active CN114745374B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210652646.2A CN114745374B (en) 2022-06-10 2022-06-10 File transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210652646.2A CN114745374B (en) 2022-06-10 2022-06-10 File transmission method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114745374A true CN114745374A (en) 2022-07-12
CN114745374B CN114745374B (en) 2022-09-27

Family

ID=82286956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210652646.2A Active CN114745374B (en) 2022-06-10 2022-06-10 File transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114745374B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546523A (en) * 2012-07-17 2014-01-29 珠海金山办公软件有限公司 Method and system for uploading file by positioning uploading position through link
US20140067929A1 (en) * 2012-08-28 2014-03-06 Ivan Kirigin Uploading one or more files from a shared file link
CN104052774A (en) * 2013-03-14 2014-09-17 腾讯科技(深圳)有限公司 Data transmission method and system
CN105659240A (en) * 2013-10-28 2016-06-08 华为技术有限公司 System and method for signaling and verifying url signatures for both url authentication and url-based content access authorization in adaptive streaming
CN106101291A (en) * 2016-08-26 2016-11-09 苏州蓝海彤翔系统科技有限公司 A kind of transmit the method for file, system, server and client
CN109525622A (en) * 2017-09-19 2019-03-26 阿里巴巴集团控股有限公司 The generation method of fragment resource ID, resource sharing method, device and electronic equipment
CN109831481A (en) * 2018-12-21 2019-05-31 厦门市美亚柏科信息股份有限公司 A kind of method, apparatus and storage medium of big file declustering transmission
US20190258783A1 (en) * 2018-02-21 2019-08-22 International Business Machines Corporation Stolen machine learning model identification
CN110290186A (en) * 2016-12-20 2019-09-27 北京并行科技股份有限公司 A kind of system and method suitable for the transmission of more Supercomputer Center's files
CN110554890A (en) * 2019-09-05 2019-12-10 厦门市美亚柏科信息股份有限公司 Video evidence obtaining method, terminal equipment and storage medium
CN111327971A (en) * 2018-12-13 2020-06-23 中国移动通信集团广西有限公司 Data packet distribution method and device, BRAS and readable storage medium
CN113568884A (en) * 2021-09-26 2021-10-29 武汉四通信息服务有限公司 File management method and device, electronic equipment and storage medium
CN114390044A (en) * 2021-12-29 2022-04-22 杭州华橙软件技术有限公司 File uploading method, system, device and storage medium
US20220129415A1 (en) * 2020-10-22 2022-04-28 Pure Storage, Inc. View Filtering for a File Storage System

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546523A (en) * 2012-07-17 2014-01-29 珠海金山办公软件有限公司 Method and system for uploading file by positioning uploading position through link
US20140067929A1 (en) * 2012-08-28 2014-03-06 Ivan Kirigin Uploading one or more files from a shared file link
CN104052774A (en) * 2013-03-14 2014-09-17 腾讯科技(深圳)有限公司 Data transmission method and system
CN105659240A (en) * 2013-10-28 2016-06-08 华为技术有限公司 System and method for signaling and verifying url signatures for both url authentication and url-based content access authorization in adaptive streaming
CN106101291A (en) * 2016-08-26 2016-11-09 苏州蓝海彤翔系统科技有限公司 A kind of transmit the method for file, system, server and client
CN110290186A (en) * 2016-12-20 2019-09-27 北京并行科技股份有限公司 A kind of system and method suitable for the transmission of more Supercomputer Center's files
CN109525622A (en) * 2017-09-19 2019-03-26 阿里巴巴集团控股有限公司 The generation method of fragment resource ID, resource sharing method, device and electronic equipment
US20190258783A1 (en) * 2018-02-21 2019-08-22 International Business Machines Corporation Stolen machine learning model identification
CN111327971A (en) * 2018-12-13 2020-06-23 中国移动通信集团广西有限公司 Data packet distribution method and device, BRAS and readable storage medium
CN109831481A (en) * 2018-12-21 2019-05-31 厦门市美亚柏科信息股份有限公司 A kind of method, apparatus and storage medium of big file declustering transmission
CN110554890A (en) * 2019-09-05 2019-12-10 厦门市美亚柏科信息股份有限公司 Video evidence obtaining method, terminal equipment and storage medium
US20220129415A1 (en) * 2020-10-22 2022-04-28 Pure Storage, Inc. View Filtering for a File Storage System
CN113568884A (en) * 2021-09-26 2021-10-29 武汉四通信息服务有限公司 File management method and device, electronic equipment and storage medium
CN114390044A (en) * 2021-12-29 2022-04-22 杭州华橙软件技术有限公司 File uploading method, system, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云烟成雨TD: "Minio入门系列【18】Minio+vue-uploader 分片上传方案及案例详解(源码文尾附上)", 《CSDN》 *

Also Published As

Publication number Publication date
CN114745374B (en) 2022-09-27

Similar Documents

Publication Publication Date Title
US11290447B2 (en) Face verification method and device
US11057376B2 (en) Method, apparatus, and system for controlling intelligent device, and storage medium
CN109905380B (en) Node control method and related device in distributed system
CN109714298B (en) Verification method, verification device and storage medium
CN110719319B (en) Resource sharing method, device, terminal equipment and storage medium
WO2017161994A1 (en) Method and device for displaying page, and computer storage medium
CN109271779A (en) A kind of installation packet inspection method, terminal device and server
CN111273955A (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN107995151B (en) Login verification method, device and system
CN104573437A (en) Information authentication method, device and terminal
CN109413256B (en) Contact person information processing method and device, storage medium and electronic equipment
CN107317828B (en) File downloading method and device
CN107592289B (en) Password setting method and device
CN109657469B (en) Script detection method and device
CN114745374B (en) File transmission method and device, electronic equipment and storage medium
CN112379905A (en) Kernel upgrading method and device, terminal and storage medium
CN113590272A (en) Virtual machine deployment method, device, electronic device and storage medium
CN113413590A (en) Information verification method and device, computer equipment and storage medium
CN114726849B (en) File transmission method, device, server and computer readable storage medium
CN112367428A (en) Electric quantity display method and system, storage medium and mobile terminal
CN113961380A (en) Cross-application repair method, device, equipment and storage medium
CN108259187B (en) Method and device for monitoring charging network
CN117041372A (en) Protocol switching method, device and equipment of passive equipment and readable storage medium
CN115098845A (en) Secret-free login method and device, electronic equipment and storage medium
CN115757506A (en) Data processing method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 430070 No. 1, 2 and 10, floors 1-3, building A7, Rongke Zhigu industrial project phase I, No. 555, Wenhua Avenue, Hongshan District, Wuhan City, Hubei Province

Patentee after: Wuhan Barda Technology Co.,Ltd.

Address before: 430070 No. 1, 2 and 10, floors 1-3, building A7, Rongke Zhigu industrial project phase I, No. 555, Wenhua Avenue, Hongshan District, Wuhan City, Hubei Province

Patentee before: Wuhan Sitong Information Service Co.,Ltd.

CP01 Change in the name or title of a patent holder