File transmission system, file transmission method, and electronic device

Through Wi-Fi Direct technology, automatic connection and efficient file transfer between mobile devices is achieved, solving the problems of transmission rate and traffic limitations, and improving user experience and transmission efficiency.

CN113572823BActive Publication Date: 2024-11-15VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110765630.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-07
Publication Date
2024-11-15
Estimated Expiration
2041-07-07

AI Technical Summary

Technical Problem

The existing file transfer methods are subject to traffic usage restrictions and low device connection efficiency, transmission rate and distance limitations when transmitting data between mobile devices, especially in the absence of Wi-Fi environment, it is difficult to achieve stable and fast transmission.

Method used

Wi-Fi Direct technology is used to establish wireless communication connections between devices, automatically match and encapsulate files to transmit input and output streams, improving transmission rate and user experience, and no need for manual search or connection by users, shortening connection time.

Benefits of technology

It realizes automatic connection and efficient file transfer when the device is close to it, improves transmission rate and user experience, avoids traffic limitations, and provides a file transfer method with zero traffic sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113572823B_ABST
    Figure CN113572823B_ABST
Patent Text Reader

Abstract

The present application discloses a file transfer system and a transfer method, and an electronic device, which belongs to the technical field of electronic devices. The file transfer system includes: a first device and a second device; the first device includes a first file transfer module and a first wireless connection module connected to each other; the second device includes a second file transfer module and a second wireless connection module connected to each other; the first wireless connection module communicates wirelessly with the second wireless connection module, and the first file transfer module communicates wirelessly with the second file transfer module; when the first device detects that the second device is within a first preset range of the first device, the first wireless connection module establishes a Wi-Fi Direct communication connection with the second wireless connection module, and when the first wireless connection module is connected to the second wireless connection module, the first file transfer module encapsulates the file to be transferred into an input and output stream, and sends it to the second file transfer module, and the second file transfer module converts the input and output stream into the file to be transferred.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a file transmission system and method, and electronic equipment. Background Art

[0002] With the development of mobile devices, their functions are increasing, gradually replacing the use of other tools, greatly changing people's living habits, and mobile Internet has become the focus of the times. People can share data files anytime and anywhere. File transfer between mobile devices as a way of mobile data sharing has attracted more and more attention, especially for the transmission of large amounts of data.

[0003] However, data transmission is often limited by traffic usage. In some instances, files are transferred through Bluetooth connections, but Bluetooth connections have low device connection efficiency, and both the transmission rate and transmission distance are greatly limited. In another instance, files are sent through a Wi-Fi environment, but the mobile device is not always in a Wi-Fi environment, which limits file transfer. Summary of the invention

[0004] The embodiments of the present application provide a file transmission system and a transmission method, and an electronic device, which can solve the problem that the existing file transmission method cannot meet the user's needs for stable and fast file transmission.

[0005] In a first aspect, a file transmission system is provided, including: a first device and a second device;

[0006] The first device includes a first file transfer module and a first wireless connection module, the first file transfer module is connected to the first wireless connection module; the second device includes a second file transfer module and a second wireless connection module, the second file transfer module is connected to the second wireless connection module, the first wireless connection module communicates wirelessly with the second wireless connection module, and the first file transfer module communicates wirelessly with the second file transfer module;

[0007] Among them, when the first device detects that the second device is located within a first preset range of the first device, the first wireless connection module establishes a Wi-Fi Direct communication connection with the second wireless connection module, and when the first wireless connection module is connected to the second wireless connection module, the first file transfer module encapsulates the file to be transferred into an input and output stream and sends it to the second file transfer module, and the second file transfer module converts the input and output stream into the file to be transferred.

[0008] In a second aspect, a file transmission method is provided, which is applied to a first device and includes:

[0009] When it is detected that the second device is within the first preset range of the first device, the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device;

[0010] The first file transmission module of the first electronic device encapsulates the file to be transmitted and converts it into an input and output stream;

[0011] When the first wireless connection module and the second wireless connection module are connected to each other, the first file transmission module sends the input and output streams to the second file transmission module of the second device.

