CN107645551B - File transmission method and device - Google Patents
File transmission method and device Download PDFInfo
- Publication number
- CN107645551B CN107645551B CN201710848398.8A CN201710848398A CN107645551B CN 107645551 B CN107645551 B CN 107645551B CN 201710848398 A CN201710848398 A CN 201710848398A CN 107645551 B CN107645551 B CN 107645551B
- Authority
- CN
- China
- Prior art keywords
- virtual
- file
- http server
- receiving end
- url
- 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
Links
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application discloses a file transmission method and a file transmission device, wherein the method comprises the following steps: scanning a preset identification to obtain address information of a receiving end; acquiring a Uniform Resource Locator (URL) of a file to be sent; sending a notification message carrying the URL to the receiving end according to the acquired address information of the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, and the file downloading request comprises the URL; and receiving the file downloading request, and sending the file to be sent to the receiving end according to the URL. The method and the device for transmitting the file to be transmitted are beneficial to the fact that the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, and therefore the safety of the file to be transmitted is guaranteed.
Description
Technical Field
The application relates to the technical field of mobile terminals, in particular to a file transmission method and device.
Background
With the continuous development of the functions of mobile terminals such as mobile phones, mobile phones have become an important electronic tool that is convenient to carry and integrates multiple functions such as communication, entertainment, data processing and the like. With the application of data services of mobile phones, besides the voice call function, more and more information needs to be stored in the mobile phones, but due to the limitation of the storage space of the mobile phones, users sometimes need to backup the data in the mobile phones to the computer for storage.
The data stored in the mobile phone is backed up to the computer in the following two ways: firstly, a user can backup data in the mobile phone to a computer in time through a data line; secondly, the user uploads the data in the mobile phone to the cloud server, logs in the cloud server at the computer end, and downloads the data to the computer from the cloud server.
However, when the data transmission is performed in the above manner, the security of the data is threatened to some extent.
Disclosure of Invention
The embodiment of the application provides a file transmission method and device.
In a first aspect, an embodiment of the present application provides a file transmission method, applied to a sending end, including:
scanning a preset identification to obtain address information of a receiving end;
acquiring a Uniform Resource Locator (URL) of a file to be sent;
sending a notification message carrying the URL to the receiving end according to the acquired address information of the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, and the file downloading request comprises the URL;
and receiving the file downloading request, and sending the file to be sent to the receiving end according to the URL.
In a second aspect, an embodiment of the present application provides a file transmission method, which is applied to a receiving end, and includes:
generating a preset identifier, wherein the preset identifier is used for representing address information of the receiving end;
receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be sent;
responding to the notification message, and sending a file downloading request to a sending end, wherein the file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL;
and receiving the file to be sent.
In a third aspect, an embodiment of the present application provides a file transfer apparatus, including:
the scanning module is used for scanning the preset identification to acquire the address information of the receiving end;
the acquisition module is used for acquiring a Uniform Resource Locator (URL) of a file to be sent;
a sending module, configured to send a notification message carrying the URL to the receiving end according to the obtained address information of the receiving end, where the notification message is used to instruct the receiving end to send a file download request, where the file download request includes the URL;
and the receiving module is used for receiving the file downloading request and sending the file to be sent to the receiving end according to the URL.
In a fourth aspect, an embodiment of the present application provides a file transmission apparatus, including:
the generating module is used for generating a preset identifier, and the preset identifier is used for representing the address information of the receiving end;
the receiving module is used for receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be sent;
a sending module, configured to send a file download request to a sending end in response to the notification message, where the file download request includes the URL, and the file download request is used to request the sending end to send a file to be sent to the receiving end according to the URL;
the receiving module is further configured to receive the file to be sent.
In a fifth aspect, an embodiment of the present application provides a mobile terminal, including:
a processor, a memory;
the memory stores executable program code;
the processor is configured to call the executable program code in the memory to perform the method as described in the first aspect of the embodiments of the present application.
In a sixth aspect, an embodiment of the present application provides a terminal, including:
a processor, a memory;
the memory stores executable program code;
the processor is configured to call the executable program code in the memory to perform the method as described in the second aspect of the embodiments of the present application.
In a seventh aspect, an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a program, and the program, when executed, includes the method according to the first aspect of the embodiment of the present application.
In an eighth aspect, embodiments of the present application provide a computer storage medium storing a program, where the program includes the method according to the second aspect of the embodiments of the present application when executed.
In a ninth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package, the computer comprising a mobile terminal.
In a tenth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package, the computer comprising a terminal.
According to the file transmission method provided by the embodiment of the application, a sending end scans a preset identifier to obtain address information of a receiving end, so that a Uniform Resource Locator (URL) of a file to be sent is obtained, a notification message carrying the URL is sent to the receiving end, the notification message is used for indicating the receiving end to send a file downloading request, the file downloading request comprises the URL, the file downloading request is received, and the file to be sent is sent to the receiving end according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the embodiments or drawings used in the description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a first flowchart of a document transmission method disclosed in an embodiment of the present application;
FIG. 2 is a second flowchart of a document transmission method disclosed in an embodiment of the present application;
FIG. 2-1 is a schematic diagram illustrating an effect of a first file transfer operation interface according to an embodiment of the present application;
2-2 is an effect schematic diagram of a second file transfer operation interface provided in the embodiment of the present application;
FIG. 3 is a schematic flow chart illustrating a third file transfer method disclosed in an embodiment of the present application;
FIG. 4 is a schematic flow chart illustrating a fourth file transfer method disclosed in an embodiment of the present application;
fig. 5 is a schematic flowchart of a fifth file transfer method disclosed in an embodiment of the present application;
fig. 6 is a schematic flowchart of a sixth file transmission method disclosed in an embodiment of the present application;
fig. 7 is a schematic flowchart of a seventh file transmission method disclosed in the embodiment of the present application;
FIG. 8-1 is a block diagram of a module of a first file transfer device disclosed in an embodiment of the present application;
FIG. 8-2 is a block diagram of a module of a second file transfer device disclosed in an embodiment of the present application;
FIG. 9-1 is a block diagram of a third exemplary file transfer device according to an embodiment of the present disclosure;
FIG. 9-2 is a block diagram of a fourth exemplary file transfer device disclosed in the embodiments of the present application;
fig. 10 is a schematic structural diagram of a first mobile terminal disclosed in an embodiment of the present application;
fig. 11 is a schematic structural diagram of a second terminal disclosed in the embodiments of the present application;
fig. 12 is a schematic structural diagram of a third mobile terminal disclosed in the embodiment of the present application;
fig. 13 is a schematic structural diagram of a file transfer system disclosed in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the listed steps or modules but may alternatively include other steps or modules not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to better understand a file transmission method and device disclosed in the embodiments of the present application, the embodiments of the present application are described in detail below.
In the embodiment of the application, the sending end comprises a second virtual HTTP server and a second HTTP client corresponding to the second virtual HTTP server; the receiving end comprises a first virtual HTTP server and a first HTTP client corresponding to the first virtual HTTP server. The transmitting end and the receiving end are in the same local area network. Wherein the first virtual HTTP server and the second virtual HTTP server are virtual and do not actually exist. In practical application, an HTTP service is preinstalled in a receiving end/transmitting end, and when a virtual server needs to be enabled, the receiving end/transmitting end system wakes up the HTTP service, instructs the HTTP service to create a virtual HTTP server, and allocates an IP address and a port number to the virtual HTTP server.
Referring to fig. 1, fig. 1 is a schematic flow chart of a first file transmission method provided in an embodiment of the present application, where the file transmission method in the embodiment of the present application is described from a sending end, and as shown in fig. 1, the file transmission method in the embodiment of the present application includes the following steps:
s101, the sending end scans the preset identification to obtain the address information of the receiving end.
In an embodiment, the implementation manner of the sending end scanning the preset identifier to obtain the address information of the receiving end may be:
a sending end scans a preset identifier provided by a receiving end to acquire address information of a first virtual hypertext transfer protocol (HTTP) server started by the receiving end.
In one embodiment, the address information of the first virtual HTTP server includes an ip address of the first virtual HTTP server and a port number of the first virtual HTTP server.
In an embodiment, the preset identifier includes a two-dimensional code, a hyperlink, and the like, which is not limited in the embodiment of the present invention.
S102, the sending end obtains a Uniform Resource Locator (URL) of a file to be sent.
In an embodiment, the implementation manner of the sending end obtaining the uniform resource locator URL of the file to be sent may be:
and the sending end starts a second virtual HTTP server and generates a Uniform Resource Locator (URL) of a file to be sent through the second virtual HTTP server.
S103, the sending end sends a notification message carrying the URL to the receiving end according to the obtained address information of the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, and the file downloading request comprises the URL.
In an embodiment, an implementation manner of sending, by the sending end, the notification message carrying the URL to the receiving end may be:
and the sending end sends a notification message carrying the URL to the first virtual HTTP server, wherein the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server.
And S104, the sending end receives the file downloading request and sends the file to be sent to the receiving end according to the URL.
In an embodiment, before scanning the preset identifier to obtain the address information of the receiving end, the method further includes:
and determining the file to be sent.
In one embodiment, the obtaining a uniform resource locator URL of a file to be sent includes:
and when the format of the acquired address information of the receiving end is matched with a preset format, acquiring the URL of the file to be sent.
In an embodiment, the sending the notification message carrying the URL to the receiving end includes:
converting the URL into a data packet with a preset format;
and sending a notification message carrying the data packet to the receiving end.
According to the file transmission method provided by the embodiment of the application, a sending end scans a preset identifier to obtain address information of a receiving end, so that a Uniform Resource Locator (URL) of a file to be sent is obtained, a notification message carrying the URL is sent to the receiving end, the notification message is used for indicating the receiving end to send a file downloading request, the file downloading request comprises the URL, the file downloading request is received, and the file to be sent is sent to the receiving end according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Referring to fig. 2, fig. 2 is a schematic flow chart of a second file transmission method provided in the embodiment of the present application, where the file transmission method in the embodiment of the present application is described from a sending end side, and as shown in fig. 2, the file transmission method in the embodiment of the present application includes the following steps:
s201, the sending end scans a preset identification provided by the receiving end to obtain address information of a first virtual HTTP server started by the receiving end.
In an embodiment, in a sending end, one or more files to be sent that need to be transmitted are selected, and then a sending mode is selected, the file transmission method provided in the embodiment of the present application may be one of sending modes provided by a mobile terminal, and a user may also select other file transmission methods besides the file transmission method provided in the embodiment of the present application. Referring to fig. 2-1 and 2-2, fig. 2-1 and 2-2 are schematic effect diagrams of a file transmission operation interface provided in an embodiment of the present application, after a user selects a file to be transmitted, the user clicks a transmission button, then jumps to enter a transmission mode selection interface, and the user clicks "quick transmission", at this time, a transmission end opens a preset identifier scanner.
After selecting the file transmission method provided by the embodiment of the application, the sending end starts a preset identifier scanner and scans the preset identifier provided by the receiving end. The preset identification is generated by the receiving end and comprises the address information HTTP:// IP: port/uploadFiles of the first virtual HTTP server started by the receiving end, wherein the IP is the IP address of the first virtual HTTP server, and the port is the port number of the first virtual HTTP server.
The sending end comprises a second virtual HTTP server and a second HTTP client corresponding to the second virtual HTTP server.
The sending end and the receiving end are in the same local area network.
Among them, HTTP is an abbreviation of hyper text transfer protocol (hypertext transfer protocol), and HTTP is a transfer protocol for transferring hypertext from a WWW server to a local browser. The HTTP protocol is always a client initiated request and the server sends back a response. Therefore, the use of the HTTP protocol is limited, and the server cannot push the message to the client when the client does not initiate a request.
S202, the sending end starts a second virtual HTTP server, and generates a Uniform Resource Locator (URL) of a file to be sent through the second virtual HTTP server.
In an embodiment, after scanning a preset identifier and acquiring address information of a first virtual HTTP server, a sending end may first detect whether a format of the acquired address information of the first virtual HTTP server matches a preset format, that is, determine whether the acquired address information is HTTP:// ip: port/upload files, and when the format of the acquired address information of the first virtual HTTP server matches the preset format, the sending end starts a second virtual HTTP server and generates a URL of a file to be sent through the second virtual HTTP server. And if the format of the acquired address information of the first virtual HTTP server is not matched with the preset format, sending a list to continuously scan the preset identification provided by the receiving end.
The URL is a compact representation of the location and access method of a resource available from the internet, and is the address of a standard resource on the internet. Each file on the internet has a unique URL that contains information indicating the location of the file and how the browser should handle it.
And S203, the sending end sends a notification message carrying the URL to the first virtual HTTP server according to the obtained address information of the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, and the file downloading request comprises the URL.
In an embodiment, the sending end converts the URL into a data packet in a preset format, for example, the URL of a file to be sent is packaged into a JSON-format data packet, or other data formats except for the JSON format. And then, the sending end sends a notification message carrying the data packet to the first virtual HTTP server through a POST method, so that the data packet is sent to HTTP:// ip: port/uploadFiles.
And S204, the sending end receives the file downloading request through a second HTTP client corresponding to the second virtual HTTP server, and sends the file to be sent to the receiving end according to the URL.
In an embodiment, after receiving the file download request through a second HTTP client corresponding to the second virtual HTTP server, the sending end sends the file to be sent to a second client of the receiving end according to the URL.
In the file transmission method provided by the embodiment of the application, a sending end scans a preset identifier provided by a receiving end to acquire address information of a first virtual HTTP server started by the receiving end, the sending end starts a second virtual HTTP server, generates a Uniform Resource Locator (URL) of a file to be sent through the second virtual HTTP server, and then sends a notification message carrying the URL to the first virtual HTTP server, the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, the file downloading request comprises the URL, and the sending end receives the file downloading request through a second HTTP client corresponding to the second virtual HTTP server and sends the file to be sent to the receiving end according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
In an embodiment, before the sending end scans the preset identifier provided by the receiving end, the sending end may further perform the following operations:
and the sending end determines the file to be sent.
In an embodiment, the implementation manner that the sending end enables a second virtual HTTP server, and generates the URL of the file to be sent through the second virtual HTTP server may be:
and when the format of the acquired address information of the first virtual HTTP server is matched with a preset format, the sending end starts the second virtual HTTP server, and generates a URL (uniform resource locator) of a file to be sent through the second virtual HTTP server.
In an embodiment, an implementation manner of sending, by the sending end, the notification message carrying the URL to the first virtual HTTP server may be:
the sending end converts the URL into a data packet with a preset format;
and the sending end sends a notification message carrying the data packet to the first virtual HTTP server.
In one embodiment, the address information of the first virtual HTTP server includes an ip address of the first virtual HTTP server and a port number of the first virtual HTTP server.
Referring to fig. 3, fig. 3 is a schematic flow chart of a third file transmission method provided in the embodiment of the present application, where the file transmission method in the embodiment of the present application is described from a sending end side, consistent with the embodiment shown in fig. 1 or fig. 2. As shown in fig. 3, the file transmission method in the embodiment of the present application includes the following steps:
s301, the sending end determines a file to be sent.
S302, the sending end scans a preset identification provided by the receiving end to obtain address information of a first virtual HTTP server started by the receiving end.
The address information of the first virtual HTTP server comprises an ip address of the first virtual HTTP server and a port number of the first virtual HTTP server.
S303, the sending end detects whether the address information of the first virtual HTTP server started by the receiving end is matched with a preset format.
S304, when the format of the acquired address information of the first virtual HTTP server is matched with a preset format, the sending end starts the second virtual HTTP server, and generates a URL of a file to be sent through the second virtual HTTP server.
S305, the sending end converts the URL into a data packet with a preset format.
S306, the sending end sends a notification message carrying the data packet to the first virtual HTTP server, wherein the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, and the file downloading request comprises the URL.
And S307, the sending end receives the file downloading request through a second HTTP client corresponding to the second virtual HTTP server, and sends the file to be sent to the receiving end according to the URL.
In the file transmission method provided by the embodiment of the application, a sending end scans a preset identifier provided by a receiving end to acquire address information of a first virtual HTTP server started by the receiving end, the sending end starts a second virtual HTTP server, generates a Uniform Resource Locator (URL) of a file to be sent through the second virtual HTTP server, and then sends a notification message carrying the URL to the first virtual HTTP server, the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, the file downloading request comprises the URL, and the sending end receives the file downloading request through a second HTTP client corresponding to the second virtual HTTP server and sends the file to be sent to the receiving end according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Referring to fig. 4, fig. 4 is a schematic flow chart of a fourth file transmission method according to an embodiment of the present application, where the file transmission method in the embodiment of the present application is described from a receiving end side. As shown in fig. 4, the file transfer method in the embodiment of the present application includes the following steps:
s401, a receiving end generates a preset identification, wherein the preset identification is used for representing address information of the receiving end.
In one implementation, the address information of the receiving end is address information of a first hypertext transfer protocol (HTTP) server enabled by the receiving end; the preset identifier is used for scanning by a sending end to acquire address information of a first virtual hypertext transfer protocol (HTTP) server started by the receiving end.
S402, a receiving end receives a notification message carrying a Uniform Resource Locator (URL) of a file to be sent, wherein the notification message is sent by the sending end by scanning the preset identification to obtain address information of the receiving end and according to the address information.
In an embodiment, an implementation manner of the receiving end receiving the notification message carrying the URL of the file to be sent may be:
and the receiving end receives a notification message carrying a Uniform Resource Locator (URL) through the first virtual HTTP server.
S403, the receiving end responds to the notification message and sends a file downloading request to the sending end, the file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL.
In one embodiment, the receiving end sends a file download request through a first HTTP client corresponding to the first virtual HTTP server in response to the notification message.
S404, the receiving end receives the file to be sent.
In one embodiment, before the generating the preset identifier, the method further includes:
and generating the address information of the receiving end.
The generating of the preset identifier includes: and generating a corresponding preset identifier according to the address information of the receiving end. Specifically, when receiving an open request for the first HTTP client, the receiving end activates the first virtual HTTP server and generates address information of the first virtual HTTP server.
In an embodiment, the sending a file download request to the sending end in response to the notification message may be implemented by:
detecting whether the notification message comprises a data packet with a preset format or not;
when the notification message is detected to comprise the data packet in the preset format, extracting the data packet comprised in the notification message;
analyzing the data packet to obtain the URL;
and sending a file downloading request comprising the URL to the sending end.
Specifically, the receiving end detects whether the notification message includes a data packet in a preset format through the first virtual HTTP server; when detecting that the notification message comprises the data packet in the preset format, the receiving end extracts the data packet in the notification message through the first virtual HTTP server;
the receiving end analyzes the data packet through the first virtual HTTP server to obtain the URL; and the receiving end sends a file downloading request comprising the URL through a first HTTP client corresponding to the first virtual HTTP server.
In the file transmission method provided by the embodiment of the application, a receiving end generates a preset identifier, the preset identifier is used for indicating address information of the receiving end, receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be transmitted, responding to the notification message, and transmitting a file downloading request to a transmitting end, the file downloading request comprises the URL, and the file downloading request is used for requesting the transmitting end to transmit the file to be transmitted to the receiving end according to the URL and receive the file to be transmitted. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Referring to fig. 5, fig. 5 is a schematic flow chart of a fifth file transmission method according to an embodiment of the present application, where the file transmission method in the embodiment of the present application is described from a receiving end side. As shown in fig. 5, the file transmission method in the embodiment of the present application includes the following steps:
s501, a receiving end generates a preset identification, and the preset identification is used for scanning by the sending end to obtain address information of a first virtual HTTP server started by the receiving end.
The receiving end comprises a first virtual HTTP server and a first client corresponding to the first virtual HTTP server.
S502, the receiving end receives the notification message carrying the URL through the first virtual HTTP server.
Specifically, the receiving end receives, through the first virtual HTTP server, a notification message carrying the URL sent by the sending end through the POST method.
S503, the receiving end responds to the notification message, and sends a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, wherein the file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL.
Specifically, after receiving a notification message carrying a URL sent by a sending end through a POST method through the first virtual HTTP server, a receiving end first detects whether the notification message includes a data packet in a preset format, and then determines whether the notification message is an uploadfiles, and if not, the receiving end does not perform any processing on the notification message; if the notification message is detected to include the data packet in the preset format, the receiving end extracts the data packet included in the notification message through the first virtual HTTP server, where the data packet may be in a JSON format or in a format other than the JSON format, which is not limited in the embodiment of the present application. The data packet includes the URL of the file to be sent. The receiving end analyzes the data packet through the first virtual HTTP server to obtain the URL, and the receiving end sends a file downloading request including the URL through a first HTTP client corresponding to the first virtual HTTP server.
S504, the receiving end receives the file to be sent.
In an embodiment, the receiving end receives the file to be sent through the first client.
In one implementation, before the receiving end generates the preset identifier, the receiving end may further perform the following operations:
and the receiving end starts the first virtual HTTP server when receiving the starting request aiming at the first HTTP client.
In one implementation, the implementation manner of sending the file download request through the first HTTP client corresponding to the first virtual HTTP server by the receiving end in response to the notification message may be:
the receiving end detects whether the notification message comprises a data packet in a preset format or not through the first virtual HTTP server;
when detecting that the notification message comprises the data packet in the preset format, the receiving end extracts the data packet in the notification message through the first virtual HTTP server;
the receiving end analyzes the data packet through the first virtual HTTP server to obtain the URL;
and the receiving end sends a file downloading request comprising the URL through a first HTTP client corresponding to the first virtual HTTP server.
In the file transmission method provided by the embodiment of the application, a receiving end generates a preset identifier, the preset identifier is used for scanning by a sending end to acquire address information of a first virtual HTTP server started by the receiving end, the receiving end receives a notification message carrying a URL through the first virtual HTTP server and then responds to the notification message, a file download request is sent through a first HTTP client corresponding to the first virtual HTTP server, the file download request includes the URL, the file download request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL, and the receiving end receives the file to be sent. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Referring to fig. 6, fig. 6 is a schematic flow chart of a sixth file transmission method provided in the embodiment of the present application, where the file transmission method in the embodiment of the present application is described from a receiving end side, consistent with the embodiments shown in fig. 4 and fig. 5. As shown in fig. 6, the file transfer method in the embodiment of the present application includes:
s601, the receiving end starts the first virtual HTTP server when receiving the starting request aiming at the first HTTP client.
S602, the receiving end generates a preset identification, and the preset identification is used for scanning by the sending end to obtain address information of the first virtual HTTP server started by the receiving end.
S603, the receiving end receives a notification message carrying a URL through the first virtual HTTP server;
s604, the receiving end detects whether the notification message comprises a data packet in a preset format through the first virtual HTTP server;
s605, when detecting that the notification message comprises the data packet in the preset format, the receiving end extracts the data packet in the notification message through the first virtual HTTP server;
s606, the receiving end analyzes the data packet through the first virtual HTTP server to obtain the URL;
s607, the receiving end sends a file downloading request including the URL through a first HTTP client corresponding to the first virtual HTTP server.
The file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL.
S608, the receiving end receives the file to be sent.
In the file transmission method provided by the embodiment of the application, a receiving end generates a preset identifier, the preset identifier is used for scanning by a sending end to acquire address information of a first virtual HTTP server started by the receiving end, the receiving end receives a notification message carrying a URL through the first virtual HTTP server and then responds to the notification message, a file download request is sent through a first HTTP client corresponding to the first virtual HTTP server, the file download request includes the URL, the file download request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL, and the receiving end receives the file to be sent. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Referring to fig. 7, fig. 7 is a schematic flow chart of a seventh file transmission method according to the embodiment of the present application, where the file transmission method in the embodiment of the present application is described from both sides of the sending end and the receiving end. As shown in fig. 7, the file transfer method in the embodiment of the present application includes the following steps:
s701, the sending end determines a file to be sent.
S702, the receiving end starts the first virtual HTTP server when receiving the starting request aiming at the first HTTP client.
S703, the receiving end generates a preset identifier, and the preset identifier is used for scanning by the sending end to obtain address information of the first virtual HTTP server started by the receiving end.
S704, the sending end scans the preset identification provided by the receiving end to obtain the address information of the first virtual HTTP server started by the receiving end.
The address information of the first virtual HTTP server comprises an ip address of the first virtual HTTP server and a port number of the first virtual HTTP server.
S705, the sending end detects whether the address information of the first virtual HTTP server started by the receiving end is matched with a preset format.
S706, when the format of the acquired address information of the first virtual HTTP server is matched with a preset format, the sending end starts the second virtual HTTP server, and generates a URL of a file to be sent through the second virtual HTTP server.
And S707, the sending end converts the URL into a data packet with a preset format.
And S708, the sending end sends a notification message carrying the data packet to the first virtual HTTP server, wherein the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, and the file downloading request comprises the URL.
And S709, the receiving end receives the notification message carrying the URL through the first virtual HTTP server.
And S710, the receiving end detects whether the notification message comprises a data packet in a preset format through the first virtual HTTP server.
S711, when it is detected that the notification message includes the data packet in the preset format, the receiving end extracts the data packet included in the notification message through the first virtual HTTP server.
And S712, the receiving end analyzes the data packet through the first virtual HTTP server to obtain the URL.
S713, the receiving end sends a file downloading request comprising the URL through a first HTTP client corresponding to the first virtual HTTP server.
The file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL.
And S714, the sending end receives the file downloading request through a second HTTP client corresponding to the second virtual HTTP server, and sends the file to be sent to the receiving end according to the URL.
And S715, the receiving end receives the file to be sent.
In the file transmission method provided by the embodiment of the application, a sending end scans a preset identifier provided by a receiving end to acquire address information of a first virtual HTTP server started by the receiving end, the sending end starts a second virtual HTTP server, generates a Uniform Resource Locator (URL) of a file to be sent through the second virtual HTTP server, and then sends a notification message carrying the URL to the first virtual HTTP server, the notification message is used for indicating the receiving end to send a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, the file downloading request comprises the URL, and the sending end receives the file downloading request through a second HTTP client corresponding to the second virtual HTTP server and sends the file to be sent to the receiving end according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
The following is an embodiment of the apparatus of the present application, which is used to execute the method implemented by the embodiment of the method of the present application. Referring to fig. 8-1, fig. 8-1 is a block diagram of a first file transfer device according to an embodiment of the present disclosure, as shown in fig. 8-1, the file transfer device may include a scanning module 801, an enabling module 802, a sending module 803, and a receiving module 804, where:
a scanning module 801, configured to scan a preset identifier to obtain address information of a receiving end;
an obtaining module 802, configured to obtain a uniform resource locator URL of a file to be sent;
a sending module 803, configured to send, by the receiving end, a notification message carrying the URL, where the notification message is used to instruct the receiving end to send a file download request, where the file download request includes the URL;
a receiving module 804, configured to receive the file downloading request, and send the file to be sent to the receiving end according to the URL.
Referring to fig. 8-2, fig. 8-2 is a block diagram of a second file transfer device according to an embodiment of the present disclosure, as shown in fig. 8-2, the file transfer device may include a scanning module 801, an enabling module 802, a sending module 803, and a receiving module 804 in the embodiment corresponding to fig. 8-1, where:
in one embodiment, the apparatus further comprises:
a determining module 805, configured to determine the file to be sent.
In an embodiment, the obtaining module 802 is specifically configured to:
and when the format of the acquired address information of the receiving end is matched with a preset format, acquiring a Uniform Resource Locator (URL) of a file to be sent.
In an embodiment, the sending module 803 is specifically configured to:
converting the URL into a data packet with a preset format; and sending a notification message carrying the data packet to the receiving end.
Specifically, the detailed implementation of each module may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 3, which is not repeated herein.
It should be noted that the file transfer device described in the embodiments of the present application is presented in the form of a functional module. The term "module" as used herein is to be understood in its broadest possible sense, and objects used to implement the functions described in the respective "module" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or chipset) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
For example, the function of the scanning module 801 scanning the preset identifier to obtain the address information of the receiving end can be implemented by the mobile terminal shown in fig. 10, and specifically, the processor 1001 scans the preset identifier to obtain the address information of the receiving end by calling the executable program code in the memory 1002.
The file transmission device provided by the embodiment of the application scans the preset identifier to obtain address information of a receiving end, obtains a Uniform Resource Locator (URL) of a file to be sent, and sends a notification message carrying the URL to the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, the file downloading request comprises the URL, receives the file downloading request, and sends the file to be sent to the receiving end according to the URL. By the device in the embodiment of the application, the file to be sent can be transmitted to the receiving end by the sending end without uploading the file to be sent to the server, so that the safety of the file to be sent is ensured.
Referring to fig. 9-1, fig. 9-1 is a block diagram of a third file transmission apparatus disclosed in the embodiment of the present application, and as shown in fig. 9-1, the file transmission apparatus may include a first generating module 901, a receiving module 902, and a sending module 903, where:
a first generating module 901, configured to generate a preset identifier, where the preset identifier is used to represent address information of the receiving end;
a receiving module 902, configured to receive a notification message carrying a uniform resource locator URL of a file to be sent;
a sending module 903, configured to send a file download request to the sending end in response to the notification message, where the file download request includes the URL, and the file download request is used to request the sending end to send a file to be sent to the receiving end according to the URL.
The receiving module 902 is further configured to receive the file to be sent.
Referring to fig. 9-2, fig. 9-2 is a block diagram of a module composition of a fourth file transmission apparatus disclosed in an embodiment of the present application, and as shown in fig. 9-2, the file transmission apparatus may include a first generating module 901, a receiving module 902, and a sending module 903 in the embodiment corresponding to fig. 9-1, where:
in one embodiment, the apparatus further comprises:
a second generating module 904, configured to generate address information of the receiving end.
The first generating module 901 is specifically configured to:
and generating a corresponding preset identifier according to the address information of the receiving end.
In an embodiment, the sending module 903 is specifically configured to:
detecting whether the notification message comprises a data packet with a preset format or not; when the notification message is detected to comprise the data packet in the preset format, extracting the data packet comprised in the notification message; analyzing the data packet to obtain the URL; and sending a file downloading request comprising the URL to the sending end.
Specifically, the detailed implementation of each module may refer to the description of the relevant steps in the embodiments corresponding to fig. 4 to fig. 6, which is not repeated herein.
It should be noted that the file transfer device described in the embodiments of the present application is presented in the form of a functional module. The term "module" as used herein is to be understood in its broadest possible sense, and objects used to implement the functions described in the respective "module" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or chipset) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
For example, the function of generating the preset identifier by the first generating module 901 may be implemented by the terminal shown in fig. 11, and specifically, the processor 1101 may generate the preset identifier by calling the executable program code in the memory 1102.
The file transmission device provided by the embodiment of the application generates a preset identifier, wherein the preset identifier is used for representing address information of a receiving end, receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be sent, responding to the notification message, sending a file downloading request to a sending end, wherein the file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send the file to be sent to the receiving end according to the URL and receive the file to be sent. By the device in the embodiment of the application, the file to be sent can be transmitted to the receiving end by the sending end without uploading the file to be sent to the server, so that the safety of the file to be sent is ensured.
An embodiment of the present application further provides a first mobile terminal, as shown in fig. 10, including: a processor 1001, a memory 1002, a communication interface 1003, and a communication bus 1004; the processor 1001, the memory 1002 and the communication interface 1003 are connected through a communication bus 1004 to complete communication; processor 1001 controls wireless communications with an external cellular network through communications interface 1003; communication interface 1003 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. The memory 1002 includes at least one of: random access memory, non-volatile memory, and external memory, memory 1002 having stored therein executable program code capable of directing processor 1001 to execute the file transfer method specifically disclosed in the method embodiments of the present application.
The processor 1001 is configured to scan a preset identifier to obtain address information of a receiving end; acquiring a Uniform Resource Locator (URL) of a file to be sent; sending a notification message carrying the URL to the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, and the file downloading request comprises the URL; and receiving the file downloading request, and sending the file to be sent to the receiving end according to the URL.
In one embodiment, before scanning the preset identifier to obtain the address information of the receiving end, the processor 1001 is further configured to: and determining the file to be sent.
In an embodiment, when the processor 1001 is configured to obtain a uniform resource locator URL of a file to be sent, specifically:
and when the format of the acquired address information of the receiving end is matched with a preset format, acquiring a Uniform Resource Locator (URL) of a file to be sent.
In an embodiment, when the processor 1001 is configured to send a notification message carrying the URL to the first virtual HTTP server, the processor 1001 is specifically configured to:
converting the URL into a data packet with a preset format; and sending a notification message carrying the data packet to the receiving end.
Specifically, the detailed implementation of each module may refer to the description of the relevant step in the embodiment corresponding to fig. 1, fig. 2, or fig. 3, which is not repeated herein.
The mobile terminal provided by the embodiment of the application scans the preset identifier to obtain address information of a receiving terminal, obtains a Uniform Resource Locator (URL) of a file to be sent, and sends a notification message carrying the URL to the receiving terminal, wherein the notification message is used for indicating the receiving terminal to send a file downloading request, the file downloading request comprises the URL, receives the file downloading request, and sends the file to be sent to the receiving terminal according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
An embodiment of the present application further provides a second terminal, as shown in fig. 11, including: a processor 1101, a memory 1102, a communication interface 1103, and a communication bus 1104; the processor 1101, the memory 1102 and the communication interface 1103 are connected through a communication bus 1104 to complete communication therebetween; the processor 1101 controls wireless communications with an external cellular network through the communication interface 1103; the communication interface 1103 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. Memory 1102 includes at least one of: random access memory, non-volatile memory, and external memory, memory 1102 having stored therein executable program code capable of directing processor 1101 to execute the file transfer method specifically disclosed in the method embodiments of the present application.
The processor 1101 is configured to generate a preset identifier, where the preset identifier is used to represent address information of the receiving end; receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be sent; responding to the notification message, and sending a file downloading request to a sending end, wherein the file downloading request comprises the URL, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL; and receiving the file to be sent.
In an embodiment, the processor 1101 is further configured to generate address information of the receiving end.
In an embodiment, when the processor 1101 is configured to generate the address information of the receiving end, specifically, the processor is configured to:
detecting whether the notification message comprises a data packet with a preset format or not; when the notification message is detected to comprise the data packet in the preset format, extracting the data packet comprised in the notification message; analyzing the data packet to obtain the URL; and sending a file downloading request comprising the URL to the sending end.
Specifically, the specific implementation of each module may refer to the description of the relevant step in the embodiment corresponding to fig. 4, fig. 5, or fig. 6, which is not described herein again.
The terminal provided by the embodiment of the application generates a preset identifier, wherein the preset identifier is used for representing address information of a receiving terminal, receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be sent, responding to the notification message, sending a file downloading request to a sending terminal, wherein the file downloading request comprises the URL, and the file downloading request is used for requesting the sending terminal to send the file to be sent to the receiving terminal according to the URL and receive the file to be sent. According to the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, and therefore the safety of the file to be transmitted is guaranteed.
As shown in fig. 12, for convenience of description, only the parts related to the embodiments of the present application are shown, and details of the specific technology are not disclosed, please refer to the method part of the embodiments of the present application. The mobile terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (personal digital assistant), a point of sale (POS), a vehicle-mounted computer, and the like, taking the mobile terminal as the mobile phone as an example:
fig. 12 is a block diagram illustrating a partial structure of a mobile phone related to a mobile terminal according to an embodiment of the present disclosure. Referring to fig. 12, the cellular phone includes: radio Frequency (RF) circuitry 910, memory 920, input module 930, display module 940, sensor 950, audio circuitry 960, wireless fidelity (Wi-Fi) module 970, processor 980, and power supply 990. Those skilled in the art will appreciate that the handset configuration shown in fig. 12 is not intended 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.
The following describes each component of the mobile phone in detail with reference to fig. 12:
The memory 920 may be used to store software programs and modules, and the processor 980 may execute various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile phone, and the like. Further, the memory 920 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input module 930 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. In particular, the input module 930 may include a fingerprint recognition module 931 and other input devices 932. Fingerprint identification module 931, can gather the fingerprint data of user above it. Optionally, the fingerprint recognition module 931 may include an optical fingerprint module, a capacitive fingerprint module, and a radio frequency fingerprint module. Taking the fingerprint identification module 931 as an example of a capacitive fingerprint identification module, the fingerprint identification module specifically includes sensing electrodes (abnormal sensing electrodes and normal sensing electrodes) and a signal processing circuit (such as an amplifying circuit, a noise suppression circuit, an analog-to-digital conversion circuit, etc.) connected to the sensing electrodes. In addition to fingerprint recognition module 931, input module 930 may also include other input devices 932. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display module 940 may be used to display information input by the user or information provided to the user and various menus of the cellular phone. The display module 940 may include a display screen 941, and optionally, the display screen 941 may be configured in the form of a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), or the like. Although the fingerprint recognition module 931 and the display screen 941 are shown in fig. 12 as two separate components to implement the input and output functions of the mobile phone, in some embodiments, the fingerprint recognition module 931 and the display screen 941 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen 941 according to the brightness of ambient light, and the proximity sensor may turn off the display screen 941 and/or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Wi-Fi belongs to short-distance wireless transmission technology, and a mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through a Wi-Fi module 970, and provides wireless broadband internet access for the user. Although fig. 12 shows the WiFi module 970, it is understood that it does not belong to the essential constitution of the handset, and can be omitted entirely as needed within the scope of not changing the essence of the application.
The processor 980 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 920 and calling data stored in the memory 920, thereby integrally monitoring the mobile phone. Optionally, processor 980 may include one or more processing modules; in one embodiment, the processor 980 may integrate an application processor, which handles primarily the operating system, user interface, and 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 the processor 980.
The handset also includes a power supply 990 (e.g., a battery) for powering the various components, which may be logically connected to the processor 980 via a power management system in one embodiment, for managing charging, discharging, and power consumption via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In the embodiments shown in fig. 1 to fig. 3, the method flows of the steps may be implemented based on the structure of the mobile phone.
In the embodiments shown in fig. 8-1 and 8-2, the functions of the modules can be implemented based on the structure of the mobile phone.
An embodiment of the present application further provides a file transmission system, as shown in fig. 13, the file transmission system includes a sending end 1301 and a receiving end 1302, where:
the sending end 1301 is configured to scan a preset identifier provided by a receiving end 1302 to obtain address information of a first virtual HTTP server enabled by the receiving end 1302; starting a second virtual HTTP server, and generating a Uniform Resource Locator (URL) of a file to be sent through the second virtual HTTP server; sending a notification message carrying the URL to the first virtual HTTP server, where the notification message is used to instruct the receiving end 1302 to send a file download request through a first HTTP client corresponding to the first virtual HTTP server, where the file download request includes the URL; receiving the file downloading request through a second HTTP client corresponding to the second virtual HTTP server, and sending the file to be sent to the receiving end 1302 according to the URL.
The receiving end 1302 is configured to generate a preset identifier, where the preset identifier is used for scanning by the sending end 1301 to obtain address information of a first virtual HTTP server enabled by the receiving end 1302; receiving a notification message carrying a URL through the first virtual HTTP server; responding to the notification message, sending a file downloading request through a first HTTP client corresponding to the first virtual HTTP server, where the file downloading request includes the URL, and the file downloading request is used to request the sending end 1301 to send a file to be sent to the receiving end 1302 according to the URL; and receiving the file to be sent.
In an embodiment, before being used to scan the preset identifier provided by the receiving end 1302, the transmitting end 1301 is further used to determine the file to be transmitted.
In an embodiment, when the sending end 1301 is configured to enable a second virtual HTTP server and generate a URL of a file to be sent through the second virtual HTTP server, specifically, the sending end is configured to:
and when the format of the acquired address information of the first virtual HTTP server is matched with a preset format, starting the second virtual HTTP server, and generating a URL (uniform resource locator) of a file to be sent through the second virtual HTTP server.
In an embodiment, when the sending end 1301 is configured to send a notification message carrying the URL to the first virtual HTTP server, the sending end is specifically configured to:
converting the URL into a data packet with a preset format; and sending a notification message carrying the data packet to the first virtual HTTP server.
In one embodiment, the address information of the first virtual HTTP server includes an ip address of the first virtual HTTP server and a port number of the first virtual HTTP server.
In an embodiment, before being configured to generate the preset identifier, the receiving end 1302 is further configured to enable the first virtual HTTP server when receiving an open request for the first HTTP client.
In an embodiment, when the receiving end 1302 is configured to respond to the notification message and send a file download request through a first HTTP client corresponding to the first virtual HTTP server, the receiving end is specifically configured to:
detecting whether the notification message comprises a data packet in a preset format or not through the first virtual HTTP server; when detecting that the notification message comprises the data packet in the preset format, extracting the data packet in the notification message through the first virtual HTTP server; analyzing the data packet through the first virtual HTTP server to obtain the URL; and sending a file downloading request comprising the URL through a first HTTP client corresponding to the first virtual HTTP server.
In the file transmission system provided by the embodiment of the application, a sending end scans a preset identifier provided by a receiving end to acquire address information of a first virtual HTTP server started by the receiving end, the sending end starts a second virtual HTTP server, and generates a uniform resource locator URL of a file to be sent through the second virtual HTTP server, and then sends a notification message carrying the URL to the first virtual HTTP server, where the notification message is used to instruct the receiving end to send a file download request through a first HTTP client corresponding to the first virtual HTTP server, the file download request includes the URL, and the sending end receives the file download request through a second HTTP client corresponding to the second virtual HTTP server, and sends the file to be sent to the receiving end according to the URL. By implementing the method in the embodiment of the application, the transmitting end can transmit the file to be transmitted to the receiving end without uploading the file to be transmitted to the server, so that the security of the file to be transmitted is ensured.
Embodiments of the present application also provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the file transfer methods as described in the above method embodiments.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a program, and the program includes, when executed, some or all of the steps of any one of the file transmission methods described in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary of the invention and that the acts and modules illustrated are not necessarily required to practice the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some interfaces, and may be in an electrical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a read-only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and the like.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash disks, read-only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (12)
1. A file transmission method is applied to a sending end and is characterized by comprising the following steps:
scanning a preset identification provided by a receiving end to obtain address information of a first virtual hypertext transfer protocol server started by the receiving end, wherein the first virtual hypertext transfer protocol server is internally arranged at the receiving end, the address information of the first virtual hypertext transfer protocol server comprises an ip address of the first virtual hypertext transfer protocol server and a port number of the first virtual hypertext transfer protocol server, the receiving end comprises a first virtual HTTP server and a first HTTP client corresponding to the first virtual HTTP server, the transmitting end comprises a second virtual HTTP server and a second HTTP client corresponding to the second virtual HTTP server, the first virtual HTTP server and the second virtual HTTP server are virtual, and when the virtual server needs to be started, waking up an HTTP service and indicating the HTTP service to create the virtual HTTP server, allocating an IP address and a port number to the virtual HTTP server;
acquiring a Uniform Resource Locator (URL) of a file to be sent, wherein the method comprises the following steps: after address information of a first virtual HTTP server is acquired, detecting whether the format of the acquired address information of the first virtual HTTP server is matched with a preset format, and when the format of the acquired address information of the first virtual HTTP server is matched with the preset format, enabling a second virtual HTTP server by a sending end, and generating a URL (uniform resource locator) of a file to be sent through the second virtual HTTP server;
according to the obtained address information of the receiving end, the sending end converts the URL into a data packet with a preset format and sends a notification message carrying the URL to the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, and the file downloading request comprises the URL;
and receiving the file downloading request, and sending the file to be sent to the receiving end according to the URL.
2. The method as claimed in claim 1, wherein before scanning the preset identifier to obtain the address information of the receiving end, the method further comprises:
and determining the file to be sent.
3. The method of claim 1 or 2, wherein the obtaining a uniform resource locator, URL, of a file to be sent comprises:
and when the format of the acquired address information of the receiving end is matched with a preset format, acquiring the URL of the file to be sent.
4. A file transmission method is applied to a receiving end and is characterized by comprising the following steps:
the receiving end provides and generates a preset identifier, the preset identifier is used for representing address information of a first virtual hypertext transfer protocol server started by the receiving end, the first virtual hypertext transfer protocol server is internally arranged in the receiving end, the address information of the first virtual hypertext transfer protocol server comprises an ip address of the first virtual hypertext transfer protocol server and a port number of the first virtual hypertext transfer protocol server, the receiving end comprises a first virtual HTTP server and a first HTTP client corresponding to the first virtual HTTP server, the transmitting end comprises a second virtual HTTP server and a second HTTP client corresponding to the second virtual HTTP server, the first virtual HTTP server and the second virtual HTTP server are virtual, when the virtual server needs to be started, the HTTP service is awakened and indicates the HTTP service to create the virtual HTTP server, allocating an IP address and a port number to the virtual HTTP server;
receiving a notification message carrying a Uniform Resource Locator (URL) of a file to be sent from the sending end, wherein the notification message is sent by the sending end by scanning the preset identification to acquire address information of the receiving end and according to the address information, and comprises: after address information of a first virtual HTTP server is acquired, detecting whether the format of the acquired address information of the first virtual HTTP server is matched with a preset format, and when the format of the acquired address information of the first virtual HTTP server is matched with the preset format, enabling a second virtual HTTP server by a sending end, and generating a URL (uniform resource locator) of a file to be sent through the second virtual HTTP server;
responding to the notification message, and sending a file downloading request to the sending end, wherein the file downloading request comprises the URL, the sending end converts the URL into a data packet with a preset format, and the file downloading request is used for requesting the sending end to send a file to be sent to the receiving end according to the URL;
and receiving the file to be sent.
5. The method of claim 4, wherein prior to the generating the preset identification, the method further comprises:
generating address information of the receiving end;
the generating of the preset identifier includes: and generating a corresponding preset identifier according to the address information of the receiving end.
6. The method of claim 4 or 5, wherein said sending a file download request to the sender in response to the notification message comprises:
detecting whether the notification message comprises a data packet with a preset format or not;
when the notification message is detected to comprise the data packet in the preset format, extracting the data packet comprised in the notification message;
analyzing the data packet to obtain the URL;
and sending a file downloading request comprising the URL to the sending end.
7. A file transfer apparatus, comprising:
a scanning module, configured to scan a preset identifier provided by a receiving end to obtain address information of a first virtual hypertext transfer protocol server enabled by the receiving end, where the first virtual hypertext transfer protocol server is internally disposed at the receiving end, and the address information of the first virtual hypertext transfer protocol server includes an ip address of the first virtual hypertext transfer protocol server and a port number of the first virtual hypertext transfer protocol server, where the receiving end includes the first virtual HTTP server and a first HTTP client corresponding to the first virtual HTTP server, the sending end includes a second virtual HTTP server and a second HTTP client corresponding to the second virtual HTTP server, the first virtual HTTP server and the second virtual HTTP server are virtual, and when a virtual server needs to be enabled, awaken the HTTP service and instruct the HTTP server to create the virtual HTTP server, allocating an IP address and a port number to the virtual HTTP server;
the acquisition module is used for acquiring a Uniform Resource Locator (URL) of a file to be sent, and comprises: after address information of a first virtual HTTP server is acquired, detecting whether the format of the acquired address information of the first virtual HTTP server is matched with a preset format, and when the format of the acquired address information of the first virtual HTTP server is matched with the preset format, enabling a second virtual HTTP server by a sending end, and generating a URL (uniform resource locator) of a file to be sent through the second virtual HTTP server;
the sending module is used for converting the URL into a data packet with a preset format according to the obtained address information of the receiving end and sending a notification message carrying the URL to the receiving end, wherein the notification message is used for indicating the receiving end to send a file downloading request, and the file downloading request comprises the URL;
and the receiving module is used for receiving the file downloading request and sending the file to be sent to the receiving end according to the URL.
8. A file transfer apparatus, comprising:
a generating module, configured to provide and generate a preset identifier, where the preset identifier is used to indicate address information of a first virtual hypertext transfer protocol server enabled by a receiving end, the first virtual hypertext transfer protocol server is internally disposed at the receiving end, and the address information of the first virtual hypertext transfer protocol server includes an ip address of the first virtual hypertext transfer protocol server and a port number of the first virtual hypertext transfer protocol server, where the receiving end includes the first virtual HTTP server and a first HTTP client corresponding to the first virtual HTTP server, the sending end includes a second virtual HTTP server and a second HTTP client corresponding to the second virtual HTTP server, the first virtual HTTP server and the second virtual HTTP server are virtual, and when a virtual server needs to be enabled, the HTTP server is woken up and indicates the HTTP service to create the virtual HTTP server, allocating an IP address and a port number to the virtual HTTP server;
a receiving module, configured to receive a notification message carrying a uniform resource locator URL of a file to be sent, where the notification message is sent by the sending end scanning the preset identifier to obtain address information of the receiving end, and is sent according to the address information, and the receiving module includes: after address information of a first virtual HTTP server is acquired, detecting whether the format of the acquired address information of the first virtual HTTP server is matched with a preset format, and when the format of the acquired address information of the first virtual HTTP server is matched with the preset format, enabling a second virtual HTTP server by a sending end, and generating a URL (uniform resource locator) of a file to be sent through the second virtual HTTP server;
a sending module, configured to send a file download request to the sending end in response to the notification message, where the file download request includes the URL, where the sending end converts the URL into a data packet in a preset format, and the file download request is used to request the sending end to send a file to be sent to the receiving end according to the URL;
the receiving module is further configured to receive the file to be sent.
9. A mobile terminal, comprising:
a processor, a memory;
the memory stores executable program code;
the processor is configured to call the executable program code in the memory to perform the method as described in any of claims 1-3.
10. A terminal, comprising:
a processor, a memory;
the memory stores executable program code;
the processor is configured to call the executable program code in the memory to perform the method as described in any of claims 4-6.
11. A computer storage medium, characterized in that the computer storage medium stores a program which is executed by a processor to implement the method according to any one of claims 1-3.
12. A computer storage medium, characterized in that the computer storage medium stores a program which is executed by a processor to implement the method according to any one of claims 4-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710848398.8A CN107645551B (en) | 2017-09-19 | 2017-09-19 | File transmission method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710848398.8A CN107645551B (en) | 2017-09-19 | 2017-09-19 | File transmission method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107645551A CN107645551A (en) | 2018-01-30 |
CN107645551B true CN107645551B (en) | 2020-02-11 |
Family
ID=61112144
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710848398.8A Active CN107645551B (en) | 2017-09-19 | 2017-09-19 | File transmission method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107645551B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108737505A (en) * | 2018-04-27 | 2018-11-02 | 厦门理工学院 | A kind of method of resource downloading, system and terminal device |
CN108900601B (en) * | 2018-06-27 | 2020-09-29 | 掌阅科技股份有限公司 | File transfer method, computer device and storage medium |
CN111078140B (en) * | 2019-11-20 | 2023-05-23 | 岭澳核电有限公司 | Nuclear power station file uploading management method and device, terminal equipment and medium |
CN111522778B (en) * | 2020-04-27 | 2022-04-19 | 广州大学 | File migration method |
CN112671899B (en) * | 2020-12-23 | 2022-12-13 | 中移(杭州)信息技术有限公司 | File transmission method, file transmission device and file transmission system |
CN113162979B (en) * | 2021-03-17 | 2021-11-23 | 深圳乐播科技有限公司 | Service publishing method, device, equipment and storage medium |
CN114390045B (en) * | 2022-01-07 | 2023-10-31 | 北京思明启创科技有限公司 | Interactive file transmission method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102891890A (en) * | 2012-09-26 | 2013-01-23 | 腾讯科技(深圳)有限公司 | Interaction method and related equipment and system among terminals |
CN106899653A (en) * | 2016-08-09 | 2017-06-27 | 阿里巴巴集团控股有限公司 | Document transmission method and device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9684920B2 (en) * | 2012-07-19 | 2017-06-20 | Visa International Service Association | Dual encoding of machine readable code for automatic scan-initiated purchase or uniform resource locator checkout |
CN103685295A (en) * | 2013-12-20 | 2014-03-26 | 乐视网信息技术(北京)股份有限公司 | Method, terminal and system for downloading multimedia files |
CN104320417B (en) * | 2014-11-06 | 2017-06-06 | 北京安奇智联科技有限公司 | The method of interconnection and streaming and streaming media playing between mobile terminal and web terminals |
CN104378435B (en) * | 2014-11-20 | 2018-07-06 | 北京安奇智联科技有限公司 | The browser of computing device and the file of mobile terminal transmit |
US20170237726A1 (en) * | 2016-02-14 | 2017-08-17 | Ynjiun Paul Wang | Mobile Secure Login System and Method |
CN106027557A (en) * | 2016-07-01 | 2016-10-12 | 惠州Tcl移动通信有限公司 | Data backup method |
-
2017
- 2017-09-19 CN CN201710848398.8A patent/CN107645551B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102891890A (en) * | 2012-09-26 | 2013-01-23 | 腾讯科技(深圳)有限公司 | Interaction method and related equipment and system among terminals |
CN106899653A (en) * | 2016-08-09 | 2017-06-27 | 阿里巴巴集团控股有限公司 | Document transmission method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107645551A (en) | 2018-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107645551B (en) | File transmission method and device | |
EP3401776B1 (en) | Sound effect configuration method and system and related device | |
CN106447836B (en) | A kind of door control terminal binding method and relevant device | |
CN106446111B (en) | Data migration method and terminal | |
EP2763384B1 (en) | Apparatus and method for processing Bluetooth data in portable terminal | |
CN107634952B (en) | Method and device for determining brushing amount resource, service equipment, mobile terminal and storage medium | |
CN108834132B (en) | Data transmission method and equipment and related medium product | |
CN108733337B (en) | Screen display method and device, electronic equipment and computer readable storage medium | |
CN107172267B (en) | Fingerprint identification control method and related product | |
WO2018103441A1 (en) | Network positioning method and terminal device | |
CN106293738B (en) | Expression image updating method and device | |
WO2018049884A1 (en) | Data migration method and device | |
CN106507269B (en) | Data migration method and terminal equipment | |
WO2015117554A1 (en) | Data processing method, apparatus, and terminal device | |
CN103068016B (en) | The method of mobile terminal and reduction power consumption thereof | |
CN107194223B (en) | Fingerprint identification area display method and related product | |
CN106779648B (en) | Network data sending method and mobile terminal | |
CN106484563B (en) | Data migration method and terminal equipment | |
CN107317828B (en) | File downloading method and device | |
WO2018049937A1 (en) | Data migration method and terminals | |
CN106934003B (en) | File processing method and mobile terminal | |
CN106792434B (en) | Hotspot establishing method and terminal equipment | |
CN110602766B (en) | Personal hotspot identification method and method for determining association relationship between terminals | |
CN106339402B (en) | Method, device and system for pushing recommended content | |
CN108966290B (en) | Network connection method and related product |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: Guangdong OPPO Mobile Communications Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |