File transmission method and device, equipment, medium and product

By automatically detecting and switching network channels in a wireless LAN environment, or transmitting through cloud, the problem of network channel selection and switching during file transfer is solved, and efficient and stable file transfer is achieved.

CN120166099APending Publication Date: 2025-06-17GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311715007.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Under a wireless connection, if files cannot be successfully transferred through the selected network channel during file transfer, it cannot automatically switch to other network channels, resulting in file transfer failure.

Method used

A file transfer method is provided, by enabling the wireless LAN function on the local device, or obtaining the address information of the target device, to determine whether to connect to the wireless LAN provided by the same third-party device, if otherwise, connect to the wireless LAN hotspot of the target device, or transmit files through the cloud.

Benefits of technology

It realizes efficient and fast large-capacity file transfer through direct connection function without a network router or the Internet, ensuring the stability and reliability of the file transfer process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166099A_ABST
    Figure CN120166099A_ABST
Patent Text Reader

Abstract

The invention relates to a file transmission method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: firstly, judging whether home terminal equipment can scan target equipment based on a wireless local area network or not, and if so, carrying out file transmission based on a direct connection function; and if the local equipment is not scanned, judging whether the local equipment and the target equipment are connected with a wireless local area network provided by the same third-party equipment or not based on the address information of the target equipment, if so, initiating an establishment request of first data transmission connection to the target equipment, and transmitting a file to the target equipment after the first data transmission connection is established. According to the method provided by the invention, when the home terminal equipment cannot transmit the file to the target equipment based on the direct connection function, the wireless local area network provided by the third-party equipment is automatically selected to transmit the file to the target equipment, so that the file transmission process is more guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a file transfer method, apparatus, computer device, storage medium, and computer program product. Background Art

[0002] With the development of communication technologies, when transferring files between different terminal devices based on a wireless connection, one of multiple network channels can be selected for file transfer. However, in the related art, if the file fails to be successfully transferred based on the selected network channel, it is impossible to automatically switch to other network channels for file transfer, resulting in file transfer failure. Summary of the Invention

[0003] Based on this, to address the above technical problems, it is necessary to provide a file transfer method, apparatus, computer device, computer-readable storage medium, and computer program product that can automatically switch different network channels for file transfer.

[0004] In a first aspect, this application provides a file transfer method applied to a local device. The method includes:

[0005] When the local device enables the wireless local area network (WLAN) function and scans a target device within a preset range based on the WLAN provided by the local device, transfer a file to the target device through the direct connection function based on the WLAN provided by the local device.

[0006] When the local device does not enable the WLAN function or the target device is not scanned within the preset range based on the WLAN constructed by the local device, obtain the address information of the target device.

[0007] When it is determined based on the address information that both the local device and the target device are connected to the WLAN provided by the same third-party device, initiate a request to establish a first data transfer connection to the target device based on the WLAN provided by the third-party device, and after the first data transfer connection is established, transfer a file to the target device.

[0008] In one embodiment, the method further includes:

[0009] When it is determined that the local device and the target device are not connected to the wireless local area network provided by the same third-party device based on the address information, obtain the hotspot information of the wireless local area network hotspot provided by the target device, connect to the wireless local area network hotspot provided by the target device according to the hotspot information, and initiate a request to establish a second data transmission connection to the target device based on the wireless local area network hotspot of the target device. When the second data transmission connection is successfully established, transmit a file to the target device.

[0010] In one embodiment, the method further includes:

[0011] When the wireless local area network hotspot provided by the target device fails to be successfully connected, or the second data transmission connection fails to be established, transmit a file to the target device based on the cloud.

[0012] In one embodiment, the transmitting a file to the target device based on the cloud includes:

[0013] Upload the file to be transmitted to the cloud through the mobile communication network, and establish a signaling channel with the target device;

[0014] Based on the signaling channel, send a download notification message to the target device, so that the target device downloads the file to be transmitted from the cloud based on the mobile communication network.

[0015] In one embodiment, the process of obtaining at least one of the hotspot information or the address information includes:

[0016] In response to a scanning operation on the encoded image displayed by the target device, obtain at least one of the hotspot information or the address information carried by the encoded image.

