Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, shall fall within the scope of protection of the present invention.
Fig. 1 is a schematic diagram of file transmission between a terminal 100 and a receiver 300 according to an embodiment of the present invention.
The embodiment of the invention relates to a terminal 100 and a method for controlling file transmission, wherein the terminal 100 transmits a file to a receiver 300 in a wireless transmission mode, and the terminal 100 can be a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Point of Sales (POS), a vehicle-mounted computer, or the like. The terminal 100 may act as a sender of a file or a receiver of a file. In the embodiment of the present invention, the terminal 100 serves as a sender of the file.
Fig. 2 is a schematic structural diagram of the terminal 100 according to an embodiment of the present invention.
Referring to fig. 2, a terminal 100 according to an embodiment of the present invention includes a wireless transmitter 110, a processor 120, and an input unit 130; the input unit 130 receives an operation instruction of selecting a target transmission file by a user, the processor 120 determines the target transmission file according to the operation instruction, determines the size of the target transmission file according to the attribute of the target file, and selects a transmission mode matched with the size of the target transmission file, wherein the wireless transmitter 110 supports at least two wireless transmission modes; the processor 120 controls the wireless transmitter 110 to transmit the target transmission file by a transmission mode matching the size of the target transmission file.
In the embodiment of the present invention, the terminal 100 selects a transmission mode matching the size of the target transmission file according to the size of the target transmission file, so that the terminal 100 can save energy consumption and improve transmission efficiency when transmitting the target transmission file.
The wireless transmitter 110 may include an NFC (Near Field Communication) transmission module 111, a bluetooth transmission module 112, and/or a WIFI direct (wireless direct) transmission module 113.
The wireless transmitter 110 may further include an antenna 115 (e.g., a 3G antenna or an LTE antenna), wherein the antenna 115 may be used for receiving and transmitting information during information transmission and reception or a call, and in particular, for processing the received downlink information of the base station to the processor 120; in addition, the uplink information is transmitted to the base station. The wireless transmitter 110 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), and the like.
The input unit 130 may be used to receive input numeric or character information and generate signal inputs related to user settings and function control of the terminal 100. Specifically, in the embodiment of the present invention, the input unit 130 may include a touch panel 131. The touch panel 131, also referred to as a touch screen, may collect touch operations of a user (e.g., operations of the user on the touch panel 131 or on the touch panel 131 by using any suitable object or accessory such as a finger or a stylus) on or near the touch panel 131, and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 131 may include two parts, i.e., a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 120, and can receive and execute commands sent by the processor 120. In addition, the touch panel 131 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 131, the input unit 130 may also include other input devices 132, and the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The terminal 100 may further include a display unit 140 and a memory 150, and the display unit 140 may be used to display information input by the user or information provided to the user and various menu interfaces of the terminal 100. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
The memory 150 may be used to store software programs and modules, and the processor 120 executes various functional applications and data processing of the terminal 100 by operating the software programs and modules stored in the memory 150. The memory 140 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as text data, audio data, a phonebook, etc.) created according to the use of the terminal 100, and the like. Further, the memory 140 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The terminal 100 may also include components such as an audio circuit 170, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 2 does not constitute a limitation of the terminal 100 and may include more or fewer components than shown in fig. 2, e.g., the audio circuit 170 may be absent from a portion of the terminal, or certain components may be combined, or a different arrangement of components.
The audio circuit 170 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 170 and converted into audio information, which is then output to the RF circuit to be transmitted to, for example, another cellular phone.
The power supply 190 may be logically coupled to the processor 120 through a power management system, such that the power management system may manage charging, discharging, and power consumption.
The processor 120 is a control center of the terminal 100, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the terminal 100 and processes data by operating or executing software programs and/or modules stored in the memory 150 and calling data stored in the memory 150, thereby monitoring the terminal 100 as a whole. Optionally, the processor 120 may include one or more processing units.
Specifically, the processor 120 controls the wireless transmitter 110 to establish at least two wireless transmission modes with the receiving party 300, including,
the processor 120 controls the wireless transmitter 110 to establish NFC short-range wireless transmission and bluetooth wireless transmission with the recipient 300; or, establishing NFC short-distance wireless transmission and wireless transmission directly connected with WIFI of the receiver 300; or, establishing NFC short-range wireless transmission and bluetooth and WIFI direct wireless transmission with the receiver 300. Optionally, the processor 120 may start the transmission module corresponding to the selected wireless transmission mode according to the selected wireless transmission mode.
Further, the processor 120 receives an operation instruction of selecting a target transmission file by a user, determines the target transmission file according to the operation instruction, including,
the processor 120 generates an instruction signal according to a selection operation of the user operation input unit 130, and the processor 120 determines a target transmission file according to the instruction signal, wherein the target transmission file can be a picture file, a text file, a video file, or an audio file.
Further, the processor 120 determines the size of the target transfer file according to the attribute of the target transfer file, including,
the processor 120 determines that the size of the target transmission file does not reach a predetermined range; or judging that the size of the target transmission file is in the preset range; or judging that the size of the target transmission file exceeds the preset range.
For example, the predetermined range of the size of the target transmission file is predefined as (1M, 2M), and the predetermined ranges related to the following embodiments are all referred to as the predetermined range (1M, 2M), the processor 120 determines that the size of the target transmission file does not reach the predetermined range if the size of the target transmission file is 0.5M according to the attribute information of the target transmission file, and determines that the size of the target transmission file reaches the predetermined range if the size of the target transmission file is 1.5M or 5M.
Further, the processor 120 selects a transmission mode corresponding to the size of the target transmission file, including,
the processor 120 selects an NFC transmission mode according to the size of the target transmission file not reaching the predetermined range; or the processor 120 selects a transmission mode of bluetooth and/or WIFI direct connection according to the size of the target transmission file reaching a predetermined range.
Optionally, the processor 120 selects a transmission mode corresponding to the size of the target transmission file, and may further include,
the processor 120 may divide the target transmission file into at least two data groups according to the size of the target transmission file reaching a predetermined range, and select a transmission mode matching the size of each data group.
Further, the processor 120 selects an NFC transmission mode for the data group that does not reach the predetermined range; and selecting a Bluetooth and/or WIFI direct connection transmission mode for the data group reaching the preset range.
For example, if the processor 120 determines that the size of the target transmission file reaches the predetermined range, the target transmission file may be divided into two data groups or three data groups, and a transmission mode corresponding to the size of each data group may be selected, where the sizes of the data groups may be different. In this embodiment, the processor 120 divides the target transmission file into three data sets for example.
The processor 120 selects one of the data sets that does not reach the predetermined range, and selects an NFC transmission mode; the processor 120 selects a bluetooth transmission mode and/or a WIFI direct transmission mode for the remaining data sets.
The three data groups in this embodiment correspond to an NFC transmission mode, a bluetooth transmission mode, and a WIFI direct transmission mode, respectively, according to the size of the data group.
As shown in table 1, if the processor 120 determines that the size of the target file is 6M and the predetermined range is (1M, 2M ], the processor 120 may divide the data of the target file into three data sets with different sizes, where the size of the data set 1 is 1M, the size of the data set 2 is 2M, and the size of the data set 3 is 3M, select the NFC transmission mode corresponding to the data set 1 that does not reach the predetermined range, select the bluetooth transmission mode corresponding to the data set 2 in the predetermined range, and select the WIFI direct connection transmission mode corresponding to the data set 3.
Further or optionally, after the processor 120 selects the transmission mode matching the size of each data group, each data group may be further divided into a plurality of data slices, where the transmission mode corresponding to each data slice is consistent with the transmission mode corresponding to the data group to which the data slice belongs, and referring to table 1, the number of data slices divided by each data group by the processor 120 is different.
Data set
|
Size of data group
|
Number of data pieces
|
Transmission mode
|
Data set 1
|
1M
|
5
|
NFC
|
Data set 2
|
2M
|
4
|
Bluetooth
|
Data set 2
|
3M
|
3
|
WIFI direct connection
|
TABLE 1
Optionally, the processor 120 may further divide the target transmission file into a plurality of data groups with equal size, and correspond the plurality of data groups to the three transmission modes, where the size of each data group is not within the predetermined range (1M, 2M).
For example, as shown in table 2, the size of the target transfer file is 3M, the target transfer file may be divided into 3 data groups with a size of 1M, and each data group corresponds to an NFC transmission mode, a bluetooth transmission mode, and a WIFI direct transmission mode.
Data set
|
Size of data group
|
Number of
|
Transmission mode
|
Data set 1
|
1M
|
5
|
NFC
|
Data set 2
|
1M
|
5
|
Bluetooth
|
Data set 2
|
1M
|
5
|
WIFI direct connection
|
TABLE 2
It can be understood that the processor 120 may select an NFC transmission mode and a bluetooth transmission mode according to the size of the data, may also select an NFC transmission mode and a WIFI direct connection transmission mode, and may also select a bluetooth transmission mode and a WIFI direct connection transmission mode.
Further, the processor 120 transmits the target transmission file by a wireless transmission mode matching with the size of the target transmission file, including: when the processor 120 selects NFC transmission, the NFC transmission module is turned on to transmit the target transmission file; when the processor 120 selects a transmission mode of bluetooth transmission and/or WIFI direct connection, the bluetooth transmission module and/or WIFI direct connection transmission module is turned on to transmit the target transmission file.
Optionally, when the processor 120 selects NFC transmission, the target transmission file may be transmitted through a pre-opened NFC transmission module; when the processor 120 selects a bluetooth transmission mode and/or a WIFI direct connection transmission mode, the target transmission file may be transmitted through a bluetooth transmission module and/or a WIFI direct connection transmission module that is turned on in advance. Further or optionally, after the processor 120 transmits the target transmission file in the NFC transmission mode, the processor 120 determines whether the distance between the terminal 100 and the receiver 300 exceeds the transmission distance of the NFC connection, if the distance exceeds the transmission distance, the NFC transmission mode is interrupted, and the target transmission file is continuously transmitted to the receiver 300 in the bluetooth or WIFI direct connection transmission mode, otherwise, the target transmission file is transmitted to the receiver 300 through the NFC.
It can be understood that, if the processor 120 determines that the distance between the terminal 100 and the receiver 300 exceeds the transmission distance of the NFC, a prompt box may be displayed to prompt the user that the distance between the terminal 100 and the receiver 300 exceeds the transmission distance of the NFC connection, the terminal 100 is brought close to the receiver 300 to continue to transmit the target transmission file, or the user is prompted to select bluetooth or WIFI direct connection to continue to transmit the target transmission file, and the processor 120 continues to transmit the target transmission file according to the transmission mode selected by the user.
Optionally, the processor 120 may not display a prompt box, and automatically select bluetooth or WIFI direct connection to continue transmitting the target transmission file.
Further or alternatively, when the processor 120 determines that the current transmission mode is a bluetooth and/or WIFI direct transmission mode, and determines that the battery power of the terminal 100 is lower than the threshold value, when the distance between the terminal 100 and the receiver 300 is within the NFC transmission distance, the bluetooth and/or WIFI direct transmission mode may be interrupted, and the target transmission file is continuously transmitted to the receiver 300 through the NFC transmission mode.
Further or alternatively, when the processor 120 determines that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection, and determines that the battery power of the terminal 100 is lower than a threshold value, when the distance between the terminal 100 and the receiver 300 exceeds the transmission distance of the NFC, the user may be prompted to bring the terminal 100 close to the receiver 300, so as to perform transmission through the NFC, and select to interrupt the transmission mode of WIFI direct connection/bluetooth.
Further or alternatively, when the processor 120 determines that the current transmission mode is a bluetooth and/or WIFI direct transmission mode and determines that the battery power of the terminal 100 is lower than the threshold value, the target transmission file may be transmitted by using the WIFI direct and/or bluetooth transmission mode continuously.
Further or alternatively, when the processor 120 determines that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection and determines that the battery power of the terminal 100 is lower than the threshold value, the transmission mode of bluetooth and/or WIFI direct connection may be interrupted, so that transmission of the target transmission file is interrupted. In the embodiment of the present invention, the terminal 100 selects the transmission mode corresponding to the size of the target transmission file according to the size of the target transmission file, so that the terminal 100 can save energy consumption and improve transmission efficiency when transmitting the target transmission file.
Fig. 3 is a schematic structural diagram of a terminal 200 according to another embodiment of the present invention.
The terminal 200 includes a receiving module 210, a determining module 220, a determining module 230, a selecting module 240 and a transmission control module 250, wherein the receiving module 210 receives an operation instruction of a user selecting a target transmission file; the determining module 220 determines the target transmission file according to the operation instruction; the determining module 230 determines the size of the target transmission file according to the attribute of the target transmission file; the selecting module 240 selects a transmission mode matching with the size of the target transmission file, wherein the terminal 200 supports at least two wireless transmission modes; the transmission control module 250 transmits the target transmission file in a transmission mode matching the size of the target transmission file.
In the embodiment of the present invention, the terminal 200 selects a transmission mode matching the size of the target transmission file according to the size of the target transmission file, so that the terminal 200 can save energy consumption and improve transmission efficiency when transmitting the target transmission file.
Wherein, the transmission control module 250 can control to establish at least two wireless transmission modes with the receiving party 300 in advance, including,
the transmission control module 250 controls the terminal 200 to establish NFC (Near Field Communication) and bluetooth wireless transmission with the receiver 300; or, establishing NFC short-distance wireless transmission and wireless transmission directly connected with WIFI of the receiver 300; or, establishing NFC short-range wireless transmission and bluetooth and WIFI direct wireless transmission with the receiver 300.
Optionally, the transmission control module 250 may further start the transmission module corresponding to the selected wireless transmission mode after the wireless transmission mode selected by the selection module 240.
Further, the receiving module 210 receives an operation instruction of selecting a target transmission file by a user, determines the target transmission file according to the operation instruction, including,
the receiving module 210 generates an instruction signal according to a selection operation of the user operation input unit 130. The determination module 220 is configured to determine whether the received signal is a signal,
and determining a target transmission file according to the instruction signal, wherein the target transmission file can be a picture file, a text file, a video file or an audio file.
Further, the determining module 230 determines the size of the target transmission file according to the attribute of the target transmission file, including,
the determining module 230 determines that the size of the target transmission file does not reach a predetermined range; or judging that the size of the target transmission file is in the preset range; or judging that the size of the target transmission file exceeds the preset range.
For example, the predetermined range of the size of the target transmission file is predefined as (1M, 2M), and the predetermined ranges related to the following embodiments are all referred to as the predetermined range (1M, 2M), the determining module 230 determines that the size of the target transmission file is 0.5M, then determines that the size of the target transmission file does not reach the predetermined range, and determines that the size of the target transmission file is 1.5M or 5M, then determines that the size of the target transmission file reaches the predetermined range.
Further, the selection module 240 selects a transmission mode corresponding to the size of the target transmission file, including,
the selecting module 240 selects an NFC transmission mode according to the size of the target transmission file not reaching a predetermined range; or the selecting module 240 selects a transmission mode of bluetooth and/or WIFI direct connection according to the size of the target transmission file reaching a predetermined range.
Optionally, the selecting module 240 selects a transmission mode corresponding to the size of the target transmission file, and may further include,
the selecting module 240 may divide the target transmission file into at least two data groups according to the size of the target transmission file reaching a predetermined range, and select a transmission mode matching the size of each data group.
Further, the selecting module 240 selects NFC transmission for the data group that does not reach the predetermined range; and selecting the Bluetooth transmission mode and/or the WIFI direct connection mode for the data group reaching the preset range.
For example, the selection module 240 divides the target transmission file reaching a predetermined range into two data groups or three data groups, and selects a transmission mode corresponding to the size of each data group, wherein the sizes of the data groups may be different. In this embodiment, the selection module 240 is used to divide the target transmission file into three data groups for illustration.
The selecting module 240 selects one of the data sets that does not reach the predetermined range, corresponding to the NFC transmission mode; the selection module 240 selects the bluetooth transmission mode and/or the WIFI direct transmission mode corresponding to the remaining data sets.
In the three data groups in this embodiment, the selecting module 240 selects an NFC transmission mode, a bluetooth transmission mode, and a WIFI direct connection transmission mode for the write data group according to the size of the data group.
As shown in table 1, the size of the target transmission file is 6M, the predetermined range is (1M, 2M ], and then the selection module 240 may divide the data of the target transmission file into three data sets with different sizes, where the size of the data set 1 is 1M, the size of the data set 2 is 2M, and the size of the data set 3 is 3M, the data set 1 that does not reach the predetermined range is selected to correspond to the NFC transmission mode, the data set 2 that is within the predetermined range is selected to correspond to the bluetooth transmission mode, and the data set 3 is selected to correspond to the WIFI direct connection transmission mode.
Further or optionally, after the selecting module 240 selects the transmission mode matched with the size of each data group, each data group may be further divided into a plurality of data slices, where the transmission mode corresponding to each data slice is consistent with the transmission mode corresponding to the data group to which the data slice belongs, and referring to table 1, the number of data slices divided by each data group by the selecting module 240 is different.
Data set
|
Size of data group
|
Number of data pieces
|
Transmission mode
|
Data set 1
|
1M
|
5
|
NFC
|
Data set 2
|
2M
|
4
|
Bluetooth
|
Data set 2
|
3M
|
3
|
WIFI direct connection
|
TABLE 1
Optionally, the selecting module 240 may further divide the target transmission file into a plurality of data groups with equal size, and correspond the plurality of data groups to the three transmission modes, where the size of each data group is not within the predetermined range (1M, 2M).
For example, as shown in table 2, the size of the target transfer file is 3M, the target transfer file may be divided into 3 data groups with a size of 1M, and each data group corresponds to an NFC transmission mode, a bluetooth transmission mode, and a WIFI direct transmission mode.
Data set
|
Size of data group
|
Number of
|
Transmission mode
|
Data set 1
|
1M
|
5
|
NFC
|
Data set 2
|
1M
|
5
|
Bluetooth
|
Data set 2
|
1M
|
5
|
WIFI direct connection
|
TABLE 2
It can be understood that the selecting module 240 may select an NFC transmission mode and a bluetooth transmission mode according to the size of the data, may also select an NFC transmission mode and a WIFI direct connection transmission mode, and may also select a bluetooth transmission mode and a WIFI direct connection transmission mode.
Further, the transmission control module 250 transmits the target transmission file in a wireless transmission mode matching the size of the target transmission file, including: when the selection module 240 selects NFC transmission and the transmission control module 250 starts the NFC transmission module 111 to transmit the target transmission file; when the selection module 240 selects a transmission mode of bluetooth transmission and/or WIFI direct connection, the transmission control module 250 starts the bluetooth transmission module 112 and/or the WIFI direct connection transmission module 113 to transmit the target transmission file.
Optionally, when the selection module 240 selects NFC transmission, the transmission control module 250 may transmit the target transmission file through the NFC transmission module 111 that is turned on in advance, and when the selection module 240 selects a transmission mode of bluetooth transmission and/or WIFI direct connection, the transmission control module 250 may transmit the target transmission file through the bluetooth transmission module 112 and/or WIFI direct connection transmission module 113 that is turned on in advance. Further or optionally, after the transmission control module 250 transmits the target transmission file in the NFC transmission mode, the determining module 230 determines whether the distance between the terminal 200 and the receiving party 300 exceeds the transmission distance of the NFC connection, if the distance exceeds the transmission distance, the transmission control module 250 interrupts the NFC connection and continues to transmit the target transmission file to the receiving party 300 in the bluetooth or WIFI direct connection transmission mode, otherwise, the transmission control module 250 transmits the target transmission file to the receiving party 300 through the NFC.
It can be understood that, if the determining module 230 determines that the distance between the terminal 100 and the receiving party 300 exceeds the transmission distance of the NFC, a prompt box may be displayed to prompt the user that the distance between the terminal 200 and the receiving party 300 exceeds the transmission distance of the NFC connection, the terminal 200 is close to the receiving party 300 to continue to transmit the target transmission file, or the user is prompted to select bluetooth or WIFI direct connection to continue to transmit the target transmission file, and the transmission control module 250 continues to transmit the target transmission file according to the transmission mode selected by the user.
Optionally, the determining module 230 may not display a prompt box, and automatically select bluetooth or WIFI direct connection to continue transmitting the target transmission file.
Further or alternatively, when the determining module 230 determines that the current transmission mode is a bluetooth and/or WIFI direct transmission mode, and determines that the battery power of the terminal 200 is lower than the threshold value, when the determining module 230 determines that the terminal 200 and the receiving party 300 are within the NFC transmission distance, the transmission control module 250 may interrupt the bluetooth and/or WIFI direct transmission mode, and continue to transmit the target transmission file to the receiving party 300 through the NFC transmission mode.
Further or alternatively, when the determining module 230 determines that the current transmission mode is a bluetooth and/or WIFI direct transmission mode, and determines that the battery power of the terminal 200 is lower than the threshold value, when the distance between the terminal 200 and the receiving party 300 exceeds the NFC transmission distance, the transmission control module 250 may interrupt the bluetooth and/or WIFI direct transmission mode, and continue to transmit the target transmission file to the receiving party 300 through the NFC transmission mode.
Further or alternatively, when the determining module 230 determines that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection, and determines that the battery power of the terminal 200 is lower than the threshold value, the transmission control module 250 may also continue to transmit the target transmission file using the transmission mode of WIFI direct connection or/and bluetooth.
Further or alternatively, when the determining module 230 determines that the current transmission mode is a bluetooth and/or WIFI direct transmission mode and determines that the battery power of the terminal 200 is lower than the threshold, the transmission control module 250 may also interrupt the bluetooth and/or WIFI direct transmission mode, thereby interrupting transmission of the target transmission file.
In the embodiment of the present invention, the terminal 200 selects the transmission mode corresponding to the size of the target transmission file according to the size of the target transmission file, so that the terminal 200 can save energy consumption and improve transmission efficiency when transmitting the target transmission file.
Fig. 4 is a flowchart of a method for controlling data transmission according to an embodiment of the present invention.
The method for controlling data transmission of the embodiment of the invention comprises the following steps:
step 10: and the terminal receives an operation instruction of selecting a target transmission file by a user.
Specifically, before the terminal receives an operation instruction of selecting a target transmission file by a user, at least two wireless transmission modes with a receiving party are established, including,
the terminal establishes NFC (Near Field Communication) and Bluetooth wireless transmission with the receiving party; or establishing NFC short-distance wireless transmission and WIFI direct-connection wireless transmission of the receiver; or establishing NFC short-distance wireless transmission and Bluetooth and WIFI direct connection wireless transmission with the receiver. Optionally, the terminal may further start the wireless transmission module corresponding to the selected wireless transmission mode according to the selected wireless transmission mode.
Step 20: and the terminal determines the target transmission file according to the operation instruction.
Specifically, the terminal generates an instruction signal according to a selection operation of the user operation input unit 130, and determines a target transmission file according to the instruction signal, wherein the target transmission file may be a picture file, a text file, a video file, or an audio file.
Step 30: and the terminal judges the size of the target transmission file according to the target file attribute.
Specifically, the terminal judges that the size of the target transmission file does not reach a preset range; or judging that the size of the target transmission file is in the preset range; or judging that the size of the target transmission file exceeds the preset range.
For example, the predetermined range of the size of the target transmission file is predefined as (1M, 2M), and the predetermined ranges related to the following embodiments are all referred to as the predetermined range (1M, 2M), the processor 120 determines that the size of the target transmission file does not reach the predetermined range when determining that the size of the target transmission file is 0.5M, and determines that the size of the target transmission file reaches the predetermined range when determining that the size of the target file is 1.5M or 5M.
Step 40: the terminal selects a transmission mode matched with the size of the target transmission file, wherein the terminal supports at least two wireless transmission modes.
Specifically, the terminal selects an NFC transmission mode according to the fact that the size of the target transmission file does not reach a preset range; or selecting a Bluetooth and/or WIFI direct connection transmission mode according to the preset range of the size of the target transmission file.
Optionally, the terminal may divide the target transmission file into at least two data groups according to that the size of the target transmission file reaches a predetermined range, and select a transmission mode matching the size of each data group.
Specifically, the terminal selects NFC transmission for the data group which does not reach the preset range; and selecting the Bluetooth transmission mode and/or the WIFI direct connection mode for the data group reaching the preset range.
For example, if the terminal determines that the size of the target transmission file reaches the predetermined range, the terminal may divide the target transmission file into two data groups or three data groups, and select a transmission mode corresponding to the size of each data group, where the sizes of the data groups may be different. In this embodiment, the terminal divides the target transmission file into three data groups for explanation.
The terminal selects one of the data groups which do not reach the preset range and corresponds to the NFC transmission mode; and selecting the Bluetooth transmission mode and/or the WIFI direct connection transmission mode corresponding to the rest data groups.
The three data groups in this embodiment correspond to an NFC transmission mode, a bluetooth transmission mode, and a WIFI direct transmission mode, respectively, according to the size of the data group.
As shown in table 1, if the terminal determines that the size of the target transmission file is 6M and the predetermined range is (1M, 2M ], the terminal may divide the data of the target transmission file into three data sets with different sizes, where the size of the data set 1 is 1M, the size of the data set 2 is 2M, and the size of the data set 3 is 3M, select the data set 1 that does not reach the predetermined range to correspond to the NFC transmission mode, select the data set 2 that is within the predetermined range to correspond to the bluetooth transmission mode, and select the data set 3 to correspond to the WIFI direct connection transmission mode.
Further or optionally, after the terminal selects the transmission mode matched with the size of each data group, each data group may be further divided into a plurality of data slices, where the transmission mode corresponding to each data slice is consistent with the transmission mode corresponding to the data group to which the data slice belongs, see table 1, and the number of data slices divided by each data group by the terminal is not equal.
Data set
|
Size of data group
|
Number of data pieces
|
Transmission mode
|
Data set 1
|
1M
|
5
|
NFC
|
Data set 2
|
2M
|
4
|
Bluetooth
|
Data set 2
|
3M
|
3
|
WIFI direct connection
|
TABLE 1
Optionally, the terminal may further divide the target transmission file into a plurality of data groups of equal size, and correspond the plurality of data groups to the three transmission modes, where the size of each data group is not within the predetermined range (1M, 2M).
For example, as shown in table 2, the size of the target transfer file is 3M, the target transfer file may be divided into 3 data groups with a size of 1M, and each data group corresponds to an NFC transmission mode, a bluetooth transmission mode, and a WIFI direct transmission mode.
Data set
|
Size of data group
|
Number of
|
Transmission mode
|
Data set 1
|
1M
|
5
|
NFC
|
Data set 2
|
1M
|
5
|
Bluetooth
|
Data set 2
|
1M
|
5
|
WIFI direct connection
|
TABLE 2
It can be understood that the terminal can select an NFC transmission mode and a bluetooth transmission mode according to the size of the data, can also select an NFC transmission mode and a WIFI direct connection transmission mode, and can also select a bluetooth transmission mode and a WIFI direct connection transmission mode.
Step 50: and the terminal transmits the target transmission file in a transmission mode matched with the size of the target transmission file.
Specifically, when the terminal selects NFC transmission, the NFC transmission module is started to transmit the target transmission file; and when a transmission mode of Bluetooth transmission and/or WIFI direct connection is selected, starting a Bluetooth transmission module and/or a WIFI direct connection transmission module, and transmitting the target transmission file.
Optionally, when the terminal selects NFC transmission, the target transmission file may be transmitted through a pre-opened NFC transmission module; when a Bluetooth transmission mode and/or a WIFI direct connection transmission mode is selected, the target transmission file can be transmitted through a Bluetooth transmission module and/or a WIFI direct connection transmission module which are started in advance.
Further or optionally, after the terminal transmits the target transmission file in an NFC wireless transmission mode, it is determined whether the distance between the terminal and the receiving party 300 exceeds the transmission distance of the NFC connection, if the distance exceeds the transmission distance, the NFC connection is interrupted, and the target transmission file is continuously transmitted to the receiving party 300 by selecting a transmission mode of bluetooth or WIFI direct connection, otherwise, the target transmission file is transmitted to the receiving party 300 by the NFC.
It can be understood that, if the terminal determines that the distance between the terminal and the receiving party 300 exceeds the transmission distance of the NFC, a prompt box may be displayed to prompt the user that the distance between the terminal 100 and the receiving party 300 exceeds the transmission distance of the NFC connection, the terminal is close to the receiving party 300 to continue to transmit the target transmission file, or the user is prompted to select bluetooth or WIFI direct connection to continue to transmit the target transmission file, and the terminal continues to transmit the target transmission file according to the transmission mode selected by the user.
Optionally, the terminal may not display the prompt box, and automatically select a transmission mode of bluetooth or WIFI direct connection to continue transmitting the target transmission file.
Further or optionally, when the terminal determines that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection, and determines that the battery power of the terminal is lower than a threshold value, when the terminal is within the NFC transmission distance from the receiver 300, the transmission mode of bluetooth and/or WIFI direct connection may be interrupted, and the target transmission file continues to be transmitted through the NFC transmission mode.
Further or optionally, when the terminal determines that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection, and determines that the battery power of the terminal is lower than a threshold value, when the distance between the terminal and the receiving party exceeds the transmission distance of the NFC, the transmission mode of bluetooth and/or WIFI direct connection may be interrupted, and the target transmission file is continuously transmitted to the receiving party 300 through the NFC transmission mode.
Further or optionally, when the terminal determines that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection and determines that the battery power of the terminal is lower than a threshold value, the terminal may also continue to transmit the target transmission file using the transmission mode of WIFI direct connection and/or bluetooth.
Further or optionally, when the terminal judges that the current transmission mode is a transmission mode of bluetooth and/or WIFI direct connection and judges that the battery power of the terminal is lower than a threshold value, the terminal can also interrupt the transmission mode of bluetooth and/or WIFI direct connection, so that transmission of a target transmission file is interrupted.
In the embodiment of the invention, the terminal selects the transmission mode corresponding to the size of the target transmission file according to the size of the target transmission file, so that the terminal can save energy consumption and improve transmission efficiency when transmitting the target transmission file.
It should be noted that the method steps and modules described in connection with the embodiments disclosed herein can be embodied in electronic hardware or in a combination of both computer software and hardware, where the steps and components of the embodiments have been described in general terms of their functionality. Whether such functionality is implemented as hardware or software and hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The methods or steps described in connection with the embodiments disclosed herein may be embodied in hardware, a software program executed by a processor, or a combination of both. The software routines may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or alterations to the embodiments of the present invention may be made by those skilled in the art without departing from the spirit and scope of the present invention, and such modifications or alterations are intended to be within the scope of the present invention.