[0012] In a third aspect, an electronic device is provided, applied to a second device, including:

[0013] The second wireless connection module of the second device establishes a Wi-Fi Direct communication connection with the first wireless connection module of the first device;

[0014] When the second wireless connection module is connected to the first wireless connection module, the second file transmission module of the second device receives the input and output streams sent by the first file transmission module of the first device;

[0015] The second file transmission module converts the input and output streams into files to be transmitted.

[0016] In a fourth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the second aspect, or implements the steps of the method described in the third aspect when executed by the processor.

[0017] In a fifth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented, or when the program or instruction is executed by a processor, the steps of the method described in the third aspect are implemented.

[0018] In the sixth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instructions to implement the method described in the second aspect, or the processor is used to run a program or instructions to implement the method described in the third aspect.

[0019] In an embodiment of the present application, a file transmission system is disclosed, which includes a first device and a second device, the first device includes a first file transmission module and a first wireless connection module, the first file transmission module is connected to the first wireless connection module, the second device includes a second file transmission module and a second wireless connection module, the second file transmission module is connected to the second wireless connection module, the first wireless connection module and the second wireless connection module communicate wirelessly, the first file transmission module and the second file transmission module communicate wirelessly, when the first device detects that the second device is located within a first preset range of the first device, the first wireless connection module and the second wireless connection module establish a Wi-Fi Direct communication connection, when the first wireless connection module and the second wireless connection module are connected, the first file transmission module encapsulates the file to be transmitted into an input and output stream, and sends it to the second file transmission module, and the second file transmission module converts the input and output stream into the file to be transmitted. In the embodiment of the present application, the file transmission between devices is performed through the Wi-Fi Direct technology. When the two devices are close to each other, there is no need for the user to manually click to search or connect, and the connection can be automatically matched and established, which shortens the connection time. The use of the Wi-Fi Direct technology for transmission improves the transmission rate and enhances the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 is a schematic diagram of a file transmission system provided by an embodiment of the present application;

[0022] Figure 2 is a flowchart of a file transmission method provided by an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of an electronic device provided by an embodiment of the present application;

[0024] Figure 4 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, the "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.

[0027] The following is combined with Figure 1-4 , a file transmission system and transmission method, and an electronic device provided in an embodiment of the present application are described in detail through specific embodiments and their application scenarios.

[0028] Figure 1 A file transmission system is provided in an embodiment of the present application. Figure 1 As shown, the file transmission system may include: a first device and a second device.

[0029] Specifically, the first device includes a first file transfer module and a first wireless connection module, and the first file transfer module is connected to the first wireless connection module; the second device includes a second file transfer module and a second wireless connection module, and the second file transfer module is connected to the second wireless connection module, the first wireless connection module communicates wirelessly with the second wireless connection module, and the first file transfer module communicates wirelessly with the second file transfer module.

[0030] Among them, when the first device detects that the second device is located within the first preset range of the first device, the first wireless connection module establishes a Wi-Fi Direct communication connection with the second wireless connection module. When the first wireless connection module is connected to the second wireless connection module, the first file transfer module encapsulates the file to be transferred into an input and output stream and sends it to the second file transfer module. The second file transfer module converts the input and output streams into files to be transferred.

[0031] It is worth noting that the first device can be a device that sends files or a device that receives files, and the second device can be a device that sends files or a device that receives files. In this embodiment, the first device is used as a device that sends files, and the second device is used as a device that receives files. The number of the first device and the second device can be one or more.

[0032] The first device and the second device may be mobile electronic devices or non-mobile electronic devices. For example, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiments of the present application.

[0033] For example, the first device and the second device may be a mobile phone, a bracelet, etc. If it is a mobile phone, the mobile phone may also include other modules, such as a CPU (central processing unit), a battery, a camera, a display screen, etc.

[0034] In an embodiment of the present application, a file transmission system is disclosed, which includes a first device and a second device, the first device includes a first file transmission module and a first wireless connection module, the first file transmission module is connected to the first wireless connection module, the second device includes a second file transmission module and a second wireless connection module, the second file transmission module is connected to the second wireless connection module, the first wireless connection module and the second wireless connection module communicate wirelessly, the first file transmission module and the second file transmission module communicate wirelessly, when the first device detects that the second device is located within a first preset range of the first device, the first wireless connection module and the second wireless connection module establish a Wi-Fi Direct communication connection, when the first wireless connection module and the second wireless connection module are connected, the first file transmission module encapsulates the file to be transmitted into an input and output stream, and sends it to the second file transmission module, and the second file transmission module converts the input and output stream into the file to be transmitted. In the embodiment of the present application, the file transmission between devices is performed through the Wi-Fi Direct technology. When the two devices are close to each other, there is no need for the user to manually click to search or connect, and the connection can be automatically matched and established, which shortens the connection time. The use of the Wi-Fi Direct technology for transmission improves the transmission rate and enhances the user experience.

[0035] In a possible implementation manner of the present application, the first device includes a human-computer interaction module, and the human-computer interaction module is electrically connected to the first file transmission module and the first wireless connection module respectively.

[0036] The human-computer interaction module is used to provide an entry for user operations, and the human-computer interaction module can provide users with an operation interface and information display. The information may include file selection information, menu button information, storage path information, device information, connection status information, file content information, and transmission progress information.

[0037] Optionally, the second device may also include a human-computer interaction module.

[0038] In a possible implementation of the present application, the first device may include a first acquisition module, and the first acquisition module is used to acquire the Mac addresses (Media Access Control Address, local area network address) of all devices within a second preset range of the first device.

[0039] The second device may include a second acquisition module, and the second acquisition module is used to acquire the Mac addresses of all devices within a second preset range of the second device.

[0040] In this embodiment, the device can obtain the Mac addresses of other devices within a certain range of the device through the acquisition module, and store the Mac addresses. When a Mac with a corresponding address approaches in the future, it can be directly connected without the user manually clicking on search, connection, etc., which greatly shortens the connection time and improves the user experience.

[0041] The present application also provides a method for transferring files. Figure 2 The file transmission method is applied to the first device, and the file transmission method may include the contents shown in step S201 to step S203.

[0042] In step S201, when it is detected that the second device is located within a first preset range of the first device, the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device.

[0043] That is, when the second device is close to the first device, the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device.

[0044] In step S202, the first file transmission module encapsulates the file to be transmitted and converts it into an input and output stream.

[0045] In step S203, when the first wireless connection module and the second wireless connection module are connected to each other, the first file transmission module sends the input and output streams to the second file transmission module of the second device.

[0046] In an embodiment of the present application, first, when it is detected that the second device is within the first preset range of the first device, the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device, and the first file transfer module encapsulates the file to be transferred and converts it into an input and output stream. When the first wireless connection module and the second wireless connection module are connected to each other, the first file transfer module sends the input and output streams to the second file transfer module of the second device. In this embodiment, the file transfer between devices is performed through the Wi-Fi Direct technology. When the two devices are close to each other, there is no need for the user to manually click to search or connect. The connection can be automatically matched and established, which shortens the connection time. The use of Wi-Fi Direct technology for transmission improves the transmission rate and enhances the user experience.

[0047] It should be noted that there is no order between step S201 and step S202, and they can be performed simultaneously, or one step can be performed first, which is not limited in this embodiment.

[0048] In a possible implementation of the present application, when it is detected that the second device is within the first preset range of the first device, before the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device, the file transmission method may further include the following steps.

[0049] Obtain the Mac addresses of all devices within the second preset range of the first device, and create NdefMessage data according to the Mac addresses.

[0050] In this embodiment, any device can obtain the Mac address of other devices within the mobile range and create NdefMessage data based on the Mac address, where NdefMessage data is information in NDEF (NFC Data Exchange Format) format for data information transmission between devices. When a Mac with a corresponding address approaches in the future, it can be directly connected without the user manually clicking to search and connect, which greatly shortens the connection time and improves the user experience.

[0051] In a possible implementation of the present application, the first wireless connection module of the first device and the second wireless connection module of the second device establish a Wi-Fi Direct communication connection, which may include the following steps.