[0017] In one embodiment, the scanning entry of the scanning operation is an application installed on the local device or a web application provided by the application installed on the local device.

[0018] In a second aspect, the present application further provides a file transmission device, where the device includes:

[0019] A first transmission module, configured to transmit a file to a target device through a direct connection function based on the wireless local area network provided by the local device when the wireless local area network function of the local device is turned on and the target device is scanned within a preset range based on the wireless local area network provided by the local device;

[0020] An acquisition module, configured to obtain the address information of the target device when the local device does not turn on the wireless local area network function, or when the wireless local area network constructed based on the local device does not scan the target device within the preset range;

[0021] A second transmission module, configured to, when it is determined based on the address information that both the local device and the target device are connected to a wireless local area network provided by the same third-party device, initiate a request to establish a first data transmission connection to the target device based on the wireless local area network provided by the third-party device, and after the first data transmission connection is established, transmit a file to the target device.

[0022] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the above embodiments are implemented.

[0023] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.

[0024] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.

[0025] For the above file transmission method, device, computer device, storage medium, and computer program product, the local device and the target device can directly establish a connection without a network router or the Internet through the direct connection function, so as to perform efficient and fast large-capacity file transmission; when the local device and the target device are connected to a wireless local area network provided by the same third-party device, file transmission can be achieved at a farther distance, and the process of file transmission is more stable; when the local device cannot transmit a file to the target device based on the direct connection function, it automatically selects to use the wireless local area network provided by the third-party device to transmit a file to the target device, which can avoid the situation that once the file transmission fails due to a single network channel, the entire file transmission process cannot proceed normally, so that the file transmission process is more guaranteed. Description of the Drawings

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0027] Figure 1 It is an application environment diagram of the file transfer method in an embodiment;

[0028] Figure 2 It is a schematic flowchart of the file transfer method in an embodiment;

[0029] Figure 3 It is a schematic flowchart of the method for downloading a file to be transferred in an embodiment;

[0030] Figure 4 It is a schematic diagram of the file transfer method based on an application in another embodiment;

[0031] Figure 5 It is a schematic diagram of the file transfer method based on an application web page in another embodiment;

[0032] Figure 6 It is a structural block diagram of the file transfer device in an embodiment;

[0033] Figure 7 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0034] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0035] The file transfer method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 . Among them, the local device 102 and the target device 106 can directly transfer files. For example, files can be transferred based on the direct connection function of the wireless local area network or the wireless local area network hotspot between two devices, or files can be transferred by simultaneously connecting to the wireless local area network provided by the third-party device 104, or files can be transferred through the cloud based on the mobile communication network. The present application embodiments do not make specific limitations on the network channel for file transfer between the local device 102 and the target device 106. The local device 102 and the target device 106 can be but are not limited to various personal computers, laptop computers, smart phones, and tablet computers. The third-party device 104 can be but are not limited to various routers, personal computers, laptop computers, smart phones, and tablet computers.

[0036] In an exemplary embodiment, as shown in Figure 2 , a file transfer method is provided. Taking the local device in Figure 1 as an example, the method includes the following steps 202 to 206. Among them:

[0037] S202. When the wireless local area network (WLAN) function of the local device is enabled and a target device is scanned within a preset range based on the WLAN provided by the local device, transfer a file to the target device through the direct connection function based on the WLAN provided by the local device.

[0038] Among them, the wireless local area network is a wireless communication technology used to establish a local area network based on radio waves within a limited range. For example, a WLAN between the local device and the target device can be constructed based on the WIFI function or the Bluetooth function; the direct connection function means that in the WLAN, a direct point-to-point connection can be established between the local device and the target device without forwarding or routing through a central network device. For example, the direct connection function can be the WIFI direct connection function or the Bluetooth direct connection function. When the target device is scanned by the WLAN provided by the local device, it indicates that the target device has the direct connection function.

[0039] Specifically, after the WLAN function of the local device is enabled, the device identifiers of all devices that have enabled the corresponding WLAN function within the preset range can be scanned based on the application installed on the local device. If the device identifiers include the device identifier of the target device, send the file to be transferred to the target device based on the device identifier of the target device and the direct connection function of the corresponding WLAN.

