Data transmission method, device, storage medium and terminal
By determining candidate communication modes and switching frequency information in the terminal, the target communication mode is quickly selected for data transmission, which solves the data transmission delay problem caused by cumbersome communication mode selection in the existing technology and improves data transmission efficiency.
Patent Information
- Application Number
- CN202011329057.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-11-24
AI Technical Summary
During the data transmission process between terminals, the existing technology requires cumbersome operation settings, resulting in prolonged communication mode selection time and affecting data transmission efficiency.
When receiving a data transmission instruction, the candidate communication mode is determined, the mode switching information of the current communication mode is obtained, the target communication mode is quickly determined based on the mode with the highest switching frequency, and the mode is switched to the mode for data transmission.
It improves the data transmission efficiency between terminals, reduces the mode switching time, and improves the speed and efficiency of data transmission.
Smart Images

Figure CN112492554B
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile terminal applications, and in particular to a data transmission method, device, storage medium and terminal. Background Art
[0002] With the development of terminal technology, terminals can communicate with each other in a variety of ways. For example, when the terminal is in point-to-point mode, it can complete the communication connection and transmit data through short-range communication technology. Among them, the point-to-point mode refers to the sharing of computer resources and services through direct exchange between terminals. Each terminal in the network can act as a requester of network services and respond to requests from other terminals to provide resources and services.
[0003] In related technologies, short-range communication technology may include multiple short-range communication modes. During short-range communication between a terminal and other terminals, it is necessary to select a suitable target short-range communication mode based on the current communication function, and then set the short-range communication mode of the terminal to the target short-range communication mode, thereby completing data transmission between terminals.
[0004] However, when setting the terminal communication mode, cumbersome operation settings need to be completed, which prolongs the setting time and delays the data transmission between the terminals, thereby affecting the data transmission efficiency between the terminals. Summary of the invention
[0005] The embodiments of the present application provide a data transmission method, device, storage medium and terminal, which can improve the data transmission efficiency of the terminal.
[0006] The present invention provides a data transmission method, including:
[0007] When a data transmission instruction is received, determining a plurality of candidate communication modes corresponding to the data transmission instruction;
[0008] Determining a current communication mode of the terminal, and obtaining mode switching information of the current communication mode;
[0009] determining a target communication mode from a plurality of candidate communication modes according to the mode switching information;
[0010] The current communication mode is switched to the target communication mode, and data transmission is performed based on the target communication mode.
[0011] Accordingly, the embodiment of the present application further provides a data transmission device, including:
[0012] A receiving unit, configured to, when receiving a data transmission instruction, determine a plurality of candidate communication modes corresponding to the data transmission instruction;
[0013] an acquiring unit, configured to determine a current communication mode of the terminal and acquire mode switching information of the current communication mode;
[0014] a determining unit, configured to determine a target communication mode from a plurality of candidate communication modes according to the mode switching information;
[0015] A switching unit is used to switch the current communication mode to the target communication mode and perform data transmission based on the target communication mode.
[0016] Correspondingly, an embodiment of the present application further provides a storage medium, wherein the storage medium stores a plurality of instructions, wherein the instructions are suitable for loading by a processor to execute the data transmission method as described above.
[0017] Correspondingly, an embodiment of the present application further provides a terminal, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the data transmission method as described above.
[0018] After receiving a data transmission instruction, the embodiment of the present application determines multiple candidate communication modes according to the communication function corresponding to the data transmission instruction, and then obtains the communication mode with the highest switching frequency with the current communication mode in a historical time period, and quickly determines the target communication mode from the multiple candidate communication modes based on the communication mode with the highest switching frequency, so that the terminal can quickly switch the current communication mode to the target communication mode after receiving the data transmission instruction, thereby improving the data transmission efficiency of the terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A flowchart of a data transmission method provided in an embodiment of the present application.
[0021] Figure 2 A flowchart of another data transmission method provided in an embodiment of the present application.
[0022] Figure 3 A structural block diagram of a data transmission device provided in an embodiment of the present application.
[0023] Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0025] Based on the above problems, the embodiments of the present application provide a data transmission method, device, storage medium and terminal, which can improve the data transmission efficiency of the terminal. The following are detailed descriptions. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0026] Please refer to Figure 1 , Figure 1 A flow chart of a data transmission method provided in an embodiment of the present application. The data transmission method can be applied to mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (Portable Media Player, PMP), and fixed terminals such as desktop computers. The specific process of the data transmission method can be as follows:
[0027] 101. When a data transmission instruction is received, determine a plurality of candidate communication modes corresponding to the data transmission instruction.
[0028] In the embodiment of the present application, the terminal can communicate with other terminals, and after the terminal communicates with other terminals, data can be transmitted between the other terminals. Among them, the communication between the terminal and other terminals can realize communication functions through different communication modes, one communication function can be realized through different communication modes, and one communication mode can complete multiple communication functions.
[0029] For example, the communication modes that the terminal can support may include Bluetooth communication, NFC (Near Field Communication, near field wireless communication technology) communication and other communication modes. The terminal can share files with other terminals through the Bluetooth communication mode, and can connect with other terminals through the NFC communication mode to complete payment functions, etc.
[0030] Among them, the data transmission instruction refers to an instruction for starting a terminal to perform data transmission with other terminals. The data transmission instruction can be triggered in a variety of ways. For example, the data transmission instruction can be triggered by user operation. The user triggers the data transmission instruction by starting an application so that the terminal can complete the data transmission with other terminals through the application; or, the data transmission instruction can be triggered when the terminal detects a communication signal sent by other terminals. When the terminal detects the communication signal sent by other terminals, it can trigger the data transmission instruction to communicate with other terminals to perform the data transmission function.
[0031] The candidate communication mode refers to the communication mode that the terminal can choose to use when executing the current data transmission instruction. The communication modes that the terminal can support may include multiple modes, for example, the terminal can support: the first communication mode, the second communication mode, the third communication mode, and the like.
[0032] Among them, the data transmission instruction may correspond to a communication function, and the communication function may include multiple types. For example, the communication function may include a first communication function, a second communication function, etc. The communication function corresponding to the current data transmission instruction may be the first communication function.
[0033] After the communication function is determined according to the data transmission instruction, a candidate communication mode of the current data transmission instruction may be obtained according to the communication mode corresponding to the communication function.
[0034] For example, the communication function that the data transmission instruction needs to execute may be the first communication function, and the terminal may complete the first communication function through the first communication mode or the second communication mode. Then, it may be determined that the candidate communication modes include: the first communication mode and the second communication mode.
[0035] In some embodiments, in order to quickly determine the candidate communication mode corresponding to the data transmission instruction, before the step of "determining multiple candidate communication modes corresponding to the data transmission instruction", the following process may also be included:
[0036] Establish the association between different communication functions and different communication modes.
[0037] Then the step of "determining the target communication mode according to the data transmission instruction" may include the following operations:
[0038] Determine the target communication function corresponding to the data transmission instruction;
[0039] A communication mode associated with a target communication function is acquired to obtain a target communication mode.
[0040] The communication function refers to the function of a terminal to complete related operations by communicating with other terminals. By establishing an association between the pass mode and the communication function that can be achieved by the communication mode, after receiving the data transmission instruction, the communication mode can be quickly determined according to the communication function that needs to be completed by the data transmission instruction.
[0041] 102. Determine a current communication mode of the terminal, and obtain mode switching information of the current communication mode.
[0042] The current communication mode refers to the communication mode used by the communication function currently being executed when the terminal is running.
[0043] For example, the terminal detects that the current user operates application A and executes the second communication function in the third communication mode through application A, and then determines that the current communication mode can be the third communication mode.
[0044] The mode switching information includes: the switching frequency of the current communication mode being switched to other communication modes within a historical time period, that is, the number of switching times of the current communication mode being switched to each other communication mode.
[0045] The historical time period may refer to the time period before the current data transmission instruction is received. In order to ensure the effectiveness of the mode switching performed by the user during the use of the terminal, the length of the historical time period may be set as a preset period. For example, the preset period may be 7 days, etc. The preset period is not limited here and may be set according to the actual situation of the terminal use.
[0046] For example, the mode switching information of the current communication mode acquired by the terminal in the historical time period may include: in the past 7 days, the number of times the current communication mode was switched to the first communication mode was 5 times, and the number of times the current communication mode was switched to the second communication mode was 10 times.
[0047] In order to save storage space of the terminal, in some embodiments, before the step of “obtaining mode switching information of the current communication mode”, the following operations may also be included:
[0048] Obtain the switching frequency between the current communication mode and other communication modes within a preset historical period;
[0049] Determine other communication modes whose switching frequency with the current communication mode is greater than a preset threshold, and obtain multiple sample communication modes;
[0050] An association relationship between the current communication mode and each sample communication mode is established to obtain mode switching information of the current communication mode.
[0051] The preset historical period may refer to a historical time period, that is, a past time period from the current time. For example, the preset historical period may be the past 7 days from the current time, and so on.
[0052] The switching frequency refers to the number of times the current communication mode switches with other communication modes within a preset historical period.
[0053] For example, the preset historical period may be 7 days. Within the preset historical period, the number of times the communication mode of the terminal is switched from the current communication mode to communication mode A is 1 time, the number of times the current communication mode is switched to communication mode B is 5 times, the number of times the current communication mode is switched to communication mode C is 2 times, the number of times the current communication mode is switched to communication mode D is 7 times, the number of times the current communication mode is switched to communication mode E is 3 times, and the number of times the current communication mode is switched to communication mode F is 10 times. It can be obtained that the switching frequency between the current communication mode and other communication modes within the preset historical 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.
[0054] After obtaining the switching frequency between the current communication mode and other communication modes within a preset historical period, the switching frequency can be compared with a preset threshold. The preset threshold can be set according to the terminal usage. For example, the preset threshold can be 5, which means that the number of switching times from the current communication mode to other communication modes within the preset historical period is greater than or less than 5 times, which means that the switching frequency from the current communication mode to the other communication mode is high, and the switching information between the current communication mode and the other communication mode can be stored.
[0055] The sample communication mode refers to other communication modes whose switching frequency from the current mode to other modes within a preset historical period is greater than a preset threshold.
[0056] For example, the switching frequency between the current communication mode and other communication modes within the preset historical 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 can be 5, and other modes with switching frequencies greater than or equal to the preset threshold include: mode B, mode D and mode F, and the sample communication modes can be obtained as: mode B, mode D and mode F.
[0057] The association relationship refers to the switching relationship between the current communication mode and the sample communication mode, and the communication mode that needs to be switched can be quickly determined based on the association relationship.
[0058] After the sample communication mode is determined, the current communication mode can be associated with each sample communication mode to obtain the association relationship between the current communication mode and each sample communication mode, and all the association relationships are stored to obtain the mode switching information of the current communication mode. By establishing an association relationship and storing other communication modes that meet the preset conditions in the historical time period with the current communication mode in the above manner, other communication modes with a low switching frequency with the current communication mode can be screened out, saving terminal storage space.
[0059] 103. Determine a target communication mode from multiple candidate communication modes according to the mode switching information.
[0060] In one embodiment, in order to increase the switching frequency of the communication mode, the step of “determining the target communication mode from multiple candidate communication modes according to the mode switching information” may include the following operations:
[0061] Determine, from among the plurality of sample communication modes, a target sample communication mode having the highest switching frequency with the current communication mode;
[0062] A target communication mode is determined from a plurality of candidate communication modes based on the target sample communication mode.
[0063] The mode switching information includes the switching frequency between the current communication mode and each sample communication mode within a preset historical period.
[0064] Specifically, the maximum switching frequency is found 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.
[0065] For example, mode switching information may include switching frequencies: 5 times, 7 times, 10 times, among which a switching frequency of 5 times corresponds to: current communication mode → mode B, a switching frequency of 7 times corresponds to: current communication mode → mode D, and a switching frequency of 10 times corresponds to: current communication mode → mode F. By comparing the switching frequencies, it can be obtained that the maximum switching frequency is 10 times. Based on the mode switching association relationship corresponding to the maximum switching frequency, it can be determined that the target sample communication mode can be mode F.
[0066] The target communication mode refers to the communication mode that needs to be set for the current terminal-specified data transmission instruction.
[0067] In some embodiments, in order to quickly determine the target communication mode, the step of “determining the target communication mode from multiple candidate communication modes based on the target communication mode” may include the following process:
[0068] matching the target sample communication pattern with each candidate communication pattern;
[0069] If there is a candidate communication mode that successfully matches the target sample communication mode among the multiple candidate communication modes, determining the successfully matched candidate mode as the target communication mode;
[0070] If there is no candidate communication mode that successfully matches the target sample communication mode among the multiple candidate communication modes, a sample communication mode that successfully matches the multiple candidate modes is determined from the multiple sample communication modes, and the sample communication mode with the highest switching frequency is determined as the target communication mode.
[0071] Specifically, each candidate communication mode may be compared with the target sample communication mode to determine whether there is a candidate communication mode that is the same as the target sample communication mode among the candidate communication modes, and the target communication mode may be determined according to the determination result.
[0072] For example, candidate communication modes may include: mode A, mode B and mode F. The target sample communication mode may be mode F. By comparing the candidate communication modes with the target sample communication modes, it can be determined that there is a candidate communication mode in the candidate communication modes that is the same as the target sample communication mode, which is mode F. Then, mode F can be determined as the target communication mode.
[0073] For another example, the candidate communication modes may include: mode A, mode B and mode C, the target sample communication mode may be mode F, and by comparing the candidate communication modes with the target sample communication mode, it can be determined that there is no candidate communication mode in the candidate communication modes that is the same as the target sample communication mode.
[0074] When there is no candidate communication mode that is identical to the target sample communication mode among the candidate communication modes, in order to quickly determine the target communication mode, the search range can be increased, and the candidate communication mode can be compared with other sample communication modes in the switching mode information of the current communication mode. If there is a sample communication mode among the other sample communication modes that is identical to the candidate communication mode, then the sample communication mode is determined to be the target communication mode.
[0075] For example, candidate communication modes may include: mode A, mode B, mode C; sample communication modes may include: mode B, mode D, mode F. It can be determined that there is a sample communication mode among the sample communication modes that is the same as the candidate communication mode, namely mode B, and then mode B can be determined as the target communication mode.
[0076] In one embodiment, if there are multiple sample communication modes among other sample communication modes that are the same as the candidate communication mode, the sample communication mode with the highest switching frequency with the current communication mode is determined from the multiple sample communication modes to obtain the target communication mode.
[0077] For example, the candidate communication modes may include: mode A, mode B, mode C; the sample communication modes may include: mode B, mode C, mode F, and it can be determined that there are two sample communication modes in 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 with mode B and mode C are searched from the mode switching information of the current communication mode, and it can be: the switching frequency of the current communication mode with mode B is 6 times, and the switching frequency of the current communication mode with mode B is 8 times, and then it can be determined that mode B with a higher switching frequency with the current mode is the target communication mode.
[0078] 104. Switch the current communication mode to the target communication mode, and perform data transmission based on the target communication mode.
[0079] In some embodiments, in order 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:
[0080] Determining mode adjustment information based on the current communication mode and the target communication mode;
[0081] The current communication mode of the terminal is adjusted according to the mode adjustment information.
[0082] The mode adjustment information refers to the content set when the terminal switches the current communication mode to the target communication mode, and the mode adjustment information may include a mode adjustment parameter value. The mode adjustment parameter value refers to the value corresponding to the association relationship between the current communication mode and the target communication mode, for example, the mode adjustment parameter may be 1, etc.
[0083] In some embodiments, in order to quickly obtain the mode adjustment information between the current communication mode and the target communication mode, the step of "determining the mode adjustment information based on the current communication mode and the target communication mode" may include the following operations:
[0084] Obtaining a correspondence between the current communication mode and the target communication mode from a preset relationship table;
[0085] From the multiple sample adjustment parameters, the sample adjustment parameters corresponding to the corresponding relationship are determined to obtain the mode adjustment information.
[0086] The preset relationship table includes corresponding relationships between a plurality of sample communication modes, which can be preset.
[0087] 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 process may also be included:
[0088] Obtain multiple communication modes supported by the terminal;
[0089] A corresponding relationship is established between every two communication modes in the multiple communication modes to obtain a relationship table between the multiple communication modes.
[0090] The multiple communication modes supported by the terminal refer to multiple communication modes that the terminal can use to complete communication functions. Then, a correspondence relationship can be established between the multiple communication modes supported by the terminal.
[0091] For example, the communication modes that the terminal can support and use may include: mode A, mode B, mode C, mode D. A correspondence between every two communication modes is established based on all the communication modes supported and used by the terminal. Then, it can be determined that the preset relationship table includes: mode A→mode B, mode A→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.
[0092] After determining the preset relationship table, the adjustment parameters corresponding to each corresponding relationship in the preset relationship table can be set, and multiple sample adjustment parameters can be obtained. In order to avoid errors in mode switching, different adjustment parameters can be set for different corresponding relationships, for example, a first parameter is set for the first corresponding relationship, and a second parameter is set for the second corresponding relationship. The adjustment parameters can be various values, for example, the adjustment parameters can be 1, 2, 3, etc.
[0093] Then, after determining the current communication mode and the template communication mode, the correspondence between the current communication mode and the target communication mode can be first obtained from the preset relationship table, and then the sample adjustment parameters corresponding to the correspondence can be determined from multiple sample adjustment parameters, that is, the mode adjustment information can be obtained.
[0094] In some embodiments, in order to improve 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:
[0095] Get the mode parameter value corresponding to the current communication mode;
[0096] Adjust the mode parameter value according to the mode parameter adjustment value to obtain the adjusted mode parameter value;
[0097] The current communication mode is switched to the target communication mode based on the adjusted mode parameter value.
[0098] The mode parameter refers to a parameter for setting the communication mode of the terminal. The communication mode of the terminal can be switched to a different communication mode by setting the mode parameter to a different value.
[0099] After the mode adjustment information corresponding to the current communication mode is acquired, the mode adjustment parameter can be adjusted according to the mode adjustment parameter value in the mode adjustment information, that is, the current communication mode can be switched to the target communication mode.
[0100] For example, the mode parameter adjustment value may be 2, and the current mode parameter value may be 3. By adjusting the mode parameter adjustment value based on the current mode parameter value, the mode parameter value may be adjusted to 2, that is, the current communication mode may be switched to the target communication mode.
[0101] After switching the current communication mode 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.
[0102] In some embodiments, in order to ensure the data transmission speed, after the step of “transmitting data based on the target communication mode”, the following operations may also be included:
[0103] Get the data transmission rate when data transmission is performed in the target communication mode;
[0104] If the data transmission rate is less than the preset data transmission rate, obtaining the communication function corresponding to the data transmission instruction;
[0105] obtaining a plurality of communication modes associated with the communication function;
[0106] From multiple communication modes, select another communication mode for data transmission.
[0107] The data transmission rate refers to the speed at which a terminal transmits data to other terminals in the target communication mode.
[0108] The preset data transmission rate refers to the minimum data transmission rate that can ensure smooth data transmission between terminals.
[0109] When the data transmission rate of the terminal in the target communication mode is lower than the preset transmission rate, the data transmission speed between the terminals will be affected. At this time, other communication modes with higher data transmission rates can be selected from multiple associated communication modes corresponding to the communication function of the currently executed data transmission instruction, thereby improving the data transmission speed.
[0110] The embodiment of the present application discloses a data transmission method, which includes: when a data transmission instruction is received, determining multiple candidate communication modes corresponding to the data transmission instruction, determining the current communication mode of the terminal, and obtaining mode switching information of the current communication mode, determining a target communication mode from multiple candidate communication modes according to the mode switching information, switching the current communication mode to the target communication mode, and transmitting data based on the target communication mode. After receiving the data transmission instruction, the embodiment of the present application determines multiple candidate communication modes according to the communication function corresponding to the data transmission instruction, and then obtains the communication mode with the highest switching frequency with the current communication mode in the historical time period, and quickly determines the target communication mode from multiple candidate communication modes based on the communication mode with the highest switching frequency, so that the terminal can quickly switch the current communication mode to the target communication mode after receiving the data transmission instruction, thereby improving the data transmission efficiency of the terminal.
[0111] refer to Figure 2 , Figure 2 A flowchart of another data transmission method provided in an embodiment of the present application. Taking the data transmission method applied to a terminal as an example, the data transmission method may include:
[0112] 201. A terminal receives a communication connection request sent by an electronic device, and determines a target communication mode according to the communication connection request.
[0113] In the embodiments of the present application, the electronic device refers to various devices that can communicate and connect with the terminal. For example, the electronic device can be a Bluetooth headset, a card reader, a computer, etc., wherein the terminal can communicate with the Bluetooth headset via a Bluetooth connection, the terminal can communicate with the card reader via an NFC connection, the terminal can communicate with the computer via a Bluetooth or WiFi connection, etc.
[0114] The communication connection request may be sent by the electronic device to the terminal, and the communication connection request may trigger the terminal to start the communication function. The communication connection request may carry device information of the electronic device, and the terminal may identify the electronic device sending the communication request through the device information.
[0115] The target communication mode refers to a communication mode in which the terminal establishes a communication connection with the electronic device after receiving a communication connection request sent by the electronic device.
[0116] When the terminal receives a communication connection request sent by an electronic device, the device information of the electronic device in the communication connection request can be obtained. According to the device information, the target communication mode can be selected from the communication modes supported by the terminal. The specific selection method can be referred to the above embodiment and will not be elaborated here.
[0117] For example, the electronic device may be an NFC device. The current terminal receives a communication connection request sent by the NFC device, obtains information of the NFC device, and can determine that the target communication mode is the NFC communication mode.
[0118] 202. The terminal obtains a current communication mode, and obtains an association relationship between the current communication mode and a target communication mode from a preset relationship table.
[0119] The current communication mode refers to the communication mode currently enabled by the terminal communication module. The terminal communication module is mainly used to control the startup of the terminal communication mode and the switching between different communication modes.
[0120] For example, when the terminal receives a communication connection request sent by the electronic device, the terminal may be connected to a Bluetooth headset, and it may be determined that the current communication mode is the Bluetooth communication mode.
[0121] The preset relationship table includes all communication modes in the terminal, and the association relationship between every two communication modes, that is, the mutual switching relationship between every two communication modes.
[0122] For example, the communication modes included in the terminal may include: Bluetooth communication mode and NFC communication mode, and 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.
[0123] The terminal may associate each two communication modes in advance to obtain an association relationship between each two communication modes, and then set a parameter value for each association relationship, so that when the terminal needs to switch the communication mode, the current communication mode can be quickly switched to the target communication mode. In order to ensure the accuracy of the terminal when switching the communication mode, different association relationships may correspond to different communication modes.
[0124] 203. The terminal determines a sample adjustment parameter value corresponding to the association relationship from a plurality of sample adjustment parameter values to obtain a target adjustment parameter value.
[0125] The multiple sample adjustment parameters include adjustment parameters corresponding to the association relationship between each pair of communication modes.
[0126] After obtaining the association relationship corresponding to switching from the current communication mode to the target communication mode from the preset relationship table, the parameter adjustment corresponding to the association relationship can be determined from multiple sample adjustment parameter values, thereby obtaining the target adjustment parameter.
[0127] For example, the current communication mode may be a Bluetooth communication mode, and the target communication mode may be an NFC communication mode. From the preset relationship table, the association relationship between the current communication mode and the target communication mode may be obtained, that is, the Bluetooth communication mode switches to the NFC communication mode. Further, the sample adjustment parameter value corresponding to the association relationship may be 3, and the target adjustment parameter may be determined to be 3.
[0128] 204. The terminal adjusts the current mode parameters based on the target adjustment parameter value, and switches the current communication mode to the target communication mode.
[0129] The mode parameter is used to set the terminal communication mode, and different communication modes of the terminal can be started according to the set parameter values.
[0130] After determining the target adjustment parameter value, the terminal can adjust the value of the current mode parameter, that is, the value of the mode parameter can be set to the target adjustment parameter value. By adjusting the value of the mode parameter to the target adjustment parameter value, the current communication mode can be quickly switched to the target communication mode.
[0131] 205. The terminal establishes a communication connection with the electronic device according to the target communication mode and executes a corresponding communication function.
[0132] After the terminal completes the communication mode switching, it can start the target communication mode, respond to the communication connection request sent by the electronic device, and establish a communication connection with the electronic device according to the device information carried in the communication connection request. Further, the communication function corresponding to the target communication mode is executed.
[0133] The embodiment of the present application discloses a data transmission method, which includes: a terminal receives a communication connection instruction sent by other terminals, determines a target communication mode according to the communication connection instruction, obtains the current communication mode, and obtains the association relationship between the current communication mode and the target communication mode from a preset relationship table, determines a sample adjustment parameter value corresponding to the association relationship from multiple 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, and the terminal communicates with other terminals according to the target communication mode and performs corresponding communication functions. This improves the efficiency of terminal communication mode switching.
[0134] In order to better implement the data transmission method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above data transmission method. The meanings of the terms are the same as those in the above data transmission method, and the specific implementation details can refer to the description in the method embodiment.
[0135] See also Figure 3 , Figure 3This is a structural block diagram of a data transmission device provided in an embodiment of the present application. The data transmission device can be applied to mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (Portable Media Player, PMP), and fixed terminals such as desktop computers. The device includes:
[0136] The receiving unit 301 is configured to, when receiving a data transmission instruction, determine a plurality of candidate communication modes corresponding to the data transmission instruction;
[0137] An acquiring unit 302 is configured to determine a current communication mode of the terminal and acquire mode switching information of the current communication mode;
[0138] A determination unit 303, configured to determine a target communication mode from a plurality of candidate communication modes according to the mode switching information;
[0139] The switching unit 304 is configured to switch the current communication mode to the target communication mode, and perform data transmission based on the target communication mode.
[0140] In some embodiments, the determining unit 303 may include:
[0141] A first determining subunit is used to determine, from a plurality of sample communication modes, a target sample communication mode having the highest switching frequency with the current communication mode;
[0142] The second determining subunit is configured to determine the target communication mode from a plurality of candidate communication modes based on the target sample communication mode.
[0143] In some embodiments, the second determining subunit may be specifically used for:
[0144] Matching the target sample communication mode with each candidate communication mode;
[0145] If there is a candidate communication mode that successfully matches the target sample communication mode among the multiple candidate communication modes, determining the successfully matched candidate mode as the target communication mode;
[0146] If there is no candidate communication mode that successfully matches the target sample communication mode among the multiple candidate communication modes, a sample communication mode that successfully matches the multiple candidate modes is determined from the multiple sample communication modes, and the sample communication mode with the highest switching frequency is determined as the target communication mode.
[0147] In some embodiments, the switching unit 304 may include:
[0148] A third determining subunit, configured to determine mode adjustment information based on the current communication mode and the target communication mode;
[0149] The adjustment subunit is used to adjust the current communication mode of the terminal according to the mode adjustment information.
[0150] In some embodiments, the regulating subunit may be specifically used for:
[0151] Obtaining a mode parameter value corresponding to the current communication mode;
[0152] Adjusting the mode parameter value according to the mode parameter adjustment value to obtain an adjusted mode parameter value;
[0153] The current communication mode is switched to the target communication mode based on the adjusted mode parameter value.
[0154] In some embodiments, the regulating subunit may also be used to:
[0155] Obtaining a mode parameter value corresponding to the current communication mode;
[0156] Adjusting the mode parameter value according to the mode parameter adjustment value to obtain an adjusted mode parameter value;
[0157] From a preset relationship table, obtain the correspondence between the current communication mode and the target communication mode, wherein the preset relationship table includes the correspondence between multiple sample communication modes; from multiple sample adjustment parameters, determine the sample adjustment parameter corresponding to the correspondence to obtain the mode adjustment information.
[0158] In some embodiments, the data transmission device may further include:
[0159] An acquisition unit, used to acquire a switching frequency between the current communication mode and other communication modes within a preset historical period;
[0160] An execution unit, configured to determine other communication modes whose switching frequency with the current communication mode is greater than a preset threshold, and obtain a plurality of sample communication modes;
[0161] The establishing unit is used to establish an association relationship between the current communication mode and each sample communication mode to obtain mode switching information of the current communication mode.
[0162] The embodiment of the present application discloses a data transmission device, which includes: a receiving unit 301 determines multiple candidate communication modes corresponding to the data transmission instruction when receiving a data transmission instruction, an acquisition unit 302 determines the current communication mode of the terminal and obtains the mode switching information of the current communication mode, a determination unit 303 determines the target communication mode from multiple candidate communication modes according to the mode switching information, and a switching unit 304 switches the current communication mode to the target communication mode, and performs data transmission based on the target communication mode. The embodiment of the present application obtains the switching frequency between each two communication modes according to the mode switching information of the terminal in the historical time period, and after receiving the data transmission instruction, the target communication mode is quickly determined from the candidate communication modes corresponding to the data transmission instruction according to the switching frequency between each two communication modes, and then data transmission is performed based on the target communication mode, which can quickly improve the data transmission efficiency of the terminal.
[0163] The present application also provides a terminal. Figure 4 As shown, the terminal may include a radio frequency (RF) circuit 601, a memory 602 including one or more storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a wireless fidelity (WiFi) module 607, a processor 608 including one or more processing cores, and a power supply 609. Those skilled in the art will appreciate that Figure 4 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0164] The RF circuit 601 can be used for receiving and sending signals during the process of sending and receiving information. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 608 for processing; in addition, the uplink data is sent to the base station. Generally, the RF circuit 601 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 601 can also communicate with the network and other devices through wireless communication.
[0165] The memory 602 can be used to store software programs and modules, and the processor 608 executes various functional applications and data transmission by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 608 and the input unit 603 with access to the memory 602.
[0166] The input unit 603 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, in a specific embodiment, the input unit 603 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touchpad, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch-sensitive surface), and drive the corresponding connection device according to a pre-set program. In addition to the touch-sensitive surface, the input unit 603 may also include other input devices. Specifically, 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, a mouse, a joystick, etc.
[0167] The display unit 604 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the server, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 604 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 608 to determine the type of touch event. The processor 608 then provides a corresponding visual output on the display panel according to the type of touch event. Although in Figure 4 In the embodiment, the touch-sensitive surface and the display panel are used as two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize input and output functions.
[0168] 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 and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and the backlight when the server is moved to the ear.
[0169] The audio circuit 606, the speaker, and the microphone can provide an audio interface between the user and the server. The audio circuit 606 can transmit the electrical signal converted from the received audio data to the speaker, which is converted 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 606 and converted into audio data, and then the audio data is processed by the output processor 608 and sent to, for example, a terminal through the RF circuit 601, or the audio data is output to the memory 602 for further processing. The audio circuit 606 may also include an earplug jack to provide communication between an external headset and the server.
[0170] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 607. It provides users with wireless broadband Internet access. Figure 4 A WiFi module 607 is shown, but it is understandable that it is not a necessary component of the terminal and can be omitted as needed without changing the essence of the application.
[0171] The processor 608 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and modules stored in the memory 602, and calling data stored in the memory 602, it executes various functions of the server and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 608.
[0172] The terminal also includes a power supply 609 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 608 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 609 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0173] Specifically in this embodiment, the processor 608 in the terminal will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 608 will run the applications stored in the memory 602 to implement various functions:
[0174] When a data transmission instruction is received, determining a plurality of candidate communication modes corresponding to the data transmission instruction;
[0175] Determine the current communication mode of the terminal and obtain mode switching information of the current communication mode;
[0176] determining a target communication mode from a plurality of candidate communication modes according to the mode switching information;
[0177] The current communication mode is switched to the target communication mode, and data transmission is performed based on the target communication mode.
[0178] The embodiment of the present application discloses a data transmission method, device, storage medium and terminal. The data transmission method includes: when a data transmission instruction is received, determining multiple candidate communication modes corresponding to the data transmission instruction, determining the current communication mode of the terminal, and obtaining mode switching information of the current communication mode, determining the target communication mode from multiple candidate communication modes according to the mode switching information, switching the current communication mode to the target communication mode, and performing data transmission based on the target communication mode. The embodiment of the present application obtains the switching frequency between each two communication modes according to the mode switching information of the terminal in the historical time period, and after receiving the data transmission instruction, quickly determines the target communication mode from the candidate communication modes corresponding to the data transmission instruction according to the switching frequency between each two communication modes, and then performs data transmission based on the target communication mode, which can quickly improve the data transmission efficiency of the terminal.
[0179] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a storage medium and loaded and executed by a processor.
[0180] To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the data transmission methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:
[0181] When a data transmission instruction is received, multiple candidate communication modes corresponding to the data transmission instruction are determined, the current communication mode of the terminal is determined, and mode switching information of the current communication mode is obtained. The target communication mode is determined from the multiple 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.
[0182] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0183] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0184] Since the instructions stored in the storage medium can execute the steps in any one of the data transmission methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the data transmission methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0185] The data transmission method, device, storage medium and terminal provided in the embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data transmission method, characterized in that: Applied to a terminal, the method comprises: Establishing a correspondence between every two communication modes among the multiple communication modes supported by the terminal, and obtaining a preset relationship table corresponding to the multiple communication modes, wherein the preset relationship table includes a correspondence between every two communication modes; Setting the adjustment parameter corresponding to each corresponding relationship in the preset relationship table to obtain multiple sample adjustment parameters, wherein different corresponding relationships correspond to different adjustment parameters; Establish the association between different communication functions and different communication modes; When a data transmission instruction is received, determining a target communication function corresponding to the data transmission instruction; acquiring a communication mode associated with the target communication function based on the association relationship to obtain a plurality of candidate communication modes; Determine a current communication mode of the terminal, and obtain mode switching information of the current communication mode, the mode switching information including: a switching frequency of the current communication mode being switched to each sample communication mode within a historical time period; determining a target communication mode from a plurality of candidate communication modes according to the mode switching information; Obtaining a correspondence between the current communication mode and the target communication mode from the preset relationship table; Determine, from the plurality of sample adjustment parameters, a sample adjustment parameter corresponding to the corresponding relationship, and obtain a mode parameter adjustment value; Obtaining a mode parameter value corresponding to the current communication mode; Adjusting the mode parameter value according to the mode parameter adjustment 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; Data transmission is performed based on the target communication mode.
2. The method according to claim 1, characterized in that: The mode switching information includes: a switching frequency between the current communication mode and each sample communication mode of a plurality of sample communication modes; Determining a target communication mode from a plurality of candidate communication modes according to the mode switching information includes: Determine, from a plurality of sample communication modes, a target sample communication mode with the highest switching frequency with the current communication mode; The target communication mode is determined from a plurality of candidate communication modes based on the target sample communication mode.
3. The method according to claim 2, characterized in that The determining the target communication mode from a plurality of candidate communication modes based on the target communication mode comprises: Matching the target sample communication mode with each candidate communication mode; If there is a candidate communication mode that successfully matches the target sample communication mode among the multiple candidate communication modes, determining the successfully matched candidate mode as the target communication mode; If there is no candidate communication mode that successfully matches the target sample communication mode among the multiple candidate communication modes, a sample communication mode that successfully matches the multiple candidate modes is determined from the multiple sample communication modes, and the sample communication mode with the highest switching frequency is determined as the target communication mode.
4. The method according to any one of claims 1 to 3, characterized in that: Before acquiring the mode switching information of the current communication mode, the method further includes: Obtaining a switching frequency between the current communication mode and other communication modes within a preset historical period; Determine other communication modes whose switching frequency with the current communication mode is greater than a preset threshold, and obtain multiple sample communication modes; An association relationship between the current communication mode and each sample communication mode is established to obtain mode switching information of the current communication mode.
5. A data transmission device, characterized in that: include: The data transmission device is used to establish a corresponding relationship between every two communication modes among the multiple communication modes supported by the terminal, and obtain a preset relationship table corresponding to the multiple communication modes, wherein the preset relationship table includes the corresponding relationship between every two communication modes; Setting the adjustment parameter corresponding to each corresponding relationship in the preset relationship table to obtain multiple sample adjustment parameters, wherein different corresponding relationships correspond to different adjustment parameters; The data transmission device is used to establish an association relationship between different communication functions and different communication modes; A receiving unit, configured to, when receiving a data transmission instruction, determine a target communication function corresponding to the data transmission instruction; acquire a communication mode associated with the target communication function based on the association relationship to obtain a plurality of candidate communication modes; an acquisition unit, configured to determine a current communication mode of the terminal and acquire mode switching information of the current communication mode, wherein the mode switching information includes: a switching frequency of the current communication mode being switched to each sample communication mode within a historical time period; a determining unit, configured to determine a target communication mode from a plurality of candidate communication modes according to the mode switching information; A switching unit is used to obtain the correspondence between the current communication mode and the target communication mode from the preset relationship table; determine the sample adjustment parameter corresponding to the correspondence from the multiple sample adjustment parameters to obtain a mode parameter adjustment value; obtain a mode parameter value corresponding to the current communication mode; adjust the mode parameter value according to the mode parameter adjustment value to obtain an adjusted mode parameter value; switch the current communication mode to the target communication mode based on the adjusted mode parameter value; and transmit data based on the target communication mode.
6. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the data transmission method according to any one of claims 1 to 4.
7. A terminal, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps of the data transmission method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Communication connection method and device, terminal and storage medium
CN108347720A
Wireless communication method using near field communication, and electronic device
CN108353265A
Network connection management method, device and system
CN109565735A
Data transmission mode switching method and device, storage medium and electronic equipment
CN110856213A
Communication mode selection method and device, electronic device and medium
CN110944374A