[0052] Upon receiving a connection request sent by a second device, parse the NdefMessage data of the second device to obtain the Mac address of the second device; based on the Mac address of the second device, search for the device information of the second device corresponding to the Mac address, and obtain the device parameters of the second device, wherein the connection request sent by the second device carries the Mac address of the second device; based on the device parameters of the second device, accept the connection request sent by the second device and connect to the second device.

[0053] That is, the first device can first create NdefMessage data based on the local Mac address. When the second device approaches, the created NdefMessage data is sent to the second device through the point-to-point function. The second device parses the NdefMessage data, obtains the Mac address of the first device, and then switches to the Wi-Fi Direct connection part to connect, that is, sends a connection request to the first device.

[0054] Among them, the search can include two states: scanning and listening. Switching back and forth between the two states is to discover other devices. During the scanning phase, detection requests are continuously sent for active scanning. In the scanning state, detection requests from other devices are not processed. In the listening state, detection requests are listened to and responded to.

[0055] In this embodiment, during the Wi-Fi Direct connection process, only one device needs to read the Wi-Fi Direct device information of the other party to initiate a connection. Therefore, both devices do not need to send NdefMessage data, and there is no need to send NdefMessage data all the time. Therefore, in the implementation of point-to-point transmission of Wi-Fi Direct information, the callback is used to complete the sending of NdefMesage data. The first device calls to send NdefMessage data after file selection, and the second device does not need to call it. It can directly read the other party's NdefMessage data when the first device is close.

[0056] In a possible implementation manner of the present application, the first file transmission module encapsulates the file to be transmitted and converts it into an input and output stream, which may include the following steps.

[0057] The uniform resource identifier URI of the file to be transmitted is obtained; a socket is established according to the URI; the first file transmission module encapsulates the file to be transmitted and converts it into an input and output stream; the first file transmission module connects the input and output stream with the socket.

[0058] Among them, file URI refers to the use of the Transmission Control Protocol (TPC) transmission protocol to establish socket communication. File URI is a string used to identify the name of an Internet resource. The identifier allows users to interact with any resource through a specific protocol, including local resources and Internet resources. File URI represents the file to be transmitted. The device can obtain various information such as the file path, file name, file size, etc. based on the file URI.

[0059] This embodiment is based on TCP Socket communication, encapsulates and transforms the transmission file data, realizes file transmission, and improves the transmission rate and distance.

[0060] In a possible implementation of the present application, when the first wireless connection module and the second wireless connection module are connected to each other, the first file transfer module sends the input and output streams to the second file transfer module of the second device, which may include: when the first wireless connection module and the second wireless connection module are connected to each other, the first file transfer module sends the input and output streams to the second file transfer module of the second device through a socket.

[0061] In this embodiment, the file transfer process does not require the use of the network, has no traffic restrictions on users, is zero-traffic sharing, and does not require users to manually click on search, connect, etc., which greatly shortens the connection time and improves the user experience.

[0062] The embodiment of the present application also provides a file transmission method. The file transmission method is applied to the second device, and the file transmission method may include the following steps.

[0063] The second wireless connection module of the second device establishes a Wi-Fi Direct communication connection with the first wireless connection module of the first device; when the second wireless connection module and the first wireless connection module are connected to each other, the second file transfer module of the second device receives the input and output streams sent by the first file transfer module of the first device; the second file transfer module converts the input and output streams into files to be transferred.

[0064] In this embodiment, files are transferred between devices through Wi-Fi Direct technology. When two devices are close to each other, there is no need for the user to manually click to search or connect. The connection can be automatically matched and established, which shortens the connection time. The use of Wi-Fi Direct technology for transmission improves the transmission rate and enhances the user experience.

[0065] In a possible implementation of the present application, before the second wireless connection module of the second device establishes a Wi-Fi Direct communication connection with the first wireless connection module of the first device, the method may also include: obtaining the Mac addresses of all devices within a second preset range of the second device; and creating NdefMessage data based on the Mac addresses.

[0066] In a possible implementation of the present application, the second wireless connection module of the second device establishes a Wi-Fi Direct communication connection with the first wireless connection module of the first device, which may include the following steps.

