Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
Based on the above problems, embodiments of the present application provide a data transmission method, a device, a storage medium, and a terminal, which can improve data transmission efficiency of the terminal. The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
Referring to fig. 1, fig. 1 is a flow chart of a data transmission method according to an embodiment of the application. The data transmission method can be applied to mobile terminals such as mobile phones, tablet computers, notebook computers, palm computers, portable media players (Portable MEDIA PLAYER, PMP) and fixed terminals such as desktop computers. The specific flow of the data transmission method can be as follows:
101. When a data transmission instruction is received, a plurality of candidate communication modes corresponding to the data transmission instruction are determined.
In the embodiment of the application, the terminal can be in communication connection with other terminals, and after the terminal is in communication connection with other terminals, the terminal can perform data transmission with other terminals. The terminal and other terminals communicate with each other, and can realize communication functions through different communication modes, one communication function can be realized through different communication modes, and one communication mode can complete a plurality of communication functions.
For example, the Communication modes that the terminal can support may include a Communication mode such as bluetooth Communication and NFC (NEAR FIELD Communication technology) Communication, and the terminal may share a file with other terminals through the bluetooth Communication mode, and may complete a payment function through connection with other terminals through the NFC Communication mode.
The data transmission instruction refers to an instruction for starting the terminal to perform data transmission with other terminals, the data transmission instruction can be triggered in various modes, for example, the data transmission instruction can be triggered through user operation, and the user triggers the data transmission instruction through starting an application program so that the terminal can complete data transmission with other terminals through the application program; or the data transmission instruction can be triggered when the terminal detects the communication signals sent by other terminals, and after the terminal detects the communication signals sent by other terminals, the data transmission instruction can be triggered to be in communication connection with other terminals so as to execute the data transmission function.
The candidate communication mode refers to a communication mode which can be selected for use by the terminal when executing the current data transmission instruction. The communication modes that the terminal can support may include a variety of, for example, the terminal can support: a first communication mode, a second communication mode, a third communication mode, and so on.
The data transmission instruction may correspond to a communication function, and the communication function may include a plurality of types, for example, the communication function may include a first communication function, a second communication function, and the like, and the communication function corresponding to the current data transmission instruction may be the first communication function.
After the communication function is determined according to the data transmission instruction, a candidate communication mode of the current data transmission instruction can be obtained according to the communication mode corresponding to the communication function.
For example, the communication function to be executed by the data transmission instruction may be a first communication function, and the terminal may complete the first communication function in the first communication mode or the second communication mode, and then the determining the candidate communication mode may include: a first communication mode and a second communication mode.
In some embodiments, in order to quickly determine the candidate communication modes corresponding to the data transmission instruction, before the step of determining the plurality of candidate communication modes corresponding to the data transmission instruction, the following flow may be further included:
and establishing association relations between different communication functions and different communication modes.
Then the step of determining a target communication mode based on the data transfer instruction may comprise the following operations:
Determining a target communication function corresponding to the data transmission instruction;
And acquiring a communication mode associated with the target communication function to obtain the target communication mode.
The communication function refers to a function that the terminal completes related operations through communication connection with other terminals. And establishing an association relation between the traffic mode and the communication function which can be realized by the communication mode, and then after receiving the data transmission instruction, quickly determining the communication mode according to the communication function which needs to be completed by the data transmission instruction.
102. And determining the current communication mode of the terminal and acquiring mode switching information of the current communication mode.
The current communication mode refers to a communication mode used by a communication function being executed when the current terminal is running.
For example, when the terminal detects that the current user operates the application program a and the second communication function is executed in the third communication mode through the application program a, it is determined that the current communication mode may be the third communication mode.
Wherein the mode switching information includes: the current communication mode is switched to the switching frequency of the other communication modes in the history period, that is, the switching number of times the current communication mode is switched to each of the other communication modes.
The historical time period may refer to a time period before receiving the current data transmission instruction, and in order to ensure the effectiveness of mode switching performed by the user in the terminal use process, the duration of the historical time period may be set to be a preset period. For example, the preset period may be 7 days, which is not limited herein, and may be set according to the actual situation of use of the terminal.
For example, the terminal acquiring the mode switching information of the current communication mode in the history period may include: in the past 7 days, the number of times the current communication mode is switched to the first communication mode is 5 times, and the number of times the current communication mode is switched to the second communication mode is 10 times.
In order to save the memory space of the terminal, in some embodiments, before the step of "obtaining the mode switching information of the current communication mode", the following operations may be further included:
acquiring switching frequency between a current communication mode and other communication modes in a preset history period;
Determining other communication modes with the switching frequency greater than a preset threshold value with the current communication mode to obtain a plurality of sample communication modes;
and establishing an association relation between the current communication mode and each sample communication mode to obtain mode switching information of the current communication mode.
The preset history period may refer to a history period, that is, a past period from the current time, for example, the preset history period may be 7 days past from the current time, and so on.
The switching frequency refers to the switching times of the current communication mode and other communication modes in a preset history period.
For example, the preset history period may be 7 days. In the preset history period, the number of times of switching the communication mode of the terminal from the current communication mode to the communication mode A is 1 time, the number of times of switching the current communication mode to the communication mode B is 5 times, the number of times of switching the current communication mode to the communication mode C is 2 times, the number of times of switching the current communication mode to the communication mode D is 7 times, the number of times of switching the current communication mode to the communication mode E is3 times, and the number of times of switching the current communication mode to the communication mode F is 10 times. The switching frequency between the current communication mode and the other communication modes in the preset history period can be obtained as follows: current communication mode→mode a:1 time, current communication mode→mode B:5 times, current communication mode→mode C:2 times, current communication mode→mode D:7 times, current communication mode→mode E:3 times, current communication mode→mode F:10 times.
After acquiring the switching frequency of the current communication mode with other communication modes in a preset history period, the switching frequency may be compared with a preset threshold. The preset threshold value can be set according to the use condition of the terminal. For example, the preset threshold may be 5, that is, the number of times of switching from the current communication mode to the other communication mode in the preset history period is greater than or less than 5, which may indicate that the switching frequency of switching from the current communication mode to the other communication mode is higher, and may store the switching information of the current communication mode and the other communication mode.
The sample communication mode refers to other communication modes with switching frequencies from the current mode to the other modes being larger than a preset threshold value in a preset history period.
For example, the switching frequency between the current communication mode and the other communication modes in the preset history period is: current communication mode→mode a:1 time, current communication mode→mode B:5 times, current communication mode→mode C:2 times, current communication mode→mode D:7 times, current communication mode→mode E:3 times, current communication mode→mode F:10 times; the preset threshold may be 5, and other modes that may obtain the switching frequency greater than or equal to the preset threshold include: mode B, mode D, and mode F, a sample communication mode may be obtained as: mode B, mode D, and mode F.
The association relationship refers to a switching relationship between a current communication mode and a sample communication mode, and a communication mode needing to be switched can be rapidly determined based on the association relationship.
After determining the sample communication mode, the current communication mode and each sample communication mode can be associated to obtain the association relation between the current communication mode and each sample communication mode, and all the association relations are stored to obtain the mode switching information of the current communication mode. By the method, the association relation between other communication modes meeting the preset condition in the historical time period and the current communication mode is established and stored, other communication modes with lower switching frequency with the current communication mode can be screened out, and the storage space of the terminal is saved.
103. A target communication mode is determined from among the plurality of candidate communication modes based on the mode switching information.
In an embodiment, in order to increase the switching frequency of the communication mode, the step of "determining the target communication mode from the plurality of candidate communication modes according to the mode switching information" may include the following operations:
Determining a target sample communication mode with highest switching frequency between the target sample communication mode and a current communication mode from a plurality of sample communication modes;
A target communication mode is determined from a plurality of candidate communication modes based on the target sample communication mode.
The mode switching information comprises switching frequencies of a current communication mode and each sample communication mode in a preset historical period.
Specifically, the maximum switching frequency is searched from the mode switching information, and then the sample communication mode corresponding to the maximum switching frequency is determined, so that the target communication mode can be obtained.
For example, the mode switching information may include a switching frequency: 5 times, 7 times, 10 times, wherein the switching frequency is 5 times corresponding to: the current communication mode- & gt mode B, the switching frequency is 7 times and corresponds to: the current communication mode- & gt mode D, the switching frequency is 10 times and corresponds to: the current communication mode- > the mode F, the maximum switching frequency can be obtained by comparing the switching frequencies, and the target sample communication mode can be determined to be the mode F based on the mode switching association relationship corresponding to the maximum switching frequency.
The target communication mode refers to a communication mode which needs to be set by a current terminal designated data transmission instruction.
In some embodiments, in order to quickly determine the target communication mode, the step of "determining the target communication mode from the plurality of candidate communication modes based on the target communication mode" may include the following flow:
matching the target sample communication pattern with each candidate communication pattern;
if a candidate communication mode successfully matched with the target sample communication mode exists in the plurality of candidate communication modes, determining the candidate mode successfully matched as the target communication mode;
And if the candidate communication mode successfully matched with the target sample communication mode does not exist in the plurality of candidate communication modes, determining the sample communication mode successfully matched with the plurality of candidate modes from the plurality of sample communication modes, and determining the sample communication mode with the highest switching frequency as the target communication mode.
Specifically, each candidate communication mode may be compared with the target sample communication mode, whether the candidate communication mode is the same as the target sample communication mode is determined, and the target communication mode is determined according to the determination result.
For example, the candidate communication modes may include: the target sample communication mode may be a mode F, and comparing the candidate communication mode with the target sample communication mode, and determining that the candidate communication mode identical to the target sample communication mode exists in the candidate communication modes as the mode F, and determining that the mode F is the target communication mode.
As another example, the candidate communication modes may include: the target sample communication mode may be a mode F, and comparing the candidate communication mode with the target sample communication mode may determine that the candidate communication mode does not have the same candidate communication mode as the target sample communication mode.
When the candidate communication mode is not the same as the target sample communication mode, in order to quickly determine the target communication mode, the search range may be increased, the candidate communication mode is compared with other sample communication modes in the switching mode information of the current communication mode, and if one sample communication mode is the same as the candidate communication mode in the other sample communication modes, the sample communication mode is determined to be the target communication mode.
For example, the candidate communication modes may include: mode a, mode B, mode C; the sample communication mode may include: mode B, mode D, mode F, it may be determined that one of the sample communication modes exists that is the same as the candidate communication mode, i.e., mode B, and then mode B may be determined as the target communication mode.
In an embodiment, if there are multiple sample communication modes in the other sample communication modes that are the same as the candidate communication mode, determining a sample communication mode with the highest switching frequency with the current communication mode from the multiple sample communication modes, and obtaining the target communication mode.
For example, the candidate communication modes may include: mode a, mode B, mode C; the sample communication mode may include: mode B, mode C, mode F, it may be determined that there are two of the sample communication modes that are the same as the candidate communication modes, namely mode B and mode C. Then, the switching frequencies of the current communication mode and the modes B and C are searched from the mode switching information of the current communication mode, and the switching frequencies can be: the switching frequency of the current communication mode and the mode B is 6 times, and the switching frequency of the current communication mode and the mode B is 8 times, so that the mode B with higher switching frequency than the current mode can be determined as the target communication mode.
104. And switching the current communication mode into a target communication mode, and transmitting data based on the target communication mode.
In some embodiments, to save the switching time of the communication mode, the step of "switching the current communication mode to the target communication mode" may include the following operations:
determining mode adjustment information based on the current communication mode and the target communication mode;
And adjusting the current communication mode of the terminal according to the mode adjustment information.
The mode adjustment information refers to content set when the terminal switches the current communication mode to the target communication mode, and may include a mode adjustment parameter value. The mode adjustment parameter value refers to a value corresponding to an association relationship between the current communication mode and the target communication mode, for example, the mode adjustment parameter may be 1 or the like.
In some embodiments, in order to quickly acquire the mode adjustment information between the current communication mode and the destination communication mode, the step of "determining the mode adjustment information based on the current communication mode and the destination communication mode" may include the operations of:
acquiring the corresponding relation between the current communication mode and the target communication mode from a preset relation table;
And determining the sample adjusting parameters corresponding to the corresponding relation from the plurality of sample adjusting parameters to obtain the mode adjusting information.
The preset relation table includes correspondence relations among a plurality of sample communication modes, and can be preset.
In some embodiments, in order to quickly determine the correspondence between the current communication mode and the target communication mode, before the step of "obtaining the correspondence between the current communication mode and the target communication mode", the following procedure may be further included:
acquiring a plurality of communication modes supported by a terminal;
And establishing a corresponding relation between every two communication modes in the plurality of communication modes to obtain a relation table among the plurality of communication modes.
Wherein, the plurality of communication modes supported by the terminal means a plurality of communication modes in which the terminal can complete a communication function using the communication modes. Then, a correspondence relationship can be established between the plurality of communication modes supported by the terminal.
For example, the communication modes that the terminal may support for use may include: the mode A, the mode B, the mode C and the mode D establish the corresponding relation between every two communication modes according to all communication modes supported to be used by the terminal, and the preset relation table can be determined to comprise: mode A→mode B→mode C, mode A→mode D, mode B→mode A, mode B→mode C, mode B→mode D, mode C→mode A, mode C→mode B, mode C→mode D, mode D→mode A, mode D→mode B, mode D→mode C.
After the preset relation table is determined, adjusting parameters corresponding to each corresponding relation in the preset relation table can be set, and a plurality of sample adjusting parameters can be obtained. In order to avoid an error in mode switching, different adjustment parameters may be set for different corresponding relationships, for example, a first parameter may be set for a first corresponding relationship, and a second parameter may be set for a second corresponding relationship. The adjustment parameters may be various values, for example, the adjustment parameters may be 1,2, 3, and so on.
Then, after determining the current communication mode and the template communication mode, the corresponding relation between the current communication mode and the target communication mode may be first obtained from the preset relation table, and then the sample adjustment parameter corresponding to the corresponding relation may be determined from the plurality of sample adjustment parameters, so that the mode adjustment information may be obtained.
In some embodiments, in order to increase the mode switching speed, the step of "adjusting the current communication mode of the terminal according to the mode adjustment information" may include the following operations:
acquiring a mode parameter value corresponding to a current communication mode;
Adjusting the mode parameter value according to the mode parameter adjusting value to obtain an adjusted mode parameter value;
and switching the current communication mode to a target communication mode based on the adjusted mode parameter value.
The mode parameter refers to a parameter of the terminal for setting a communication mode, and the communication mode of the terminal can be switched to a different communication mode by setting the mode parameter to a different value.
After the mode adjustment information corresponding to the current communication mode is acquired, the mode adjustment parameters can be adjusted according to the mode adjustment parameter values in the mode adjustment information. I.e. the current communication mode can be switched to the target communication mode.
For example, the mode parameter adjustment value may be 2, the current mode parameter value may be 3, and the mode parameter value may be adjusted to 2 according to the mode parameter adjustment value by adjusting the mode parameter value based on the current mode parameter value, i.e., the current communication mode may be switched to the target communication mode.
After the current communication mode is switched to the target communication mode, the terminal can complete the data transmission task corresponding to the data transmission instruction according to the target communication mode.
In some embodiments, in order to ensure the data transmission speed, in step "after data transmission based on the target communication mode", the following operations may be further included:
acquiring a data transmission rate when data transmission is performed in a target communication mode;
If the data transmission rate is smaller than the preset data transmission rate, acquiring a communication function corresponding to the data transmission instruction;
Acquiring a plurality of communication modes associated with a communication function;
from among the plurality of communication modes, other communication modes are selected for data transmission.
The data transmission rate refers to the speed of data transmission between the terminal and other terminals in the target communication mode.
The preset data transmission rate refers to a minimum data transmission rate capable of ensuring smooth data transmission between terminals.
When the data transmission rate of the terminal in the target communication mode is smaller than the preset transmission rate, the data transmission rate between the terminals is affected, and at this time, other communication modes with higher data transmission rates can be selected from a plurality of associated communication modes of the corresponding communication functions of the currently executed data transmission instruction, so that the data transmission rate can be improved.
The embodiment of the application discloses a data transmission method, which comprises the following steps: when a data transmission instruction is received, a plurality of candidate communication modes corresponding to the data transmission instruction are determined, the current communication mode of the terminal is determined, mode switching information of the current communication mode is acquired, a target communication mode is determined from the plurality of candidate communication modes according to the mode switching information, the current communication mode is switched to the target communication mode, and data transmission is performed based on the target communication mode. After receiving a data transmission instruction, the embodiment of the application determines a plurality of candidate communication modes according to the communication function corresponding to the data transmission instruction, then acquires the communication mode with highest switching frequency with the current communication mode in a historical time period, and rapidly determines a target communication mode from the plurality of candidate communication modes based on the communication mode with highest switching frequency, so that the terminal can rapidly switch the current communication mode into the target communication mode after receiving the data transmission instruction, and the data transmission efficiency of the terminal can be improved.
Referring to fig. 2, fig. 2 is a flow chart of another data transmission method according to an embodiment of the present application. Taking the example that the data transmission method is applied to the terminal, the data transmission method can comprise the following steps:
201. and the terminal receives the communication connection request sent by the electronic equipment and determines a target communication mode according to the communication connection request.
In the embodiment of the application, the electronic device refers to various devices capable of being in communication connection with the terminal, for example, the electronic device may be a bluetooth headset, a card reading device, a computer and the like, wherein the terminal may be in communication with the bluetooth headset through bluetooth connection, the terminal may be in communication with the card reading device through NFC connection, the terminal may be in communication with the computer through bluetooth or WiFi connection and the like.
The communication connection request may be sent by the electronic device to the terminal, where the communication connection request may trigger the terminal to start a communication function. The communication connection request may carry device information of the electronic device, and the terminal may identify the electronic device that sent the communication request through the device information.
The target communication mode refers to a communication mode in which the terminal performs communication connection with the electronic device after receiving a communication connection request sent by the electronic device.
After receiving the communication connection request sent by the electronic device, the terminal may acquire device information of the electronic device in the communication connection request, and may select a target communication mode from communication modes supportable by the terminal according to the device information.
For example, the electronic device may be an NFC device, and the current terminal receives a communication connection request sent by the NFC device, obtains information of the NFC device, and may determine that the target communication mode is the NFC communication mode.
202. The terminal acquires the current communication mode and acquires the association relation between the current communication mode and the target communication mode from a preset relation table.
The current communication mode refers to a communication mode of the terminal communication module which is started currently, and the terminal communication module is mainly used for controlling starting of the terminal communication mode and switching between different communication modes.
For example, when the terminal receives a communication connection request sent by the electronic device, the terminal may be connected to the bluetooth headset, and then it may be determined that the current communication mode is a bluetooth communication mode.
The preset relation table comprises all communication modes in the terminal, and the association relation between every two communication modes, namely the mutual switching relation between every two communication modes.
For example, the communication modes included in the terminal may be: the association relationship between the bluetooth communication mode and the NFC communication mode may include: the bluetooth communication mode is switched to the NFC communication mode, and the NFC communication mode is switched to the bluetooth communication mode.
The terminal can correlate every two communication modes in advance to obtain an incidence relation between every two communication modes, and then a parameter value can be set for each incidence relation, so that when the terminal needs to switch the communication modes, the current communication mode can be quickly switched to a target communication mode. In order to ensure the accuracy of the terminal when the communication modes are switched, different association relations can correspond to different communication modes.
203. And the terminal determines a sample adjusting parameter value corresponding to the association relation from the plurality of sample adjusting parameter values to obtain a target adjusting parameter value.
The plurality of sample adjustment parameters comprise adjustment parameters corresponding to the association relation of each pair of communication modes.
After the association relation corresponding to the current communication mode switched to the target communication mode is obtained from the preset relation table, the parameter corresponding to the association relation can be determined from a plurality of sample adjustment parameter values to be adjusted, so that the target adjustment parameter can be obtained.
For example, the current communication mode may be a bluetooth communication mode, the target communication mode may be an NFC communication mode, and from a preset relationship table, acquiring an association relationship between the current communication mode and the target communication mode may be that the bluetooth communication mode is switched to the NFC communication mode, further acquiring a sample adjustment parameter value corresponding to the association relationship may be 3, and then determining that the target adjustment parameter is 3.
204. And the terminal adjusts the current mode parameter based on the target adjustment parameter value, and switches the current communication mode to the target communication mode.
The mode parameter is used for setting a communication mode of the terminal, and different communication modes of the terminal can be started according to the parameter value which is not set.
After determining the target adjustment parameter value, the terminal may adjust the value of the current mode parameter, that is, may set the value of the mode parameter as the target adjustment parameter value, and may quickly switch the current communication mode to the target communication mode by adjusting the value of the mode parameter as the target adjustment parameter value.
205. And the terminal is in communication connection with the electronic equipment according to the target communication mode and executes corresponding communication functions.
After the terminal finishes the communication mode switching, the target communication mode can be started, the communication connection request sent by the electronic equipment is responded, and the terminal is in communication connection with the electronic equipment according to the equipment information carried in the communication connection request. Further, a communication function corresponding to the target communication mode is executed.
The embodiment of the application discloses a data transmission method, which comprises the following steps: the terminal receives communication connection instructions sent by other terminals, determines a target communication mode according to the communication connection instructions, acquires a current communication mode, acquires an association relation between the current communication mode and the target communication mode from a preset relation table, determines a sample adjustment parameter value corresponding to the association relation from a plurality of sample adjustment parameter values, obtains a target adjustment parameter value, adjusts the current mode parameter based on the target adjustment parameter value, switches the current communication mode to the target communication mode, performs communication connection between the terminal and the other terminals according to the target communication mode, and executes corresponding communication functions. So as to improve the switching efficiency of the communication modes of the terminal.
In order to facilitate better implementation of the data transmission method provided by the embodiment of the application, the embodiment of the application also provides a device based on the data transmission method. Wherein the meaning of the terms is the same as in the above data transmission method, specific implementation details can be referred to in the description of the method embodiment.
Referring to fig. 3, fig. 3 is a block diagram of a data transmission device according to an embodiment of the present application, where the data transmission device can be applied to mobile terminals such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Portable media player (Portable MEDIA PLAYER, PMP), and fixed terminals such as a desktop computer, and the device includes:
A receiving unit 301, configured to determine, when a data transmission instruction is received, a plurality of candidate communication modes corresponding to the data transmission instruction;
An obtaining unit 302, configured to determine a current communication mode of the terminal, and obtain mode switching information of the current communication mode;
A determining unit 303 for determining a target communication mode from a plurality of candidate communication modes according to the mode switching information;
and a switching unit 304, configured to switch the current communication mode to the target communication mode, and perform data transmission based on the target communication mode.
In some embodiments, the determining unit 303 may include:
A first determination subunit configured to determine, from among a plurality of sample communication modes, a target sample communication mode having a highest switching frequency with the current communication mode;
a second determination subunit configured to determine the target communication mode from a plurality of candidate communication modes based on the target sample communication mode.
In some embodiments, the second determining subunit may be specifically configured to:
matching the target sample communication pattern with each candidate communication pattern;
if a candidate communication mode successfully matched with the target sample communication mode exists in the plurality of candidate communication modes, determining the candidate mode successfully matched as the target communication mode;
And if the candidate communication mode successfully matched with the target sample communication mode does not exist in the plurality of candidate communication modes, determining the sample communication mode successfully matched with the plurality of candidate modes from the plurality of sample communication modes, and determining the sample communication mode with the highest switching frequency as the target communication mode.
In some embodiments, the switching unit 304 may include:
a third determining subunit configured to determine mode adjustment information based on the current communication mode and the target communication mode;
and the adjusting subunit is used for adjusting the current communication mode of the terminal according to the mode adjusting information.
In some embodiments, the conditioning subunit may be specifically configured to:
Acquiring a mode parameter value corresponding to the current communication mode;
adjusting the mode parameter value according to the mode parameter adjusting value to obtain an adjusted mode parameter value;
Switching the current communication mode to the target communication mode based on the adjusted mode parameter value.
In some embodiments, the conditioning subunit may also be specifically configured to:
Acquiring a mode parameter value corresponding to the current communication mode;
adjusting the mode parameter value according to the mode parameter adjusting value to obtain an adjusted mode parameter value;
Obtaining the corresponding relation between the current communication mode and the target communication mode from a preset relation table, wherein the preset relation table comprises the corresponding relation among a plurality of sample communication modes; and determining the sample adjusting parameters corresponding to the corresponding relation from a plurality of sample adjusting parameters to obtain the mode adjusting information.
In some embodiments, the data transmission apparatus may further include:
the acquisition unit is used for acquiring the switching frequency between the current communication mode and other communication modes in a preset history period;
the execution unit is used for determining other communication modes with the switching frequency of the current communication mode being larger than a preset threshold value to obtain a plurality of sample communication modes;
the establishing unit is used for establishing the association relation between the current communication mode and each sample communication mode to obtain the mode switching information of the current communication mode.
The embodiment of the application discloses a data transmission device, which comprises: when receiving the data transmission instruction, the receiving unit 301 determines a plurality of candidate communication modes corresponding to the data transmission instruction, the acquiring unit 302 determines a current communication mode of the terminal and acquires mode switching information of the current communication mode, the determining unit 303 determines a target communication mode from the plurality of candidate communication modes according to the mode switching information, and the switching unit 304 switches the current communication mode to the target communication mode and performs data transmission based on the target communication mode. According to the embodiment of the application, the switching frequency between every two communication modes is obtained according to the mode switching information of the terminal in the historical time period, after a data transmission instruction is received, the target communication mode is rapidly determined from the candidate communication modes corresponding to the data transmission instruction according to the switching frequency between every two communication modes, and then the data transmission is performed based on the target communication mode, so that the data transmission efficiency of the terminal can be rapidly improved.
The embodiment of the application also provides a terminal. As shown in fig. 4, the terminal may include Radio Frequency (RF) circuitry 601, memory 602 including one or more storage media, input unit 603, display unit 604, sensor 605, audio circuit 606, wireless fidelity (WiFi, wireless Fidelity) module 607, processor 608 including one or more processing cores, and power supply 609. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 4 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
The RF circuit 601 may be used for receiving and transmitting signals during the process of receiving and transmitting information, in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 608; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 601 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 601 may also communicate with networks and other devices through wireless communications.
The memory 602 may be used to store software programs and modules that are stored in the memory 602 for execution by the processor 608 to perform various functional applications and data transfers. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 602 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. Accordingly, the memory 602 may also include a memory controller to provide access to the memory 602 by the processor 608 and the input unit 603.
The input unit 603 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, the input unit 603 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. The input unit 603 may comprise other input devices in addition to a touch sensitive surface. In particular, other input devices 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, mouse, joystick, etc.
The display unit 604 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the server, which may be composed of graphics, text, icons, video and any combination thereof. The display unit 604 may include a display panel, which may optionally be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is passed to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 4 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The terminal may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and the backlight when the server moves to the ear.
Audio circuitry 606, speakers, and a microphone may provide an audio interface between the user and the server. The audio circuit 606 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted to a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 606 and converted into audio data, which are processed by the audio data output processor 608 for transmission to, for example, a terminal via the RF circuit 601, or which are output to the memory 602 for further processing. The audio circuit 606 may also include an ear bud jack to provide communication between the peripheral ear bud and the server.
The WiFi belongs to a short-distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web pages, access streaming media and the like through the WiFi module 607, so that wireless broadband internet access is provided for the user. Although fig. 4 shows a WiFi module 607, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as required within a range that does not change the essence of the application.
The processor 608 is a control center of the terminal, and connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and modules stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring of the mobile phone. Optionally, the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The terminal also includes a power supply 609 (e.g., a battery) for powering the various components, which may be logically connected to the processor 608 via a power management system so as to provide for managing charging, discharging, and power consumption by the power management system. The power supply 609 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Specifically, in this embodiment, the processor 608 in the terminal loads executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 608 executes the application programs stored in the memory 602, so as to implement various functions:
When a data transmission instruction is received, determining a plurality of candidate communication modes corresponding to the data transmission instruction;
Determining a current communication mode of a terminal, and acquiring mode switching information of the current communication mode;
Determining a target communication mode from the plurality of candidate communication modes according to the mode switching information;
and switching the current communication mode into a target communication mode, and transmitting data based on the target communication mode.
The embodiment of the application discloses a data transmission method, a data transmission device, a storage medium and a terminal. The data transmission method comprises the following steps: when a data transmission instruction is received, a plurality of candidate communication modes corresponding to the data transmission instruction are determined, the current communication mode of the terminal is determined, mode switching information of the current communication mode is acquired, a target communication mode is determined from the plurality of candidate communication modes according to the mode switching information, the current communication mode is switched to the target communication mode, and data transmission is performed based on the target communication mode. According to the embodiment of the application, the switching frequency between every two communication modes is obtained according to the mode switching information of the terminal in the historical time period, after a data transmission instruction is received, the target communication mode is rapidly determined from the candidate communication modes corresponding to the data transmission instruction according to the switching frequency between every two communication modes, and then the data transmission is performed based on the target communication mode, so that the data transmission efficiency of the terminal can be rapidly improved.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be performed by instructions, or by controlling associated hardware by instructions, which may be stored in a storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the data transmission methods provided by the embodiments of the present application. For example, the instructions may perform the steps of:
When a data transmission instruction is received, a plurality of candidate communication modes corresponding to the data transmission instruction are determined, the current communication mode of the terminal is determined, mode switching information of the current communication mode is acquired, a target communication mode is determined from the plurality of candidate communication modes according to the mode switching information, the current communication mode is switched to the target communication mode, and data transmission is performed based on the target communication mode.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any data transmission method provided by the embodiment of the present application can be executed by the instructions stored in the storage medium, so that the beneficial effects that any data transmission method provided by the embodiment of the present application can be achieved, and detailed descriptions of the foregoing embodiments are omitted herein.
The data transmission method, device, storage medium and terminal provided by the embodiments of the present application are described in detail, and specific examples are applied to illustrate the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.