CN109995876B - File transmission method, device, system and computer storage medium - Google Patents

File transmission method, device, system and computer storage medium Download PDF

Info

Publication number
CN109995876B
CN109995876B CN201910293058.2A CN201910293058A CN109995876B CN 109995876 B CN109995876 B CN 109995876B CN 201910293058 A CN201910293058 A CN 201910293058A CN 109995876 B CN109995876 B CN 109995876B
Authority
CN
China
Prior art keywords
file
terminal
identifier
fragment
downloading request
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.)
Active
Application number
CN201910293058.2A
Other languages
Chinese (zh)
Other versions
CN109995876A (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.)
Yongxing Shenzhen Polytron Technologies Inc
Original Assignee
Yongxing Shenzhen Polytron Technologies Inc
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 Yongxing Shenzhen Polytron Technologies Inc filed Critical Yongxing Shenzhen Polytron Technologies Inc
Priority to CN201910293058.2A priority Critical patent/CN109995876B/en
Publication of CN109995876A publication Critical patent/CN109995876A/en
Application granted granted Critical
Publication of CN109995876B publication Critical patent/CN109995876B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/18Network architectures or network communication protocols for network security using different networks or channels, e.g. using out of band channels
    • 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]
    • 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
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments

Abstract

The invention relates to the technical field of communication, and discloses a file transmission method, which comprises the following steps: when a file downloading request sent by a first terminal is received, acquiring a file identifier corresponding to the file downloading request, and judging whether the file identifier meets the distributed transmission condition or not according to the file identifier; when the distributed transmission condition is met, determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier; and associating the file downloading request with the fragment position identifier and forwarding the file downloading request to the second terminal so that the second terminal determines a file fragment according to the file downloading request and the fragment position identifier and encrypts and transmits the file fragment to the first terminal. The invention also discloses a file transmission device, a file transmission system and a computer storage medium. The invention ensures the security and the high efficiency of file transmission.

Description