[0067] The second wireless connection module of the second device reads the NdefMessage data of the first device; parses the NdefMessage data to obtain the Mac address of the first device; searches for the device information of the first device corresponding to the Mac address to obtain the device parameters of the first device; determines that the first device is a connection object based on the device parameters of the first device, and sends a connection request to the first device.

[0068] In the embodiment of the present application, a new NdefMessag can be called during the process of receiving a file on the second device to create an NdefMessage message. After the point-to-point is close, the set NdefMessage message is sent out, and a flag of successful data transmission is obtained, indicating that the data is successfully transmitted. The execution of Wi-Fi Direct device search is added to this method as a node for point-to-point to Wi-Fi Direct conversion. The monitoring process is used to notify the status of operation execution during the Wi-Fi Direct connection process and return device information, etc. It is mainly used to monitor the success and failure status of device search and connection, obtain the device list, and perform device matching at this time to initiate a connection. The application can obtain the other party's address at this time and establish Socket communication.

[0069] The second device can check the content of the received file to determine whether the file has been transferred. If not, it sends information to the first device to request another transfer until the transfer is completed; if the transfer is completed, no further transfer is initiated. In a possible implementation of the present application, when the second wireless connection module and the first wireless connection module are connected to each other, the second file transfer module of the second device receives the input and output streams sent by the first file transfer module of the first device, which may include: when the second wireless connection module and the first wireless connection module are connected to each other, the second file transfer module connects to the input and output streams of the first file transfer module of the first device through the socket input and output streams.

[0070] Optional, such as Figure 3As shown, an embodiment of the present application also provides an electronic device 300, including a processor 301, a memory 302, and a program or instruction stored in the memory 302 and executable on the processor 301. When the program or instruction is executed by the processor 301, each process of the above-mentioned file transfer method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0071] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0072] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement each embodiment of the present application is provided below.

[0073] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109 and a processor 110.

[0074] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0075] Among them, the radio frequency unit 101, that is, the first wireless connection module in the embodiment of the present application, is used to establish a Wi-Fi Direct communication connection with the second wireless connection module of the second device when the first device detects that the second device is within a first preset range of the first device.

[0076] The radio frequency unit 101, namely the first file transmission module in the embodiment of the present application, is used to encapsulate the transmission file and convert it into an input and output stream.

[0077] The radio frequency unit 101, namely the first file transmission module in the embodiment of the present application, is configured to send the input and output streams to the second file transmission module of the second device.

[0078] In an embodiment of the present application, first, when the first device detects that the second device is within the first preset range of the first trial, the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device, and the first file transfer module of the first device encapsulates the file to be transferred and converts it into an input and output stream. Then, when the first wireless connection module and the second wireless connection module are connected to each other, the first file transfer module sends the input and output streams to the second file transfer module of the second device. In this embodiment, files are transferred between devices using Wi-Fi Direct technology. When two devices are close to each other, there is no need for the user to manually click to search or connect. The connection can be automatically matched and established, which shortens the connection time. The use of Wi-Fi Direct technology for transmission improves the transmission rate and enhances the user experience.

[0079] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 109 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 110 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.

[0080] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned file transfer method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0081] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0082] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned file transfer method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0083] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0084] The embodiment of the present application further provides a processing device, which is configured to execute the various processes of the above-mentioned file transfer method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0085] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0087] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A file transmission system, characterized in that: include: a first device and a second device; The first device includes a first file transfer module and a first wireless connection module, the first file transfer module is connected to the first wireless connection module; the second device includes a second file transfer module and a second wireless connection module, the second file transfer module is connected to the second wireless connection module, the first wireless connection module communicates wirelessly with the second wireless connection module, and the first file transfer module communicates wirelessly with the second file transfer module; The first device includes a first acquisition module, the first acquisition module is used to obtain a Mac address of the first device, and create NdefMessage data according to the Mac address; Among them, when the first device detects that the second device is located within a first preset range of the first device, the first device sends the NdefMessage data to the second device, the second device parses the NdefMessage data, obtains the Mac address of the first device, and determines the Wi-Fi Direct information of the first device based on the Mac address. Based on the Wi-Fi Direct information, the first wireless connection module and the second wireless connection module establish a Wi-Fi Direct communication connection. When the first wireless connection module and the second wireless connection module are connected, the first file transfer module encapsulates the file to be transferred into an input and output stream and sends it to the second file transfer module. The second file transfer module converts the input and output streams into the file to be transferred.