[0040] S204. When the WLAN function of the local device is not enabled or the target device is not scanned within the preset range based on the WLAN constructed by the local device, obtain the address information of the target device.

[0041] Among them, the address information refers to the location identifier of the target device in the network. For example, the address information can be the IP address of the target device.

[0042] The situation where the target device is not scanned may be one of the following two cases. One case is that the target device does not have the corresponding WLAN function, and the other case is that although the target device has the corresponding WLAN function, it is not enabled.

[0043] S206. When it is determined based on the address information that both the local device and the target device are connected to the WLAN provided by the same third-party device, initiate a request to establish a first data transfer connection to the target device based on the WLAN provided by the third-party device. After the first data transfer connection is established, transfer a file to the target device.

[0044] Among them, the data transmission connection can be established based on a network transmission protocol. For example, the network transmission protocol can be the Transmission Control Protocol or the User Datagram Protocol. After the first data transmission connection is established, the local device can transmit files to the target device based on the peer-to-peer network of WebRTC (Web Real-Time Communication). The method of transmitting files to the target device can also be other methods, which are not specifically limited in the embodiments of the present application.

[0045] Specifically, after the local device sends a connection establishment request for the first data transmission connection to the target device, if the target device returns a corresponding connection establishment response to the local device, the local device and the target device establish a data transmission connection based on the network transmission protocol.

[0046] In the above file transmission method, the local device and the target device can directly establish a connection without a network router or the Internet through the direct connection function, so as to perform the transmission of large-capacity files efficiently and quickly. When the local device and the target device are connected to the wireless local area network provided by the same third-party device, file transmission can be achieved at a farther distance, and the file transmission process is more stable. When the local device cannot transmit files to the target device based on the direct connection function, it automatically selects to use the wireless local area network provided by the third-party device to transmit files to the target device, which can avoid the situation that once the file transmission fails due to a single network channel, the entire file transmission process cannot proceed normally, thus making the file transmission process more secure.

[0047] In some embodiments, the above method further includes: when it is determined based on the address information that the local device and the target device are not connected to the wireless local area network provided by the same third-party device, obtaining the hotspot information of the wireless local area network hotspot provided by the target device, connecting to the wireless local area network hotspot provided by the target device according to the hotspot information, and initiating a connection establishment request for the second data transmission connection to the target device based on the wireless local area network hotspot of the target device. When the second data transmission connection is successfully established, files are transmitted to the target device.

[0048] Among them, the wireless local area network hotspot refers to a device or service that provides a wireless network connection within a specific area through wireless network technology. The hotspot information refers to the network connection information provided by the device when it is a wireless network hotspot. The target device can also connect to the wireless local area network hotspot provided by the local device based on the hotspot information of the local device.

[0049] When the local device and the target device are not connected to the wireless local area network provided by the same third-party device, the two devices cannot establish the first data transmission connection.

[0050] In this embodiment, when the local device and the target device are not connected to the wireless local area network provided by the same third-party device, the local device sends a file to the target device by connecting to the wireless local area network hotspot of the target device. In this way, the network channels for file transmission are more diversified, which can more effectively ensure the file transmission process. And in this process, the two devices directly establish wireless communication without relying on other network devices or Internet connections, which is simple and easy to use and has a high transmission efficiency.

[0051] In some embodiments, the above method further includes: when the wireless local area network hotspot provided by the target device fails to be successfully connected, or the second data transmission connection fails to be established, transmitting the file to the target device based on the cloud.

[0052] Among them, the local device uploads the file to be transmitted to the file storage database located in the cloud, and the target device downloads the corresponding file to be transmitted from the file storage database. The file storage database can be a cstore (Columnar Store, a column storage method) database, or it can be other databases. The embodiments of the present application do not make specific limitations on this.

[0053] In this embodiment, when all other wireless local area network communication methods fail, transmitting the file to the target device based on the cloud makes the transmission process of the file to be transmitted more secure.

[0054] In some embodiments, as Figure 3 shown, transmitting the file to the target device based on the cloud includes:

[0055] S302. Upload the file to be transmitted to the cloud through the mobile communication network and establish a signaling channel with the target device.