File transmission method, device, system and computer storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a file transfer method, apparatus, system, and computer storage medium.
Background
With the rapid development of communication technology, information transmission by using the internet is becoming more and more common; the problems of important information leakage, low information transmission speed and the like may occur in the common information transmission, the current information transmission is influenced by the network environment, and the efficiency and the safety of the information transmission cannot be effectively guaranteed.
Disclosure of Invention
The invention mainly aims to provide a file transmission method, a file transmission device, a file transmission system and a computer storage medium, and aims to solve the technical problems of low information transmission efficiency and low information transmission safety.
In order to achieve the above object, the present invention provides a file transfer method, including the steps of:
when a file downloading request sent by a first terminal is received, acquiring a file identifier corresponding to the file downloading request, and judging whether the file identifier meets the distributed transmission condition or not according to the file identifier;
when the distributed transmission condition is met, determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier;
and associating the file downloading request with the fragment position identifier and forwarding the file downloading request to the second terminal so that the second terminal determines a file fragment according to the file downloading request and the fragment position identifier and encrypts and transmits the file fragment to the first terminal.
Optionally, the step of obtaining a file identifier corresponding to the file download request when receiving the file download request sent by the first terminal, and determining whether the file identifier meets the distributed transmission condition according to the file identifier includes:
when a file downloading request sent by a first terminal is received, acquiring a file identifier corresponding to the file downloading request;
acquiring a target file corresponding to the file identifier and attributes of the target file, wherein the attributes comprise information content and sensitivity level;
and when the information amount of the target file is larger than the preset information amount or the sensitivity level of the target file is higher than the preset sensitivity level, judging that the distributed transmission condition is met.
Optionally, the step of determining, when the distributed transmission condition is met, a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier includes:
when the distributed transmission condition is met, determining a target terminal containing a target file corresponding to the file identifier;
selecting a preset number of target terminals from the target terminals as second terminals according to the number of tasks currently executed by the target terminals;
dividing the target file into the preset number of file segments, determining the file segments transmitted by the second terminal, and taking the position identification of the file segments as the corresponding fragment position identification of the second terminal.
Optionally, after the step of obtaining a file identifier corresponding to the file download request when receiving the file download request sent by the first terminal, and determining whether the file identifier meets the distributed transmission condition according to the file identifier, the method includes:
when the distributed transmission condition is not met, acquiring a target file corresponding to the file identifier;
carrying out fragmentation processing on the target file according to a preset fragmentation combination rule to obtain a file segment corresponding to the target file, and carrying out encryption processing on the file segment to obtain a ciphertext segment;
and sending the ciphertext fragment to the first terminal so that the first terminal receives and decrypts the ciphertext fragment to obtain a file fragment, and sequencing the file fragment according to a preset fragment combination rule by the first terminal to obtain a target file.
Optionally, the step of obtaining a file identifier corresponding to the file download request when receiving the file download request sent by the first terminal, and determining whether the file identifier meets the distributed transmission condition according to the file identifier includes:
when a file downloading request sent by a first terminal is received, acquiring authentication information corresponding to the file downloading request, and authenticating the first terminal according to the authentication information;
and when the first terminal passes the authentication, acquiring a file identifier corresponding to the file downloading request, and judging whether the distributed transmission condition is met according to the file identifier.
In addition, in order to achieve the above object, the present invention also provides a file transmission method, which is applied to a second terminal; the file transmission method comprises the following steps:
when a file downloading request sent by a server is received, acquiring a file identifier, a fragment position identifier and a first equipment identifier corresponding to the file downloading request;
acquiring a target file corresponding to the file identifier, and extracting a file segment corresponding to the fragment position identifier in the target file;
and encrypting the file segment and the segment position identification corresponding to the file segment to obtain a ciphertext segment, and sending the ciphertext segment to the first terminal corresponding to the first equipment identification.
In addition, in order to achieve the above object, the present invention also provides a file transmission method, which is applied to a first terminal; the file transmission method comprises the following steps:
when a file downloading request triggered by a user is received, the file downloading request is sent to a server, so that the server forwards the file downloading request to each second terminal;
receiving the ciphertext fragment transmitted by the second terminal, and decrypting the ciphertext fragment to obtain a file fragment and a fragment position identifier corresponding to the file fragment;
and splicing the file segments according to the respective segment position identifications to obtain a target file corresponding to the file downloading request.
In addition, to achieve the above object, the present invention also provides a file transfer apparatus, including:
the receiving and judging module is used for acquiring a file identifier corresponding to a file downloading request when the file downloading request sent by a first terminal is received, and judging whether the distributed transmission condition is met or not according to the file identifier;
the device determining module is used for determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier when the distributed transmission condition is met;
and the request forwarding module is used for associating the file downloading request with the fragment position identifier and forwarding the association to the second terminal so that the second terminal determines a file fragment according to the file downloading request and the fragment position identifier and encrypts and transmits the file fragment to the first terminal.
In addition, in order to achieve the above object, the present invention also provides a file transfer system;
the file transfer system includes: the system comprises a server, a first terminal and a second terminal which are in communication connection; the server, the first terminal and the second terminal respectively comprise a memory, a processor and a computer program which is stored on the memory and can run on the processor;
the computer program when executed by the processor implements the steps of:
when a first terminal receives a file downloading request triggered by a user, the first terminal associates the file downloading request with a first device identifier of the first terminal and sends the file downloading request to a server;
when a server receives a file downloading request sent by a first terminal, the server acquires a file identifier corresponding to the file downloading request, and the server judges whether the file identifier meets the distributed transmission condition or not according to the file identifier;
when the server judges that the distributed transmission conditions are met, the server determines a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier;
the server associates the file downloading request with the fragment position identifier and forwards the file downloading request to the second terminal;
when a second terminal receives a file downloading request sent by a server, the second terminal acquires a file identifier, a fragment position identifier and a first equipment identifier corresponding to the file downloading request;
the second terminal acquires a target file corresponding to the file identifier, and extracts a file segment corresponding to the fragment position identifier in the target file;
the second terminal encrypts the file segment and the segment position identification corresponding to the file segment to obtain a ciphertext segment, and sends the ciphertext segment to the first terminal corresponding to the first equipment identification;
the first terminal receives the ciphertext fragment transmitted by the second terminal, and decrypts the ciphertext fragment to obtain a file fragment and a fragment position identifier corresponding to the file fragment;
and the first terminal splices the file segments according to respective segment position identifications to obtain a target file corresponding to the file downloading request.
In addition, to achieve the above object, the present invention also provides a computer storage medium;
the computer storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the file transfer method as described above.
According to the file transmission method, the device and the system and the computer storage medium provided by the embodiment of the invention, when a server receives a file downloading request sent by a first terminal, a file identifier corresponding to the file downloading request is obtained, and whether a distributed transmission condition is met or not is judged according to the file identifier; when the distributed transmission condition is met, the server determines a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier; and associating the file downloading request with the fragment position identifier and forwarding the file downloading request to the second terminal so that the second terminal determines a file fragment according to the file downloading request and the fragment position identifier and encrypts and transmits the file fragment to the first terminal. In this embodiment, when the server receives a file download request, the server adopts a distributed information transmission method to realize multipath fragment transmission, so that on one hand, the risk of interception in the information transmission process is effectively avoided, and the security of information transmission is improved, and on the other hand, the transmission efficiency of information can be improved by fragment transmission of information.
Drawings
FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a file transfer method according to a first embodiment of the present invention;
FIG. 3 is a diagram illustrating a specific scenario of a first embodiment of a file transmission method according to the present invention;
fig. 4 is a functional module diagram of an embodiment of a file transfer device according to the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a server (also called a file transfer device, where the file transfer device may be formed by a separate file transfer apparatus or formed by combining other apparatuses with a file transfer apparatus) in a hardware operating environment according to an embodiment of the present invention.
The server in the embodiment of the invention refers to a computer for managing resources and providing services for users, and is generally divided into a file server, a database server and an application server. The computer or computer system running the above software is also referred to as a server. Compared with a common PC (personal computer), the server has higher requirements on stability, safety, performance and the like; as shown in fig. 1, the server may include: the processor 1001 includes, for example, a Central Processing Unit (CPU), a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002, a chipset, a disk system, hardware such as a network, and the like. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., WIFI interface, WIreless FIdelity, WIFI interface). The memory 1005 may be a Random Access Memory (RAM) or a non-volatile memory (e.g., a disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the server may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, and a WiFi module; the input unit is compared with a display screen and a touch screen; the network interface can be selected from the wireless interface, such as Bluetooth, a probe and the like except WiFi. Those skilled in the art will appreciate that the server architecture shown in FIG. 1 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the computer software product is stored in a storage medium (storage medium: also called computer storage medium, computer medium, readable storage medium, computer readable storage medium, or direct storage medium, etc., and the storage medium may be a non-volatile readable storage medium, such as RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method according to the embodiments of the present invention, and a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a computer program.
In the server shown in fig. 1, the network interface 1004 is mainly used for connecting to a background database and performing data communication with the background database; the user interface 1003 is mainly used for connecting a client (client, also called user side or terminal, the terminal in the embodiment of the present invention may be a fixed terminal or a mobile terminal, for example, an intelligent air conditioner with networking function, an intelligent electric lamp, an intelligent power supply, an intelligent sound box, an automatic driving car, a PC, a smart phone, a tablet computer, an electronic book reader, a portable computer, etc., the terminal includes sensors such as a light sensor, a motion sensor, and other sensors, which are not described herein again), and performs data communication with the client; and the processor 1001 may be configured to call up a computer program stored in the memory 1005 and perform the steps of the file transfer method provided by the following embodiments of the present invention.
The embodiment proposes a file transmission method, which is applied to the server shown in fig. 1.
Referring to fig. 2, in a first embodiment of the file transfer method of the present invention, the file transfer method includes:
step S10, when receiving a file download request sent by a first terminal, obtaining a file identifier corresponding to the file download request, and determining whether the file download request meets the distributed transmission condition according to the file identifier.
Specifically, the method comprises the following steps:
a1, when receiving a file downloading request sent by a first terminal, obtaining a file identifier corresponding to the file downloading request;
a2, acquiring a target file corresponding to the file identifier and attributes of the target file, wherein the attributes include information content and sensitivity level;
step a3, when the information amount of the target file is larger than the preset information amount, or the sensitivity level of the target file is higher than the preset sensitivity level, determining that the distributed transmission condition is met.
That is, in this embodiment, a user triggers a file download request at a first terminal (also called a client), the first terminal sends the file download request to a server, the server receives the file download request sent by the first terminal, obtains a file identifier corresponding to the file download request, and a target file corresponding to the file identifier, and then, the server obtains an attribute of the target file, where the attribute includes a file storage location, a file creation time, a file modification time, an information amount, a sensitivity level, and the like, and the server determines whether a distributed transmission condition is met according to the attribute of the target file, specifically, the method includes:
the implementation mode is as follows: the server compares the information quantity of the target file with a preset information quantity (the preset information quantity refers to a preset information quantity critical value, and the preset information quantity can be flexibly set according to a network environment, for example, the preset information quantity is set to be 50M), and the server judges whether the distributed transmission condition is met according to a comparison result; and when the information amount of the target file is larger than the preset information amount, judging that the distributed transmission condition is met, and otherwise.
For example, the target file is a 2G high-definition video file, it is determined that the distributed transmission condition is met, and the server controls the plurality of second terminals to transmit the video file.
The implementation mode two is as follows: the server compares the sensitivity level of the target file with a preset sensitivity level (the preset sensitivity level refers to a preset sensitivity level critical value, the preset sensitivity level can be set according to the file type, for example, the preset sensitivity level is set as a second level), the server judges whether the distributed transmission condition is met according to the comparison result, when the sensitivity level of the target file is higher than the preset sensitivity level, the distributed transmission condition is judged to be met, and otherwise.
For example, the target file is a bid document of xx project, it is determined that the distributed transmission condition is met, the server controls the plurality of second terminals to transmit the bid document, in this embodiment, the sensitive document can be transmitted in a distributed manner, the risk that the whole transmission of the information is intercepted is effectively avoided, and the security of information transmission is improved.
And step S20, when the distributed transmission condition is met, determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier.
Specifically, the method comprises the following steps:
step b1, when the distributed transmission condition is satisfied, determining the target terminal containing the target file corresponding to the file identification; selecting a preset number of target terminals from the target terminals as second terminals according to the number of tasks currently executed by the target terminals;
step b1, dividing the target file into the preset number of file segments, determining the file segments transmitted by the second terminal, and using the position identifiers of the file segments as the fragment position identifiers corresponding to the second terminal.
When the distributed transmission condition is met, the server queries terminals in communication connection with the server (the terminals can be understood as other distributed sites, distributed servers, or terminals except a first terminal sending a file downloading request), determines target terminals containing target files corresponding to file identifiers, acquires the number of tasks currently executed by each target terminal, sorts the target terminals according to the number of the tasks from small to large, and acquires preset numbers (the preset numbers refer to preset target file division numbers, and the preset numbers can be flexibly set according to specific scenes, for example, are set to 10) of the target terminals as second terminals.
The server divides the target file into a preset number of file segments, divides the file segments to be transmitted for the second terminal, and takes the position identification of the file segments as the fragment position identification corresponding to the second terminal; so that the second terminal transmits the corresponding file segments according to the fragment position identifiers.
Step S30, associating and forwarding the file download request and the fragment location identifier to the second terminal, so that the second terminal determines a file fragment according to the file download request and the fragment location identifier, and encrypts and transmits the file fragment to the first terminal.
With reference to fig. 3, the server associates the file download request with the fragment position identifier and forwards the file download request to the second terminal, so that the second terminal determines the file fragment according to the file download request and the fragment position identifier, the second terminal encrypts the file fragment to obtain a ciphertext fragment, and the second terminal transmits the ciphertext fragment to the first terminal.
In this embodiment, when the server receives a file download request, the server adopts a distributed information transmission method to realize multipath fragment transmission, so that on one hand, the risk of interception in the information transmission process is effectively avoided, and the security of information transmission is improved, and on the other hand, the transmission efficiency of information can be improved by fragment transmission of information.
Further, on the basis of the first embodiment of the present invention, a second embodiment of the file transfer method of the present invention is proposed.
This embodiment is a refinement of step S10 in the first embodiment, and the file transfer method includes:
step S11, when receiving a file download request sent by a first terminal, obtaining authentication information corresponding to the file download request, and performing authentication on the first terminal according to the authentication information.
When a server receives a file downloading request sent by a first terminal, the server acquires identity verification information corresponding to the file downloading request, wherein the identity verification information can be identity information of a first terminal holder, such as user fingerprint or user account information; the identity authentication information may also be first terminal device information, for example, a first device identifier corresponding to the first terminal; the server acquires standard authentication information with the same type as the authentication information, compares the authentication information with the standard authentication information, and determines whether the authentication passes according to a comparison result so as to complete the authentication of the first terminal.
Step S12, when the first terminal identity authentication passes, obtaining a file identifier corresponding to the file downloading request, and determining whether the file identifier meets the distributed transmission condition.
When the first terminal identity authentication passes, the server acquires a file identifier corresponding to the file downloading request and judges whether the distributed transmission condition is met or not according to the file identifier; in addition, when the first terminal identity authentication fails, the server sends prompt information to the first terminal so that the first terminal performs re-authentication corresponding to the user; in this embodiment, the server performs identity authentication on the first terminal, so as to avoid file downloading by an unauthorized user.
Further, on the basis of the first embodiment of the present invention, a third embodiment of the file transfer method of the present invention is proposed.
This embodiment is a step after step S10 in the first embodiment, and specifically describes that the distributed transmission condition is not met in the third embodiment of the file transmission method of the present invention; the file transmission method comprises the following steps:
and step S40, when the distributed transmission condition is not met, acquiring the target file corresponding to the file identifier.
And when the server determines that the distributed transmission condition is not met, the server acquires a target file corresponding to the file identifier.
Step S50, the target file is sliced according to a preset slicing combination rule to obtain a file segment corresponding to the target file, and the file segment is encrypted to obtain a ciphertext segment.
The server and the first terminal store preset fragment combination rules, the content of the preset fragment combination rules is not limited, the server performs fragment processing on the target file according to the preset fragment combination rules, and the first terminal combines file fragments according to the preset fragment combination rules.
The method includes the steps that a server conducts fragmentation processing on a target file according to a preset fragmentation combination rule to obtain a fragment set corresponding to the target file, and then the server conducts encryption processing on all file fragments in the fragment set to obtain a ciphertext fragment, wherein an encryption algorithm is not specifically limited, and comprises a digital signature algorithm, a symmetric encryption algorithm, an asymmetric encryption algorithm and the like.
Step S60, sending the ciphertext fragment to the first terminal so that the first terminal receives and decrypts the ciphertext fragment to obtain a file fragment, and sequencing the file fragment according to a preset fragment combination rule by the first terminal to obtain a target file.
The server sends the ciphertext fragments to the first terminal so that the first terminal receives and decrypts the ciphertext fragments to obtain file fragments, and the first terminal sorts the file fragments according to a preset fragment combination rule to obtain the target file.
In this embodiment, the server fragments and encrypts the target file according to the preset fragment combination rule to obtain the cryptographic fragment, meanwhile, the first terminal receives the cryptographic fragment, decrypts the cryptographic fragment to obtain the file fragment, and combines the file fragment according to the preset fragment combination rule to obtain the target file.
Further, on the basis of the first embodiment of the present invention, a fourth embodiment of the file transfer method of the present invention is provided, where the fourth embodiment of the file transfer method of the present invention is applied to a first terminal, and the file transfer method in this embodiment includes:
step S70, when receiving a file download request triggered by a user, sending the file download request to a server, so that the server forwards the file download request to each second terminal.
When the first terminal receives a file downloading request triggered by a user, the first terminal sends the file downloading request to the server, so that the server forwards the file downloading request to each second terminal.
Step S80, receiving the ciphertext fragment transmitted by the second terminal, decrypting the ciphertext fragment to obtain a file fragment and a fragment position identifier corresponding to the file fragment, and splicing the file fragments according to their respective fragment position identifiers to obtain a target file corresponding to the file download request.
The first terminal receives the ciphertext fragments transmitted by the second terminals, decrypts the ciphertext fragments to obtain the file fragments and fragment position identifications corresponding to the file fragments, and splices the file fragments according to the fragment position identifications to obtain a target file corresponding to the file downloading request; in the embodiment, the first terminal splices the file segments according to the segment position identifiers, so that the information security is ensured.
Further, a fifth embodiment of the file transfer method of the present invention is provided, where the fifth embodiment of the file transfer method of the present invention is applied to a second terminal, and the file transfer method in this embodiment includes:
step S90, when receiving a file download request sent by a server, obtaining a file identifier, a fragment location identifier, and a first device identifier corresponding to the file download request.
When the second terminal receives a file downloading request sent by the server, the second terminal obtains a file identifier, a fragment position identifier and a first device identifier corresponding to the file downloading request.
Step S100, acquiring a target file corresponding to the file identifier, and extracting a file segment corresponding to the fragment position identifier in the target file; and encrypting the file segment and the segment position identification corresponding to the file segment to obtain a ciphertext segment, and sending the ciphertext segment to the first terminal corresponding to the first equipment identification.
The second terminal acquires a target file corresponding to the file identifier and extracts a file segment corresponding to the segment position identifier in the target file; the second terminal encrypts the file segment and the segment position identifier corresponding to the file segment to obtain a ciphertext segment, and sends the ciphertext segment to the first terminal corresponding to the first device identifier.
In addition, referring to fig. 3, an embodiment of the present invention further provides a file transfer system.
The file transfer system includes: the system comprises a server, a first terminal and a second terminal which are in communication connection; the server, the first terminal and the second terminal respectively comprise a memory, a processor and a computer program which is stored on the memory and can run on the processor;
the computer program when executed by the processor implements the steps of:
when a first terminal receives a file downloading request triggered by a user, the first terminal associates the file downloading request with a first device identifier of the first terminal and sends the file downloading request to a server;
when a server receives a file downloading request sent by a first terminal, the server acquires a file identifier corresponding to the file downloading request, and the server judges whether the file identifier meets the distributed transmission condition or not according to the file identifier;
when the server judges that the distributed transmission conditions are met, the server determines a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier;
the server associates the file downloading request with the fragment position identifier and forwards the file downloading request to the second terminal;
when a second terminal receives a file downloading request sent by a server, the second terminal acquires a file identifier, a fragment position identifier and a first equipment identifier corresponding to the file downloading request;
the second terminal acquires a target file corresponding to the file identifier, and extracts a file segment corresponding to the fragment position identifier in the target file;
the second terminal encrypts the file segment and the segment position identification corresponding to the file segment to obtain a ciphertext segment, and sends the ciphertext segment to the first terminal corresponding to the first equipment identification;
the first terminal receives the ciphertext fragment transmitted by the second terminal, and decrypts the ciphertext fragment to obtain a file fragment and a fragment position identifier corresponding to the file fragment;
and the first terminal splices the file segments according to respective segment position identifications to obtain a target file corresponding to the file downloading request.
In addition, referring to fig. 4, an embodiment of the present invention further provides a file transmission apparatus, where the file transmission apparatus includes:
the receiving and judging module 10 is configured to, when a file downloading request sent by a first terminal is received, obtain a file identifier corresponding to the file downloading request, and judge whether a distributed transmission condition is met according to the file identifier;
the device determining module 20 is configured to determine, according to the file identifier, a second terminal and a fragment position identifier corresponding to the second terminal when the distributed transmission condition is met;
a request forwarding module 30, configured to associate and forward the file download request and the fragment location identifier to the second terminal, so that the second terminal determines a file fragment according to the file download request and the fragment location identifier, and encrypts and transmits the file fragment to the first terminal.
The steps implemented by the functional modules of the file transmission device may refer to the embodiments of the file transmission method of the present invention, and are not described herein again.
In addition, the embodiment of the invention also provides a computer storage medium.
The computer storage medium stores thereon a computer program which, when executed by a processor, implements the operations in the file transfer method provided by the above-described embodiments.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity/action/object from another entity/action/object without necessarily requiring or implying any actual such relationship or order between such entities/actions/objects; the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
For the apparatus embodiment, since it is substantially similar to the method embodiment, it is described relatively simply, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, in that elements described as separate components may or may not be physically separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A file transmission method is characterized in that the file transmission method is applied to a server; the file transmission method comprises the following steps:
when a file downloading request sent by a first terminal is received, acquiring a file identifier corresponding to the file downloading request, and judging whether the file identifier meets the distributed transmission condition or not according to the file identifier;
when the distributed transmission condition is met, determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier;
associating the file downloading request with the fragment position identifier and forwarding the file downloading request to the second terminal so that the second terminal determines a file fragment according to the file downloading request and the fragment position identifier and transmits the file fragment to the first terminal in an encrypted manner;
when the distributed transmission condition is not met, acquiring a target file corresponding to the file identifier;
carrying out fragmentation processing on the target file according to a preset fragmentation combination rule to obtain a file segment corresponding to the target file, and carrying out encryption processing on the file segment to obtain a ciphertext segment;
and sending the ciphertext fragment to the first terminal so that the first terminal receives and decrypts the ciphertext fragment to obtain a file fragment, and sequencing the file fragment according to a preset fragment combination rule by the first terminal to obtain a target file.
2. The file transmission method according to claim 1, wherein the step of obtaining a file identifier corresponding to the file download request when receiving the file download request sent by the first terminal, and determining whether the file identifier meets the distributed transmission condition according to the file identifier comprises:
when a file downloading request sent by a first terminal is received, acquiring a file identifier corresponding to the file downloading request;
acquiring a target file corresponding to the file identifier and attributes of the target file, wherein the attributes comprise information content and sensitivity level;
and when the information amount of the target file is larger than the preset information amount or the sensitivity level of the target file is higher than the preset sensitivity level, judging that the distributed transmission condition is met.
3. The file transmission method according to claim 1, wherein the step of determining the second terminal and the fragment location identifier corresponding to the second terminal according to the file identifier when the distributed transmission condition is satisfied includes:
when the distributed transmission condition is met, determining a target terminal containing a target file corresponding to the file identifier;
selecting a preset number of target terminals from the target terminals as second terminals according to the number of tasks currently executed by the target terminals;
dividing the target file into the preset number of file segments, determining the file segments transmitted by the second terminal, and taking the position identification of the file segments as the corresponding fragment position identification of the second terminal.
4. The file transmission method according to claim 1, wherein the step of obtaining a file identifier corresponding to the file download request when receiving the file download request sent by the first terminal, and determining whether the file identifier meets the distributed transmission condition according to the file identifier comprises:
when a file downloading request sent by a first terminal is received, acquiring authentication information corresponding to the file downloading request, and authenticating the first terminal according to the authentication information;
and when the first terminal passes the authentication, acquiring a file identifier corresponding to the file downloading request, and judging whether the distributed transmission condition is met according to the file identifier.
5. A file transmission method is characterized in that the file transmission method is applied to a second terminal; the file transmission method comprises the following steps:
when a file downloading request sent by a server is received, acquiring a file identifier, a fragment position identifier and a first equipment identifier corresponding to the file downloading request, wherein the file downloading request is the file identifier corresponding to the file downloading request sent by a first terminal when the server receives the file downloading request sent by the first terminal, and when the file downloading request is judged to be in accordance with a distributed transmission condition according to the file identifier, determining a second terminal and the fragment position identifier corresponding to the second terminal according to the file identifier; associating and forwarding a file downloading request sent by the first terminal with the fragment position identifier;
acquiring a target file corresponding to the file identifier, and extracting a file segment corresponding to the fragment position identifier in the target file;
and encrypting the file segment and the segment position identification corresponding to the file segment to obtain a ciphertext segment, and sending the ciphertext segment to the first terminal corresponding to the first equipment identification.
6. A file transmission method is characterized in that the file transmission method is applied to a first terminal; the file transmission method comprises the following steps:
when a file downloading request triggered by a user is received, sending the file downloading request to a server so that the server can obtain a file identifier corresponding to the file downloading request, and when the file identifier is judged to be in accordance with the distributed transmission condition, determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier; associating the file downloading request with the fragment position identifier and forwarding the file downloading request to each second terminal;
receiving the ciphertext fragment transmitted by the second terminal, or receiving a file identifier corresponding to the file downloading request acquired by the server, and acquiring a target file corresponding to the file identifier when judging that the target file does not accord with the distributed transmission condition according to the file identifier; carrying out fragmentation processing on the target file according to a preset fragmentation combination rule to obtain a file segment corresponding to the target file, carrying out encryption processing on the file segment and then sending a ciphertext segment, decrypting the ciphertext segment to obtain a file segment and a fragmentation position identifier corresponding to the file segment;
and splicing the file segments according to the respective segment position identifications to obtain a target file corresponding to the file downloading request.
7. A file transfer apparatus, characterized by comprising:
the receiving and judging module is used for acquiring a file identifier corresponding to a file downloading request when the file downloading request sent by a first terminal is received, and judging whether the distributed transmission condition is met or not according to the file identifier;
the device determining module is used for determining a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier when the distributed transmission condition is met; the device determining module is further configured to obtain a target file corresponding to the file identifier when the distributed transmission condition is not met; carrying out fragmentation processing on the target file according to a preset fragmentation combination rule to obtain a file segment corresponding to the target file, and carrying out encryption processing on the file segment to obtain a ciphertext segment; sending the ciphertext fragments to the first terminal so that the first terminal receives and decrypts the ciphertext fragments to obtain file fragments, and sequencing the file fragments according to a preset fragment combination rule by the first terminal to obtain a target file;
and the request forwarding module is used for associating the file downloading request with the fragment position identifier and forwarding the association to the second terminal so that the second terminal determines a file fragment according to the file downloading request and the fragment position identifier and encrypts and transmits the file fragment to the first terminal.
8. A file transfer system, characterized in that the file transfer system comprises: the system comprises a server, a first terminal and a second terminal which are in communication connection; the server, the first terminal and the second terminal respectively comprise a memory, a processor and a computer program which is stored on the memory and can run on the processor;
the computer program when executed by the processor implements the steps of:
when a first terminal receives a file downloading request triggered by a user, the first terminal associates the file downloading request with a first device identifier of the first terminal and sends the file downloading request to a server;
when a server receives a file downloading request sent by a first terminal, the server acquires a file identifier corresponding to the file downloading request, and the server judges whether the file identifier meets the distributed transmission condition or not according to the file identifier;
when the server judges that the distributed transmission conditions are met, the server determines a second terminal and a fragment position identifier corresponding to the second terminal according to the file identifier;
the server associates the file downloading request with the fragment position identifier and forwards the file downloading request to the second terminal;
when a second terminal receives a file downloading request sent by a server, the second terminal acquires a file identifier, a fragment position identifier and a first equipment identifier corresponding to the file downloading request;
the second terminal acquires a target file corresponding to the file identifier, and extracts a file segment corresponding to the fragment position identifier in the target file;
the second terminal encrypts the file segment and the segment position identification corresponding to the file segment to obtain a ciphertext segment, and sends the ciphertext segment to the first terminal corresponding to the first equipment identification;
when the server judges that the distributed transmission conditions are not met, a target file corresponding to the file identification is obtained; carrying out fragmentation processing on the target file according to a preset fragmentation combination rule to obtain a file segment corresponding to the target file, and carrying out encryption processing on the file segment to obtain a ciphertext segment; sending the ciphertext fragment to the first terminal;
the first terminal receives the ciphertext fragment transmitted by the second terminal, and decrypts the ciphertext fragment to obtain a file fragment and a fragment position identifier corresponding to the file fragment;
and the first terminal splices the file segments according to respective segment position identifications to obtain a target file corresponding to the file downloading request.
9. A computer storage medium, characterized in that the computer storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the file transfer method according to any one of claims 1 to 6.
CN201910293058.2A 2019-04-11 2019-04-11 File transmission method, device, system and computer storage medium Active CN109995876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910293058.2A CN109995876B (en) 2019-04-11 2019-04-11 File transmission method, device, system and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910293058.2A CN109995876B (en) 2019-04-11 2019-04-11 File transmission method, device, system and computer storage medium

Publications (2)

Publication Number Publication Date
CN109995876A CN109995876A (en) 2019-07-09
CN109995876B true CN109995876B (en) 2022-04-19

Family

ID=67133405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910293058.2A Active CN109995876B (en) 2019-04-11 2019-04-11 File transmission method, device, system and computer storage medium

Country Status (1)

Country Link
CN (1) CN109995876B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110430268B (en) * 2019-08-08 2022-03-11 中国工商银行股份有限公司 Static resource routing method and device based on distributed service
CN113037790B (en) * 2019-12-09 2023-05-16 北京中关村科金技术有限公司 File processing method, device and storage medium
CN111770132B (en) * 2020-05-18 2023-04-28 岭东核电有限公司 Work order downloading method, work order uploading method, device and computer equipment
CN112910606B (en) * 2020-05-22 2022-08-02 湖北省成套招标股份有限公司 Data sending system adopting sectional type data structure
CN112769949A (en) * 2021-01-20 2021-05-07 杭州鸿泉物联网技术股份有限公司 File transmission method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136911A (en) * 2006-08-31 2008-03-05 腾讯科技(深圳)有限公司 Method to download files using P2P technique and P2P download system
CN101854287A (en) * 2009-04-01 2010-10-06 工业和信息化部电信传输研究所 Method and device for optimizing P2P traffic
CN102387220A (en) * 2011-12-22 2012-03-21 乐视网信息技术(北京)股份有限公司 Offline downloading method and system based on cloud storage
CN102739717A (en) * 2011-04-12 2012-10-17 腾讯科技(深圳)有限公司 Downloading method, downloading proxy server and network system
CN103546428A (en) * 2012-07-10 2014-01-29 新华瑞德(北京)网络科技有限公司 File processing method and device
CN106603660A (en) * 2016-12-14 2017-04-26 传线网络科技(上海)有限公司 Collaborative downloading method, terminal and system for distributed type videos
CN108512921A (en) * 2018-03-28 2018-09-07 深圳市网心科技有限公司 Document down loading method, electronic equipment based on P2P networks and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3129912B1 (en) * 2014-04-10 2019-09-11 Atomizer Group, LLC Method and system for securing data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136911A (en) * 2006-08-31 2008-03-05 腾讯科技(深圳)有限公司 Method to download files using P2P technique and P2P download system
CN101854287A (en) * 2009-04-01 2010-10-06 工业和信息化部电信传输研究所 Method and device for optimizing P2P traffic
CN102739717A (en) * 2011-04-12 2012-10-17 腾讯科技(深圳)有限公司 Downloading method, downloading proxy server and network system
CN102387220A (en) * 2011-12-22 2012-03-21 乐视网信息技术(北京)股份有限公司 Offline downloading method and system based on cloud storage
CN103546428A (en) * 2012-07-10 2014-01-29 新华瑞德(北京)网络科技有限公司 File processing method and device
CN106603660A (en) * 2016-12-14 2017-04-26 传线网络科技(上海)有限公司 Collaborative downloading method, terminal and system for distributed type videos
CN108512921A (en) * 2018-03-28 2018-09-07 深圳市网心科技有限公司 Document down loading method, electronic equipment based on P2P networks and storage medium

Also Published As

Publication number Publication date
CN109995876A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
CN109995876B (en) File transmission method, device, system and computer storage medium
US11323260B2 (en) Method and device for identity verification
CN108156268B (en) Method for acquiring device identifier, server and terminal device
CN110266480B (en) Data transmission method, device and storage medium
US20180041893A1 (en) Method and system of multi-terminal mapping to a virtual sim card
CN108989848B (en) Video resource file acquisition method and management system
CN110856126B (en) Information reporting and receiving method, terminal equipment and storage medium
CN109347839B (en) Centralized password management method and device, electronic equipment and computer storage medium
CN106101091B (en) Method and device for processing data between terminals
CN111241559A (en) Training model protection method, device, system, equipment and computer storage medium
CN107154935B (en) Service request method and device
CN113490207B (en) Internet of things equipment binding method and device, computer equipment and storage medium
CN105516246A (en) Method for preventing application program downloading hijacking and server
CN105022760A (en) News recommendation method and device
CN113656713B (en) Network resource processing method, device and system
CN106130951B (en) Application store service management method and device
CN108156071B (en) Method for adding members to community, terminal device and computer readable storage medium
CN113162997B (en) Data transmission method and device, electronic equipment and readable storage medium
CN105302617A (en) Method and sever for downloading application program
CN114025356A (en) Malicious short message verification code identification method, related device and computer storage medium
CN113709849A (en) Network access method and device of equipment to be accessed to network, storage medium and electronic device
CN115686542A (en) Application installation method, device, equipment and storage medium
CN106716970A (en) Information interaction processing method, system and terminal
CN112148345A (en) Applet package transmitting method, apparatus, electronic device and computer readable medium
CN109815692B (en) Method and device for identifying installation application, storage medium and electronic device

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