2. The system according to claim 1, characterized in that The first device includes a human-computer interaction module, and the human-computer interaction module is electrically connected to the first file transmission module and the first wireless connection module respectively.

3. The system according to claim 1, characterized in that The first device includes a first acquisition module, and the first acquisition module is used to acquire the Mac addresses of all devices within a second preset range of the first device; The second device includes a second acquisition module, and the second acquisition module is used to acquire the Mac addresses of all devices within a second preset range of the second device.

4. A file transmission method, applied to a first device, characterized in that: include: When it is detected that the second device is within the first preset range of the first device, the first device sends NdefMessage data to the second device, where the NdefMessage data is created by the first device according to the Mac address of the first device; The first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device; The first file transmission module of the first device encapsulates the file to be transmitted and converts it into an input and output stream; When the first wireless connection module and the second wireless connection module are connected to each other, the first file transmission module sends the input and output streams to the second file transmission module of the second device.

5. The method according to claim 4, characterized in that In the case where it is detected that the second device is within the first preset range of the first device, before the first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device, the method further includes: Obtain the Mac addresses of all devices within a second preset range of the first device.

6. The method according to claim 5, characterized in that The first wireless connection module of the first device establishes a Wi-Fi Direct communication connection with the second wireless connection module of the second device, including: Upon receiving the connection request sent by the second device, obtaining the Mac address of the second device; According to the Mac address of the second device, searching for device information of the second device corresponding to the Mac address, and obtaining device parameters of the second device, wherein the connection request sent by the second device carries the Mac address of the second device; According to the device parameters of the second device, accept the connection request sent by the second device and connect to the second device.

7. The method according to claim 4, characterized in that The first file transfer module encapsulates the file to be transferred and converts it into an input and output stream, including: Get the uniform resource identifier URI of the file to be transferred; Establishing a socket according to the URI; The first file transmission module encapsulates the file to be transmitted and converts it into an input and output stream; The first file transfer module connects the input and output streams to the socket.

8. The method according to claim 7, characterized in that The first file transmission module sends the input and output streams to the second file transmission module of the second device when the first wireless connection module and the second wireless connection module are connected to each other, including: When the first wireless connection module and the second wireless connection module are connected to each other, the first file transmission module sends the input and output streams to the second file transmission module of the second device through the socket.

9. A file transmission method, applied to a second device, characterized in that: include: The second wireless connection module of the second device reads the NdefMessage data of the first device; Parsing the NdefMessage data to obtain the Mac address of the first device; Searching for device information of a first device corresponding to the Mac address, and obtaining device parameters of the first device; Determine, according to the device parameters of the first device, that the first device is a connection target, and send a connection request to the first device; The second wireless connection module of the second device establishes a Wi-Fi Direct communication connection with the first wireless connection module of the first device; When the second wireless connection module is connected to the first wireless connection module, the second file transmission module of the second device receives the input and output streams sent by the first file transmission module of the first device; The second file transmission module converts the input and output streams into files to be transmitted.

10. The method according to claim 9, characterized in that Before the second wireless connection module of the second device establishes a Wi-Fi Direct communication connection with the first wireless connection module of the first device, the method further includes: Obtain the Mac addresses of all devices within a second preset range of the second device.

11. The method according to claim 9, characterized in that The second file transfer module of the second device receives the input and output streams sent by the first file transfer module of the first device when the second wireless connection module is connected to the first wireless connection module, including: When the second wireless connection module is connected to the first wireless connection module, the second file transfer module is connected to the input and output streams of the first file transfer module of the first device through the socket input and output streams.

12. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in any one of claims 4 to 8, or the processor, when executed, implements the steps of the method described in any one of claims 9 to 11.