[0056] S304. Based on the signaling channel, send a download notification message to the target device so that the target device downloads the file to be transmitted from the cloud based on the mobile communication network.

[0057] Among them, before transmitting the file to be transmitted to the target device based on the cloud, two channels can be established based on the mobile communication network. One channel is the data channel for transmitting the file to be transmitted, and the other is the signaling channel for sending transmission instructions to the target device.

[0058] Specifically, the local device sends a download notification message to the target device through the signaling channel based on the mobile communication network, and uploads the file to be transmitted to the file storage database in the cloud. After receiving the download notification message, the target device downloads the file to be transmitted from the file storage database and returns a download success message to the local device.

[0059] In this embodiment, the local device first uploads the file to be transmitted to the cloud, and then notifies the target device to download the file to be transmitted from the cloud. Storing the file in the cloud first can avoid the loss of the file to be transmitted and ensure the security of the transmission process.

[0060] In some embodiments, the process of obtaining at least one of the hotspot information or the address information includes: in response to a scanning operation on the encoded image displayed on the target device, obtaining at least one of the hotspot information or the address information carried by the encoded image.

[0061] Among them, the encoded image refers to a way of encoding and representing the information of the device in the form of an image. For example, the encoded image can be a QR code or a barcode of the device, and the encoded image can be located on the display screen of the target device.

[0062] In this embodiment, by scanning the encoded image, the hotspot information and address information of the target device can be accurately and quickly obtained, so that the subsequent process of file transmission based on the wireless local area network hotspot provided by the target device and file transmission based on the wireless local area network provided by the third-party device is more efficient.

[0063] In some embodiments, the scanning entry of the scanning operation is an application installed on the local device or a web application provided by the application installed on the local device.

[0064] Among them, the web application refers to an application program running on the Internet, which can be accessed through a browser and displayed in a web page. For example, the web application can be a small program in the application installed on the local device.

[0065] In this embodiment, using the application installed on the local device or the web application provided by the application installed on the local device as the scanning entry of the scanning operation can provide multiple scanning methods for the users of the local device, avoid the failure to obtain the hotspot information and address information of the target device after the failure of a single scanning method, and can more effectively ensure the process of obtaining the hotspot information and address information.

[0066] In one embodiment, as Figure 4 and Figure 5 shown, another file transmission method is provided, where Figure 4 is a method for file transmission based on the application on the local device, Figure 5 is a method for file transmission based on the web application provided by the application, Figure 4 The method in

[0067] (1)When the user opens the application (APP) on the local device, the application will perform a network check. If the check result shows that the local device has WiFi enabled and the target device has the dual-network card WiFi direct connection function, the device identifier of the target device will be scanned by the local device and displayed in the nearby device list near the top of the application. At this time, when the local device enters the file transfer function, it can directly select a file for point-to-point WiFi direct connection transfer. Among them, the local device can be a mobile terminal, and the target device can be a PC terminal.

[0068] (2)If the device identifier of the target device is not in the nearby device list and the user does not find the target device after manually scanning on the local device, it means that the target device does not meet the WiFi direct connection conditions. At this time, if the user clicks on the file transfer function on the local device, the local device will guide the user to scan the QR code on the target device.

[0069] (3)The application will attempt to establish a TCP connection through the network IP information attached to the QR code. If the connection is successful, it will then attempt to establish a connection through the peer-to-peer network of webrtc. After the user selects a file, the file can be directly transferred. Among them, a successful TCP connection means that the local device and the target device are connected to the WIFI hotspot of the same third-party device.

[0070] (4)If the TCP connection fails, the application will attempt to connect to the hotspot of the target device based on the WiFi hotspot information of the target device attached to the QR code. If the connection is successful, the subsequent process is the same as above.

[0071] (5)If the WiFi hotspot of the target device cannot be connected successfully either, after the user selects the file transfer function, the file will be transferred through the mobile communication network based on the cloud file storage database.

[0072] Figure 5 The method in

[0073] (1)The user opens the mini-program provided by the application on the local device and uses the mini-program to scan the QR code displayed on the target device. After entering the mini-program, it will attempt to establish a local area network connection through the network address information of the target device attached to the QR code.

