Data transmission method and device, equipment and storage medium
By determining and adapting the target connection parameters in the electronic device in response to the initial connection parameters, the problem of the device being unable to recognize or data transmission is interrupted is solved, ensuring the smooth progress and smoothness of data transmission.
Patent Information
- Application Number
- CN202310579786.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2043-05-22
AI Technical Summary
During the data transmission between electronic devices, a common problem is that the device cannot recognize it or the data transmission is interrupted after interconnection, mainly due to mismatch of connection parameters.
By establishing a connection with the second electronic device in response to the initial connection parameter, it is determined whether the data transmission condition is met. If it is not met, the target connection parameter is determined, and then the second connection is established for data transmission. The method includes taking turns to select from multiple sets of alternative connection parameters, performing transmission tests, determining packet loss rate to determine target connection parameters, and adapting connection parameters if necessary.
Automatic adaptation of connection parameters is realized, avoiding the problem of devices being unable to connect or data transmission is disconnected, ensuring the smooth progress of data transmission and improving the smoothness of the transmission process.
Smart Images

Figure CN119011648A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of electronic equipment, and in particular to a data transmission method, apparatus, device and storage medium. Background Art
[0002] With the popularization of electronic devices such as tablet computers, smart phones, car terminals, digital cameras, printers, etc., people are paying more and more attention to the use of these devices and computers, or data transmission between devices.
[0003] In the related art, electronic devices are usually adapted to a set of USB (Universal Serial Bus) parameters based on standard data cables and test equipment when leaving the factory. These parameters are only applicable to the electronic device being charged by connecting to a charger via a standard data cable, or being interconnected with other devices via a standard data cable for data transmission.
[0004] However, with the increasing number of data cables and devices on the market, when electronic devices are connected to other devices via standard or non-standard data cables for data transmission, it is easy for the sending device to fail to connect (i.e., the device cannot be recognized) or the data transmission is interrupted after the connection. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide a data transmission method, apparatus, device and storage medium to solve the defects in the related art.
[0006] According to a first aspect of an embodiment of the present disclosure, a data transmission method is provided, which is applied to a first electronic device, and the method includes:
[0007] In response to establishing a first connection with a second electronic device based on the initial connection parameters, determining whether the first connection satisfies a data transmission condition;
[0008] In response to the first connection not satisfying the data transmission condition, determining a target connection parameter;
[0009] A second connection is established with the second electronic device based on the target connection parameters, and data is transmitted based on the second connection.
[0010] In some embodiments, determining whether the first connection satisfies a data transmission condition includes:
[0011] In response to receiving a first preset message, it is determined that the first connection meets the data transmission condition, and the first preset message is used to indicate that the connection with the second electronic device is successful.
[0012] In some embodiments, determining the target connection parameters includes:
[0013] Selecting each set of candidate connection parameters in turn from the first set of multiple sets of candidate connection parameters;
[0014] establishing a third connection with the second electronic device based on each set of candidate connection parameters;
[0015] Performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters;
[0016] Based on the transmission test result, the target connection parameter is determined from the multiple sets of candidate connection parameters.
[0017] In some embodiments, performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters includes:
[0018] Sending a preset number of test messages to the second electronic device based on the third connection;
[0019] receiving a reply message returned by the second electronic device based on the received test message;
[0020] The packet loss rate is determined based on the preset number and a first number carried in the reply message, and is used as a transmission test result corresponding to each set of alternative connection parameters, wherein the first number is used to characterize the number of test messages received by the second electronic device.
[0021] In some embodiments, the method further comprises:
[0022] In response to the target connection parameter not existing in the plurality of sets of candidate connection parameters of the first set, generating prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from the plurality of sets of candidate connection parameters of the second set based on a parameter traversal manner;
[0023] In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
[0024] In some embodiments, determining the target connection parameters includes:
[0025] Generate prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from a plurality of sets of candidate connection parameters in the second set based on a parameter traversal method;
[0026] In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
[0027] In some embodiments, the method further comprises:
[0028] In response to the instruction to save the target connection parameter, creating a correspondence between the target connection parameter and the device information of the second electronic device;
[0029] Based on the corresponding relationship, the target connection parameter is stored in at least one of the first electronic device, the second device and the server.
[0030] According to a second aspect of an embodiment of the present disclosure, a data transmission device is provided, which is applied to a first electronic device, and the device includes:
[0031] a connection determination module, configured to determine whether a first connection satisfies a data transmission condition in response to establishing a first connection with a second electronic device based on an initial connection parameter;
[0032] a parameter determination module, configured to determine a target connection parameter in response to the first connection not satisfying the data transmission condition;
[0033] A data transmission module is used to establish a second connection with the second electronic device based on the target connection parameters, and perform data transmission based on the second connection.
[0034] In some embodiments, the connection determination module is further used to determine that the first connection meets the data transmission condition in response to receiving a first preset message, and the first preset message is used to indicate that the connection with the second electronic device is successful.
[0035] In some embodiments, the parameter determination module includes a first determination unit;
[0036] The first determining unit is used for:
[0037] Selecting each set of candidate connection parameters in turn from the first set of multiple sets of candidate connection parameters;
[0038] establishing a third connection with the second electronic device based on each set of candidate connection parameters;
[0039] Performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters;
[0040] Based on the transmission test result, the target connection parameter is determined from the multiple sets of candidate connection parameters.
[0041] In some embodiments, the first determining unit is further configured to:
[0042] Sending a preset number of test messages to the second electronic device based on the third connection;
[0043] receiving a reply message returned by the second electronic device based on the received test message;
[0044] The packet loss rate is determined based on the preset number and a first number carried in the reply message, and is used as a transmission test result corresponding to each set of alternative connection parameters, wherein the first number is used to characterize the number of test messages received by the second electronic device.
[0045] In some embodiments, the first determining unit is configured to:
[0046] In response to the target connection parameter not existing in the multiple sets of candidate connection parameters, generating prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from the multiple sets of candidate connection parameters in the second set based on a parameter traversal manner;
[0047] In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
[0048] In some embodiments, the parameter determination module includes a second determination unit;
[0049] The second determining unit is used for:
[0050] Generate prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from a plurality of sets of candidate connection parameters in the second set based on a parameter traversal method;
[0051] In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
[0052] In some embodiments, the device further comprises a parameter storage module;
[0053] The parameter saving module comprises:
[0054] a relationship creating unit, configured to create a corresponding relationship between the target connection parameter and the device information of the second electronic device in response to a save instruction of the target connection parameter;
[0055] A parameter storage unit is used to store the target connection parameter in at least one of the first electronic device, the second device and the server based on the corresponding relationship.
[0056] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, the device comprising:
[0057] a processor and a memory for storing a computer program;
[0058] Wherein, the processor is configured to implement, when executing the computer program:
[0059] In response to establishing a first connection with a second electronic device based on the initial connection parameters, determining whether the first connection satisfies a data transmission condition;
[0060] In response to the first connection not satisfying the data transmission condition, determining a target connection parameter;
[0061] A second connection is established with the second electronic device based on the target connection parameters, and data is transmitted based on the second connection.
[0062] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the following is implemented:
[0063] In response to establishing a first connection with a second electronic device based on the initial connection parameters, determining whether the first connection satisfies a data transmission condition;
[0064] In response to the first connection not satisfying the data transmission condition, determining a target connection parameter;
[0065] A second connection is established with the second electronic device based on the target connection parameters, and data is transmitted based on the second connection.
[0066] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0067] The present disclosure determines whether the first connection meets the data transmission condition in response to establishing a first connection with the second electronic device based on initial connection parameters, and determines the target connection parameters in response to the first connection not meeting the data transmission condition, and then establishes a second connection with the second electronic device based on the target connection parameters, and performs data transmission based on the second connection. Since the target connection parameters are determined when the first connection does not meet the data transmission condition, automatic adaptation of the connection parameters can be achieved, and the problems such as the inability to interconnect with the second electronic device during data transmission or the interruption of data transmission after interconnection can be effectively avoided, thereby ensuring the smooth progress of data transmission and improving the fluency of the data transmission process.
[0068] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0070] Figure 1 is a flow chart of a data transmission method according to an exemplary embodiment of the present disclosure;
[0071] Figure 2 is a flowchart showing how to determine target connection parameters according to an exemplary embodiment of the present disclosure;
[0072] Figure 3 is a flowchart showing how to obtain the transmission test results corresponding to each set of candidate connection parameters according to an exemplary embodiment of the present disclosure;
[0073] Figure 4 is a flowchart showing how to determine target connection parameters according to another exemplary embodiment of the present disclosure;
[0074] Figure 5 is a flowchart showing how to determine target connection parameters according to another exemplary embodiment of the present disclosure;
[0075] Figure 6 is a flowchart showing how to save the target connection parameters according to an exemplary embodiment of the present disclosure;
[0076] Figure 7 is a block diagram of a data transmission device according to an exemplary embodiment of the present disclosure;
[0077] Figure 8 is a block diagram of another data transmission device according to an exemplary embodiment of the present disclosure;
[0078] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0079] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0080] Figure 1 is a flow chart of a data transmission method according to an exemplary embodiment; the method of this embodiment can be executed by a data transmission device, and the data transmission device can be configured in a first electronic device, such as a server, a workstation, a personal computer, a mobile terminal (such as a mobile phone, a tablet computer, a vehicle terminal, etc.), a wearable device (such as glasses, a watch, etc.), etc. Specifically, Figure 1As shown, the method includes the following steps S101-S103:
[0081] In step S101, in response to establishing a first connection with a second electronic device based on initial connection parameters, it is determined whether the first connection meets a data transmission condition: if so, step S102 is executed; if not, step S103 is executed.
[0082] In step S102, data transmission is performed based on the first connection.
[0083] In step S103, target connection parameters are determined.
[0084] In step S104, a second connection is established with the second electronic device based on the target connection parameters, and data transmission is performed based on the second connection.
[0085] In this embodiment, after the first connection is established with the second electronic device based on the initial connection parameters, it can be determined whether the first connection meets the data transmission condition.
[0086] Among them, the above-mentioned initial connection parameters can be default connection parameters preset in the first electronic device (such as a set of connection parameters adapted according to standard data cables and test equipment at the factory), or a set of connection parameters used when interconnecting with the second electronic device last time.
[0087] For example, the first electronic device can detect whether it has received a first preset message indicating that the connection with the second electronic device is successful. If the first preset message is received, it can be determined that the first connection meets the data transmission conditions. On the contrary, if the first electronic device does not receive the above-mentioned first preset message, such as receiving a second notification message indicating that the connection with the second electronic device fails, it can be determined that the first connection does not meet the data transmission conditions. On this basis, the target connection parameters can be determined based on a preset method, and then a second connection can be established with the second electronic device based on the target connection parameters, and data transmission can be performed based on the second connection.
[0088] The above connection parameters may be connection parameters based on the USB (Universal Serial Bus) protocol, such as connection parameters used by a data cable with an interface type such as type-A, type-B or type-C, which is not limited in this embodiment.
[0089] It is worth noting that the specific content of the above connection parameters can be set based on the actual application scenario, such as setting to at least one of the drive capability parameters, termination impedance matching parameters, TX (Transport) current source, HOST Disconnect (host device disconnect) level, RX (Receive) noise tolerance and other parameters.
[0090] In some embodiments, the above method of determining the target connection parameters may be selected from solutions in related technologies based on actual business needs, which is not limited in this embodiment.
[0091] In some other embodiments, the above method of determining the target connection parameters can also refer to the following Figure 2 , Figure 4 or Figure 5 The illustrated embodiment will not be described in detail here.
[0092] It can be seen from the above description that the method of this embodiment determines whether the first connection meets the data transmission conditions in response to establishing a first connection with the second electronic device based on the initial connection parameters, and determines the target connection parameters in response to the first connection not meeting the data transmission conditions, and then establishes a second connection with the second electronic device based on the target connection parameters, and performs data transmission based on the second connection. Since the target connection parameters are determined when the first connection does not meet the data transmission conditions, automatic adaptation of the connection parameters can be achieved, and the problems such as the inability to interconnect with the second electronic device during data transmission or the interruption of data transmission after interconnection can be effectively avoided, thereby ensuring the smooth progress of data transmission and improving the fluency of the data transmission process.
[0093] Figure 2 It is a flowchart showing how to determine target connection parameters according to an exemplary embodiment of the present disclosure; based on the above embodiment, this embodiment takes how to determine target connection parameters as an example for exemplary description.
[0094] like Figure 2 As shown, the determination of the target connection parameters described in the above step S103 may include the following steps S201-S204:
[0095] In step S201, each set of candidate connection parameters is selected in turn from a plurality of sets of candidate connection parameters in the first set.
[0096] In this embodiment, when determining the target connection parameters, multiple sets of alternative connection parameters of the pre-constructed first set can be obtained, and each set of alternative connection parameters can be selected in turn from the multiple sets of alternative connection parameters. It should be noted that the first set is used to store alternative connection parameters, and the alternative connection parameters can be connection parameters that match commonly used terminal types, for example: the alternative connection parameters include at least one or more of the following: connection parameters corresponding to a terminal device that has a binding relationship with the first electronic device, connection parameters corresponding to a second electronic device that has previously established a connection with the first electronic device, and connection parameters of common electronic devices on the market.
[0097] For example, the types of data cables on the market can be investigated and classified, such as classifying data cables into the first type of adapted data cables, the second type of data cables with larger insertion loss (e.g., data cables with a length of more than 2m), the third type of data cables with larger capacitive loads, and the fourth type of data cables with larger inductive loads. Then, for each type of the above data cables, adapted sets of connection parameters can be debugged based on information such as eye diagrams. Furthermore, the sets of connection parameters corresponding to the above multiple types of data cables can be constructed into multiple sets of alternative connection parameters of the above first set. On this basis, each set of alternative connection parameters can be selected in turn from the multiple sets of alternative connection parameters to perform subsequent steps.
[0098] In step S202, a third connection is established with the second electronic device based on each set of candidate connection parameters.
[0099] In this embodiment, after each set of candidate connection parameters is selected, a connection (named as a "third connection" for easy distinction) may be established with the second electronic device based on each set of candidate connection parameters.
[0100] In step S203, a transmission test is performed based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters.
[0101] In this embodiment, after the third connection is established with the second electronic device based on each set of candidate connection parameters, a transmission test may be performed based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters.
[0102] It is worth noting that the content of the above transmission test can be selected from solutions in related technologies based on actual business needs. As long as it is a test that can detect the data transmission capacity of the currently established third connection, this embodiment does not limit this.
[0103] In other embodiments, the content of the above transmission test can be found in the following Figure 3 The illustrated embodiment will not be described in detail here.
[0104] In step S204, the target connection parameters are determined from the multiple sets of candidate connection parameters based on the transmission test result.
[0105] In this embodiment, after performing a transmission test based on the third connection and obtaining a transmission test result corresponding to each set of candidate connection parameters, the target connection parameters may be determined from the multiple sets of candidate connection parameters based on the transmission test result.
[0106] For example, based on the transmission test result, a set of connection parameters with the best transmission test result may be selected from the multiple sets of candidate connection parameters and used as the target connection parameters.
[0107] From the above description, it can be seen that this embodiment pre-specifies multiple sets of alternative connection parameters to determine the target connection parameters from the pre-specified multiple sets of alternative connection parameters, which can improve the efficiency of determining the target connection parameters, and further improve the efficiency of subsequently establishing a second connection based on the target connection parameters and transmitting data based on the second connection.
[0108] Figure 3 It is a flowchart showing how to obtain the transmission test results corresponding to each set of alternative connection parameters according to an exemplary embodiment of the present disclosure; based on the above embodiment, this embodiment uses how to obtain the transmission test results corresponding to each set of alternative connection parameters as an example to exemplify.
[0109] like Figure 3 As shown, the above step S203 of performing the transmission test based on the third connection to obtain the transmission test results corresponding to each set of candidate connection parameters may include the following steps S301-S303:
[0110] In step S301, a preset number of test messages are sent to the second electronic device based on the third connection;
[0111] In step S302, receiving a reply message returned by the second electronic device based on the received test message;
[0112] In step S303, a packet loss rate is determined based on the preset number and the first number carried in the reply message, and is used as a transmission test result corresponding to each set of candidate connection parameters.
[0113] In this embodiment, when a transmission test is performed based on the third connection and a transmission test result corresponding to each set of alternative connection parameters is obtained, a preset number of test messages can be sent to the second electronic device based on the third connection; after the second electronic device receives the first number of test messages based on the third connection, it can send a reply message to the first electronic device, wherein the reply message can carry the number of test messages received by the second electronic device, that is, the above-mentioned first number; on this basis, after the first electronic device receives the above-mentioned reply message, it can extract the first number from the reply message and compare it with the above-mentioned preset number to obtain the packet loss rate, and then the packet loss rate can be used as the transmission test result corresponding to the currently selected set of connection parameters.
[0114] It can be understood that the lower the packet loss rate, the better the transmission test result corresponding to the corresponding connection parameter, so the target connection parameter can be determined from the multiple sets of candidate connection parameters in the first set based on the packet loss rate.
[0115] From the above description, it can be seen that this embodiment can determine the transmission test results corresponding to each set of alternative connection parameters based on the packet loss rate, and then can subsequently determine the target connection parameters from the multiple sets of alternative connection parameters based on the transmission test results, and can reasonably and accurately determine the target connection parameters, thereby ensuring the smooth progress of subsequent data transmission and the fluency of data transmission.
[0116] Figure 4 It is a flowchart showing how to determine target connection parameters according to another exemplary embodiment of the present disclosure; this embodiment is based on the above embodiment and takes how to determine target connection parameters as an example for exemplary description.
[0117] like Figure 4 As shown, the determination of the target connection parameter from the multiple sets of candidate connection parameters in the above step S204 may include the following steps S401-S406:
[0118] In step S401, each set of candidate connection parameters is selected in turn from multiple sets of candidate connection parameters in the first set;
[0119] In step S402, a third connection is established with the second electronic device based on each set of candidate connection parameters;
[0120] In step S403, a transmission test is performed based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters;
[0121] In step S404, based on the transmission test result, the target connection parameter is determined from the multiple sets of candidate connection parameters;
[0122] The explanation and description of the above steps S401-S404 can be found in the above Figure 2 Steps S201-S204 in the illustrated embodiment are not described in detail here.
[0123] In step S405, in response to the target connection parameter not existing in the plurality of sets of candidate connection parameters, prompt information for prompting to perform a connection parameter adaptation operation is generated.
[0124] In step S406, in response to receiving an operation execution instruction triggered by the prompt information, the connection parameter adaptation operation is performed.
[0125] In this embodiment, after executing step S404, it can be determined whether there are target connection parameters in the multiple sets of candidate connection parameters in the first set (eg, a set of candidate connection parameters whose corresponding first transmission test results meet the set test result requirements).
[0126] For example, the first transmission test result meets the set test result requirement, which may include at least one of the following (a) and (b):
[0127] (a) The value of the first transmission test result reaches a set threshold. Taking packet loss rate as an example, the value of the first transmission test result reaches a set threshold, which may include: the packet loss rate corresponding to the target connection parameter is lower than or equal to the set packet loss rate threshold.
[0128] (b) The ranking of the first transmission test result among multiple transmission test results satisfies a set ranking condition. The multiple transmission test results include transmission test results corresponding to the multiple sets of candidate connection parameters.
[0129] Taking packet loss rate as an example, the ranking of the first transmission test result among multiple transmission test results meets the set ranking conditions, which may include: the packet loss rate corresponding to the target connection parameter ranks lowest among multiple packet loss rates (that is, the packet loss rates corresponding to the above-mentioned multiple sets of alternative connection parameters).
[0130] On this basis, if there are connection parameters that meet the requirements of the above-mentioned set test results, they can be determined as target connection parameters; on the contrary, if there are no connection parameters that meet the requirements of the above-mentioned set test results, prompt information for prompting to perform a connection parameter adaptation operation can be generated. The connection parameter adaptation operation can be used to determine the target connection parameters from multiple sets of candidate connection parameters of the second set (for example, all or part of the connection parameters within a known range in the relevant art) based on a parameter traversal method.
[0131] The form and content of the above prompt information can be set based on the needs of the actual application scenario, such as being set to text form, voice form, etc., which is not limited in this embodiment.
[0132] On this basis, when the user triggers an operation execution instruction for performing a connection parameter adaptation operation based on the above prompt information, the electronic device can perform the connection parameter adaptation operation in response to receiving the instruction, so as to determine the target connection parameter from multiple sets of alternative connection parameters in the second set based on a parameter traversal method.
[0133] It is worth noting that the multiple sets of candidate connection parameters in the second set may be at least partially identical to or completely different from the multiple sets of candidate connection parameters in the first set. In other words, the second set may include at least some of the candidate connection parameters in the first set, or may not include any set of candidate connection parameters in the first set.
[0134] In some embodiments, when the target connection parameters are determined from multiple sets of candidate connection parameters in the second set based on the parameter traversal method, a set of adapted connection parameters can also be selected in combination with packet loss rate detection and other methods. The specific detection method of packet loss rate can refer to the records in the relevant technology or refer to the above Figure 3 The illustrated embodiments are not described in detail here.
[0135] From the above description, it can be seen that this embodiment can determine the target connection parameters based on the set of parameters when the target connection parameters exist, and when the target connection parameters do not exist, prompt the user to trigger the connection parameter adaptation operation to search for an adapted set of connection parameters from a wider range as the target connection parameters, which can ensure the smooth progress of subsequent data transmission and the fluency of data transmission.
[0136] Figure 5 It is a flowchart showing how to determine target connection parameters according to another exemplary embodiment of the present disclosure; this embodiment is based on the above embodiment and takes how to determine the target connection parameters as an example for exemplary description.
[0137] like Figure 5 As shown, the determination of the target connection parameters described in the above step S103 may include the following steps S501-S502:
[0138] In step S501, prompt information for prompting to perform a connection parameter adaptation operation is generated.
[0139] In step S502, in response to receiving an operation execution instruction triggered by the prompt information, the connection parameter adaptation operation is performed.
[0140] In this embodiment, when it is detected that the first connection does not meet the data transmission condition and the target connection parameters need to be determined, prompt information for prompting to perform a connection parameter adaptation operation can be generated. The connection parameter adaptation operation can be used to determine the target connection parameters from multiple sets of candidate connection parameters in the second set (for example, all or part of the connection parameters within a known range in the related art) based on a parameter traversal method.
[0141] The form and content of the above prompt information can be set based on the needs of the actual application scenario, such as being set to text form, voice form, etc., which is not limited in this embodiment.
[0142] On this basis, when the user triggers an operation execution instruction for performing a connection parameter adaptation operation based on the above prompt information, the electronic device can perform the connection parameter adaptation operation in response to receiving the instruction, so as to determine the target connection parameter from multiple sets of alternative connection parameters in the second set based on a parameter traversal method.
[0143] In some embodiments, when the target connection parameters are determined from multiple sets of candidate connection parameters in the second set based on the parameter traversal method, a set of adapted connection parameters can also be selected in combination with packet loss rate detection and other methods. The specific detection method of packet loss rate can refer to the records in the relevant technology or refer to the above Figure 3 The illustrated embodiments are not described in detail here.
[0144] From the above description, it can be seen that this embodiment can prompt the user to trigger a connection parameter adaptation operation when it is detected that the first connection does not meet the data transmission conditions and the target connection parameters need to be determined, so as to search for an adapted set of connection parameters from a wider range as the target connection parameters, thereby ensuring the smooth progress of subsequent data transmission and the fluency of data transmission.
[0145] Figure 6 It is a flowchart showing how to save the target connection parameters according to an exemplary embodiment of the present disclosure; based on the above embodiment, this embodiment takes how to save the target connection parameters as an example to exemplify.
[0146] like Figure 6 As shown, the data transmission method of this embodiment may further include saving the target connection parameters based on the following steps S601-S602:
[0147] In step S601, in response to the instruction to save the target connection parameter, a correspondence relationship between the target connection parameter and the device information of the second electronic device is created;
[0148] In step S602, based on the corresponding relationship, the target connection parameter is stored in at least one of the first electronic device, the second device and the server.
[0149] In this embodiment, based on Figure 4 or Figure 5 After the connection parameter adaptation operation in the illustrated embodiment determines the target connection parameters, the target connection parameters can be saved. For example, an interface for triggering a save instruction can be provided in the user interface. Then, when the user triggers the save instruction for the target connection parameters, the electronic device can, in response to receiving the instruction, create a correspondence (such as a correspondence table, key-value pairs, etc.) between the target connection parameters and the device information of the second electronic device (such as a device model and / or device identification information, etc.). Then, based on the correspondence, the target connection parameters can be stored locally on the first electronic device (for example, the target connection parameters can be stored separately in a preset storage location locally on the first electronic device, and / or the target connection parameters can be stored in a preset first set, so that each set of alternative connection parameters can be selected in turn from the first set to attempt to connect to the second device), locally on the second electronic device, and at least one of the server side, for query and use by other users of the platform.
[0150] In this way, when the first electronic device (or other electronic devices on the platform) is subsequently connected to the second electronic device (or a device with the same device information as the second electronic device), it can directly use the locally stored connection parameters (or the connection parameters obtained from the server) for interconnection, thereby avoiding the repeated execution of the above-mentioned connection parameter adaptation operation process, thereby achieving the purpose of improving the efficiency of data transmission.
[0151] Figure 7 is a block diagram of a data transmission device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be executed by a data transmission device, and the data transmission device can be configured in a first electronic device, such as a server, a workstation, a personal computer, a mobile terminal (such as a mobile phone, a tablet computer, a vehicle terminal, etc.), a wearable device (such as glasses, watches, etc.), etc. Specifically, Figure 7 As shown, the device includes: a connection determination module 110, a parameter determination module 120 and a data transmission module 130, wherein:
[0152] A connection determination module 110, configured to determine whether a first connection satisfies a data transmission condition in response to establishing a first connection with a second electronic device based on an initial connection parameter;
[0153] a parameter determination module 120, configured to determine a target connection parameter in response to the first connection not satisfying the data transmission condition;
[0154] The data transmission module 130 is configured to establish a second connection with the second electronic device based on the target connection parameters, and perform data transmission based on the second connection.
[0155] From the above description, it can be seen that the device of this embodiment determines whether the first connection meets the data transmission conditions in response to establishing a first connection with the second electronic device based on the initial connection parameters, and determines the target connection parameters in response to the first connection not meeting the data transmission conditions, and then establishes a second connection with the second electronic device based on the target connection parameters, and performs data transmission based on the second connection. Since the target connection parameters are determined when the first connection does not meet the data transmission conditions, automatic adaptation of the connection parameters can be achieved, and the problems such as the inability to interconnect with the second electronic device during data transmission or the interruption of data transmission after interconnection can be effectively avoided, thereby ensuring the smooth progress of data transmission and improving the fluency of the data transmission process.
[0156] Figure 8 It is a block diagram of another data transmission device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be executed by a data transmission device, and the data transmission device can be configured in a first electronic device, such as a server, a workstation, a personal computer, a mobile terminal (such as a mobile phone, a tablet computer, a car terminal, etc.), a wearable device (such as glasses, watches, etc.), etc.
[0157] The connection determination module 210, the parameter determination module 220 and the data transmission module 230 are the same as those described above. Figure 7 The functions of the connection determination module 110, the parameter determination module 120 and the data transmission module 130 in the illustrated embodiment are the same and will not be described in detail herein.
[0158] Specifically, Figure 8 As shown, the connection determination module 210 can also be used to determine that the first connection meets the data transmission condition in response to receiving a first preset message, and the first preset message is used to indicate that the connection with the second electronic device is successful.
[0159] In some embodiments, the parameter determination module 220 includes a first determination unit 221;
[0160] The first determining unit 221 may be configured to:
[0161] Selecting each set of candidate connection parameters in turn from the first set of multiple sets of candidate connection parameters;
[0162] establishing a third connection with the second electronic device based on each set of candidate connection parameters;
[0163] Performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters;
[0164] Based on the transmission test result, the target connection parameter is determined from the multiple sets of candidate connection parameters.
[0165] In some embodiments, the first determining unit 221 may also be used to:
[0166] Sending a preset number of test messages to the second electronic device based on the third connection;
[0167] receiving a reply message returned by the second electronic device based on the received test message;
[0168] The packet loss rate is determined based on the preset number and a first number carried in the reply message, and is used as a transmission test result corresponding to each set of alternative connection parameters, wherein the first number is used to characterize the number of test messages received by the second electronic device.
[0169] In some embodiments, the first determining unit 221 may also be used to:
[0170] In response to the target connection parameter not existing in the multiple sets of candidate connection parameters, generating prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from the multiple sets of candidate connection parameters in the second set based on a parameter traversal manner;
[0171] In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
[0172] In some embodiments, the parameter determination module 220 may include a second determination unit 222;
[0173] The second determining unit 222 is used for:
[0174] Generate prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from a plurality of sets of candidate connection parameters in the second set based on a parameter traversal method;
[0175] In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
[0176] In some embodiments, the above apparatus may further include a parameter saving module 240;
[0177] The parameter storage module 240 may include:
[0178] a relationship creating unit 241, configured to create a corresponding relationship between the target connection parameter and the device information of the second electronic device in response to a save instruction of the target connection parameter;
[0179] The parameter storage unit 242 is used to store the target connection parameter in at least one of the first electronic device, the second device and the server based on the corresponding relationship.
[0180] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0181] Fig. 9 900 is a block diagram of an electronic device according to an exemplary embodiment. For example, the device 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0182] Reference Fig. 9 , device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0183] The processing component 902 generally controls the overall operation of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0184] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0185] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.
[0186] The multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display panel and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0187] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
[0188] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0189] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display panel and keypad of the device 900, and the sensor assembly 914 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 914 can also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0190] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0191] In an exemplary embodiment, the device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0192] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by the processor 920 of the device 900 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0193] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0194] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: In response to establishing a first connection with a second electronic device based on the initial connection parameters, determining whether the first connection satisfies a data transmission condition; In response to the first connection not satisfying the data transmission condition, determining a target connection parameter; A second connection is established with the second electronic device based on the target connection parameters, and data is transmitted based on the second connection.
2. The method according to claim 1, characterized in that The determining whether the first connection meets the data transmission condition includes: In response to receiving a first preset message, it is determined that the first connection meets the data transmission condition, and the first preset message is used to indicate that the connection with the second electronic device is successful.
3. The method according to claim 1, characterized in that The determining of the target connection parameters includes: Selecting each set of candidate connection parameters in turn from the first set of multiple sets of candidate connection parameters; establishing a third connection with the second electronic device based on each set of candidate connection parameters; Performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters; Based on the transmission test result, the target connection parameter is determined from the multiple sets of candidate connection parameters.
4. The method according to claim 3, characterized in that The performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters includes: Sending a preset number of test messages to the second electronic device based on the third connection; receiving a reply message returned by the second electronic device based on the received test message; The packet loss rate is determined based on the preset number and a first number carried in the reply message and used as a transmission test result corresponding to each set of alternative connection parameters, wherein the first number is used to characterize the number of test messages received by the second electronic device.
5. The method according to claim 3, characterized in that: The method further comprises: In response to the target connection parameter not existing in the plurality of sets of candidate connection parameters of the first set, generating prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from the plurality of sets of candidate connection parameters of the second set based on a parameter traversal manner; In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
6. The method according to claim 1, characterized in that The determining of the target connection parameters includes: Generate prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from a plurality of sets of candidate connection parameters in the second set based on a parameter traversal method; In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
7. The method according to claim 5 or 6, characterized in that: The method further comprises: In response to the instruction to save the target connection parameter, creating a correspondence between the target connection parameter and the device information of the second electronic device; Based on the corresponding relationship, the target connection parameter is stored in at least one of the first electronic device, the second device and the server.
8. A data transmission device, characterized in that: Applied to a first electronic device, the device comprises: a connection determination module, configured to determine whether a first connection satisfies a data transmission condition in response to establishing a first connection with a second electronic device based on an initial connection parameter; a parameter determination module, configured to determine a target connection parameter in response to the first connection not satisfying the data transmission condition; A data transmission module is used to establish a second connection with the second electronic device based on the target connection parameters, and perform data transmission based on the second connection.
9. The device according to claim 8, characterized in that The connection determination module is further used to determine that the first connection meets the data transmission condition in response to receiving a first preset message, where the first preset message is used to indicate that the connection with the second electronic device is successful.
10. The device according to claim 8, characterized in that The parameter determination module includes a first determination unit; The first determining unit is used for: Selecting each set of candidate connection parameters in turn from the first set of multiple sets of candidate connection parameters; establishing a third connection with the second electronic device based on each set of candidate connection parameters; Performing a transmission test based on the third connection to obtain a transmission test result corresponding to each set of candidate connection parameters; Based on the transmission test result, the target connection parameter is determined from the multiple sets of candidate connection parameters.
11. The device according to claim 10, characterized in that The first determining unit is further configured to: Sending a preset number of test messages to the second electronic device based on the third connection; receiving a reply message returned by the second electronic device based on the received test message; The packet loss rate is determined based on the preset number and a first number carried in the reply message and used as a transmission test result corresponding to each set of alternative connection parameters, wherein the first number is used to characterize the number of test messages received by the second electronic device.
12. The device according to claim 10, characterized in that The first determining unit is used for: In response to the target connection parameter not existing in the multiple sets of candidate connection parameters, generating prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from the multiple sets of candidate connection parameters in the second set based on a parameter traversal manner; In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
13. The device according to claim 8, characterized in that The parameter determination module includes a second determination unit; The second determining unit is used for: Generate prompt information for prompting to perform a connection parameter adaptation operation, wherein the connection parameter adaptation operation is used to determine the target connection parameter from a plurality of sets of candidate connection parameters in the second set based on a parameter traversal method; In response to receiving an operation execution instruction triggered based on the prompt information, the connection parameter adaptation operation is performed.
14. The device according to claim 12 or 13, characterized in that The device also includes a parameter storage module; The parameter saving module comprises: a relationship creating unit, configured to create a corresponding relationship between the target connection parameter and the device information of the second electronic device in response to a save instruction of the target connection parameter; A parameter storage unit is used to store the target connection parameter in at least one of the first electronic device, the second device and the server based on the corresponding relationship.
15. An electronic device, characterized in that: The device comprises: a processor and a memory for storing a computer program; Wherein, the processor is configured to implement, when executing the computer program: In response to establishing a first connection with a second electronic device based on the initial connection parameters, determining whether the first connection satisfies a data transmission condition; In response to the first connection not satisfying the data transmission condition, determining a target connection parameter; A second connection is established with the second electronic device based on the target connection parameters, and data is transmitted based on the second connection.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it realizes: In response to establishing a first connection with a second electronic device based on the initial connection parameters, determining whether the first connection satisfies a data transmission condition; In response to the first connection not satisfying the data transmission condition, determining a target connection parameter; A second connection is established with the second electronic device based on the target connection parameters, and data is transmitted based on the second connection.
Citation Information
Patent Citations
Testing device and testing method of USB interface
CN106649015A
A parameter adjustment method and communication equipment
CN109921959A
Port configuration management method and device, storage medium and terminal
CN111262737A
USB signal testing method
CN115964241A
Method And System For Determining Characteristics Of An Attached Ethernet Connector And / Or Cable
US20110219147A1