[0074] (2)If the connection is successful, it will then attempt to establish a connection through the peer-to-peer network of webrtc. After the user selects a file, the file can be directly transferred.

[0075] (3) If a local area network connection cannot be established, or the WebRTC peer-to-peer network fails to be established, after the user selects a file on the local device, the file will be uploaded to the csotre file server first, and the applet will notify the target device to download the corresponding file from the csstore file server through the signaling of the HTTP interface. This process can be completed based on the mobile communication network.

[0076] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.

[0077] Based on the same inventive concept, an embodiment of the present application also provides a file transmission device for implementing the above-mentioned file transmission method. The implementation solution provided by this device to solve the problem is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more of the following file transmission device embodiments can refer to the limitations on the file transmission method in the above text, and will not be repeated here.

[0078] In an exemplary embodiment, as Figure 6 shown, a file transmission device 600 is provided, including: a first transmission module 601, an acquisition module 602, and a second transmission module 603, where:

[0079] The first transmission module 601 is configured to transmit a file to the target device through a direct connection function based on the wireless local area network provided by the local device when the wireless local area network function of the local device is turned on and the target device is scanned within a preset range based on the wireless local area network provided by the local device.

[0080] The acquisition module 602 is configured to obtain the address information of the target device when the wireless local area network function of the local device is not turned on, or the target device is not scanned within the preset range based on the wireless local area network constructed by the local device.

[0081] A second transmission module 603, configured to, when it is determined based on the address information that both the local device and the target device are connected to a wireless local area network provided by the same third-party device, initiate a request to establish a first data transmission connection with the target device based on the wireless local area network provided by the third-party device, and transmit a file to the target device after the first data transmission connection is established.

[0082] In some embodiments, the file transmission device 600 is specifically configured to: when it is determined based on the address information that the local device and the target device are not connected to a wireless local area network provided by the same third-party device, obtain hotspot information of a wireless local area network hotspot provided by the target device, connect to the wireless local area network hotspot provided by the target device according to the hotspot information, initiate a request to establish a second data transmission connection with the target device based on the wireless local area network hotspot of the target device, and transmit a file to the target device when the second data transmission connection is successfully established.

[0083] In some embodiments, the file transmission device 600 further includes:

[0084] A third transmission module, configured to transmit a file to the target device based on the cloud when the wireless local area network hotspot provided by the target device is not successfully connected, or when the establishment of the second data transmission connection fails.

[0085] In some embodiments, the third transmission module is further configured to upload a file to be transmitted to the cloud through a mobile communication network, and establish a signaling channel with the target device; based on the signaling channel, send a download notification message to the target device, so that the target device downloads the file to be transmitted from the cloud based on the mobile communication network.

[0086] In some embodiments, the file transmission device 600 is further configured to, in response to a scanning operation on a coded image displayed by the target device, obtain at least one piece of information of the hotspot information or the address information carried by the coded image.

[0087] In some embodiments, the scanning entry for the scanning operation is an application installed on the local device or a web application provided by the application installed on the local device.

[0088] Each module in the above file transmission device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.

[0089] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in Figure 7 . The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be transmitted. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a file transmission method is implemented.

[0090] Those skilled in the art can understand that Figure 7 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0091] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented: when the wireless local area network function of the local device is turned on and a target device is scanned within a preset range based on the wireless local area network provided by the local device, based on the wireless local area network provided by the local device, transmit a file to the target device through a direct connection function; when the wireless local area network function of the local device is not turned on, or the target device is not scanned within the preset range based on the wireless local area network constructed by the local device, obtain the address information of the target device; when it is determined based on the address information that both the local device and the target device are connected to the wireless local area network provided by the same third-party device, based on the wireless local area network provided by the third-party device, initiate a request to establish a first data transmission connection to the target device, and after the first data transmission connection is established, transmit a file to the target device.

[0092] In one embodiment, the method implemented when the processor executes the computer program further includes: when it is determined based on the address information that the local device and the target device are not connected to the wireless local area network provided by the same third-party device, obtaining the hotspot information of the wireless local area network hotspot provided by the target device, connecting to the wireless local area network hotspot provided by the target device according to the hotspot information, and based on the wireless local area network hotspot of the target device, initiating a request to establish a second data transmission connection to the target device. When the second data transmission connection is successfully established, transmitting a file to the target device.

[0093] In one embodiment, the method implemented when the processor executes the computer program further includes: when the connection to the wireless local area network hotspot provided by the target device fails, or the establishment of the second data transmission connection fails, transmitting a file to the target device based on the cloud.

[0094] In one embodiment, transmitting a file to the target device based on the cloud when the processor executes the computer program includes: uploading the file to be transmitted to the cloud through the mobile communication network and establishing a signaling channel with the target device; based on the signaling channel, sending a download notification message to the target device so that the target device downloads the file to be transmitted from the cloud based on the mobile communication network.

[0095] In one embodiment, the process of obtaining at least one of the hotspot information or the address information when the processor executes the computer program includes: in response to a scanning operation on the encoded image displayed by the target device, obtaining at least one of the hotspot information or the address information carried by the encoded image.

[0096] In one embodiment, the scanning entry of the scanning operation when the processor executes the computer program is the application installed on the local device or the web application provided by the application installed on the local device.

[0097] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: When the wireless local area network (WLAN) function of the local device is turned on and a target device is scanned within a preset range based on the WLAN provided by the local device, a file is transmitted to the target device through a direct connection function based on the WLAN provided by the local device; When the WLAN function of the local device is not turned on, or the target device is not scanned within the preset range based on the WLAN constructed by the local device, the address information of the target device is obtained; When it is determined based on the address information that both the local device and the target device are connected to the WLAN provided by the same third-party device, a request for establishing a first data transmission connection is initiated to the target device based on the WLAN provided by the third-party device. After the first data transmission connection is established, a file is transmitted to the target device.

[0098] In one embodiment, the method implemented when the computer program is executed by the processor further includes: When it is determined based on the address information that the local device and the target device are not connected to the WLAN provided by the same third-party device, the hotspot information of the WLAN hotspot provided by the target device is obtained, the WLAN hotspot provided by the target device is connected according to the hotspot information, and a request for establishing a second data transmission connection is initiated to the target device based on the WLAN hotspot of the target device. When the second data transmission connection is successfully established, a file is transmitted to the target device.

[0099] In one embodiment, the method implemented when the computer program is executed by the processor further includes: When the WLAN hotspot provided by the target device is not successfully connected, or the establishment of the second data transmission connection fails, a file is transmitted to the target device based on the cloud.

[0100] In one embodiment, transmitting a file to the target device based on the cloud when the computer program is executed by the processor includes: uploading the file to be transmitted to the cloud through a mobile communication network and establishing a signaling channel with the target device; sending a download notification message to the target device based on the signaling channel, so that the target device downloads the file to be transmitted from the cloud based on the mobile communication network.

[0101] In one embodiment, the process of obtaining at least one of the hotspot information or the address information when the computer program is executed by the processor includes: in response to a scanning operation on the encoded image displayed by the target device, obtaining at least one of the hotspot information or the address information carried by the encoded image.

[0102] In one embodiment, the scan entry of the scan operation implemented when the computer program is executed by the processor is an application installed on the local device or a web application provided by the application installed on the local device.

[0103] In one embodiment, a computer program product is provided, including a computer program which, when executed by a processor, implements the following steps: when the local device enables the wireless local area network function and scans a target device within a preset range based on the wireless local area network provided by the local device, transmitting a file to the target device through the direct connection function based on the wireless local area network provided by the local device; when the local device does not enable the wireless local area network function or does not scan the target device within the preset range based on the wireless local area network constructed by the local device, obtaining the address information of the target device; when it is determined based on the address information that both the local device and the target device are connected to the wireless local area network provided by the same third-party device, initiating a request to establish a first data transmission connection to the target device based on the wireless local area network provided by the third-party device, and after the first data transmission connection is established, transmitting a file to the target device.

[0104] In one embodiment, the method implemented when the computer program is executed by the processor further includes: when it is determined based on the address information that the local device and the target device are not connected to the wireless local area network provided by the same third-party device, obtaining the hotspot information of the wireless local area network hotspot provided by the target device, connecting to the wireless local area network hotspot provided by the target device according to the hotspot information, initiating a request to establish a second data transmission connection to the target device based on the wireless local area network hotspot of the target device, and when the second data transmission connection is successfully established, transmitting a file to the target device.

[0105] In one embodiment, the method implemented when the computer program is executed by the processor further includes: when the wireless local area network hotspot provided by the target device is not successfully connected or the establishment of the second data transmission connection fails, transmitting a file to the target device based on the cloud.

[0106] In one embodiment, transmitting a file to the target device based on the cloud when the computer program is executed by the processor includes: uploading the file to be transmitted to the cloud through the mobile communication network and establishing a signaling channel with the target device; based on the signaling channel, sending a download notification message to the target device so that the target device downloads the file to be transmitted from the cloud based on the mobile communication network.

[0107] In one embodiment, the process of obtaining at least one of the hotspot information or the address information implemented when the computer program is executed by the processor includes: in response to a scanning operation on the encoded image displayed on the target device, obtaining at least one of the hotspot information or the address information carried by the encoded image.

[0108] In one embodiment, the scanning entry of the scanning operation implemented when the computer program is executed by the processor is the application installed on the local device or the web application provided by the application installed on the local device.

[0109] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0110] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0111] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0112] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A file transfer method, characterized in that, Applied to the local device, the method includes: When the local device enables the Wi-Fi function and scans a target device within a preset range based on the Wi-Fi provided by the local device, transfer a file to the target device through the direct connection function based on the Wi-Fi provided by the local device; When the local device does not enable the Wi-Fi function or the target device is not scanned within the preset range based on the Wi-Fi constructed by the local device, obtain the address information of the target device; When it is determined based on the address information that both the local device and the target device are connected to the Wi-Fi provided by the same third-party device, initiate a request to establish a first data transfer connection to the target device based on the Wi-Fi provided by the third-party device, and transfer a file to the target device after the first data transfer connection is established.

2. The method according to claim 1, characterized in that, The method further includes: When it is determined based on the address information that the local device and the target device are not connected to the Wi-Fi provided by the same third-party device, obtain the hotspot information of the Wi-Fi hotspot provided by the target device, connect to the Wi-Fi hotspot provided by the target device according to the hotspot information, initiate a request to establish a second data transfer connection to the target device based on the Wi-Fi hotspot of the target device, and transfer a file to the target device when the second data transfer connection is successfully established.

3. The method according to claim 2, characterized in that, The method further includes: When the Wi-Fi hotspot provided by the target device is not successfully connected or the establishment of the second data transfer connection fails, transfer a file to the target device based on the cloud.

4. The method according to claim 3, characterized in that, The transferring of the file to the target device based on the cloud includes: Upload the file to be transferred to the cloud through the mobile communication network and establish a signaling channel with the target device; Based on the signaling channel, send a download notification message to the target device so that the target device downloads the file to be transferred from the cloud based on the mobile communication network.

5. The method according to claim 2 or 3, characterized in that, The obtaining process of at least one of the hotspot information or the address information includes: In response to a scanning operation on the encoded image displayed by the target device, obtain at least one of the hotspot information or the address information carried by the encoded image.

6. The method according to claim 4, characterized in that, The scanning entry of the scanning operation is the application installed on the local device or the web application provided by the application installed on the local device.

7. A file transfer device, characterized in that, The apparatus includes: A first transfer module, configured to transfer a file to the target device through the direct connection function based on the Wi-Fi provided by the local device when the local device enables the Wi-Fi function and scans a target device within a preset range based on the Wi-Fi provided by the local device; An obtaining module, configured to obtain the address information of the target device when the local device does not enable the Wi-Fi function or the target device is not scanned within the preset range based on the Wi-Fi constructed by the local device; A second transmission module, configured to, when it is determined based on the address information that both the local device and the target device are connected to a wireless local area network provided by the same third-party device, initiate a request for establishing a first data transmission connection to the target device based on the wireless local area network provided by the third-party device, and transmit a file to the target device after the first data transmission connection is established.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.