Communication connection method and device, equipment and medium
By obtaining the actual location of the first electronic device and the historical communication parameters of the associated electronic device, and directly establishing a communication connection with the second electronic device, the problem of low USB connection efficiency is solved and a faster communication connection is achieved.
Patent Information
- Application Number
- CN202411793727.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-01
AI Technical Summary
The existing USB connection method has the problem of low connection efficiency, resulting in slow communication connection speed.
By obtaining the actual position where the first electronic device is located and determining the historical communication parameters of the associated electronic device associated with the position, the communication connection is established with the second electronic device using these parameters.
The efficiency of communication connection is improved, the possibility of connection success is enhanced, and the number of times communication parameters is adjusted is reduced, thereby accelerating the communication connection process.
Smart Images

Figure CN119739668A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a communication connection method, device, equipment and medium. Background Art
[0002] The universal serial bus (USB) interface is an interface for communication between different electronic devices, and is used for data transmission and charging between electronic devices. With the continuous development of USB technology, various versions of electronic devices and interface standards continue to emerge, and the compatibility problem of USB connection is becoming increasingly prominent.
[0003] At present, in order to solve the compatibility problem of USB connection, usually when two electronic devices are connected through the USB interface, the communication parameters are continuously adjusted until the communication connection is successful. However, the current communication connection method has the problem of low connection efficiency. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a communication connection method, device, equipment, medium and product, which can solve the problems of slow communication connection speed and low connection efficiency.
[0005] In a first aspect, an embodiment of the present application provides a communication connection method, which is applied to a first electronic device, wherein the first electronic device includes a universal serial bus USB interface, and the method includes:
[0006] Acquire the actual location of the first electronic device;
[0007] When it is determined that there is at least one associated electronic device associated with the actual location and a second electronic device is inserted into the USB interface of the first electronic device, obtaining historical communication parameters of the associated electronic device; the historical communication parameters are communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before;
[0008] A communication connection is established with the second electronic device according to the historical communication parameters.
[0009] In a second aspect, an embodiment of the present application provides a communication connection device, which is applied to a first electronic device, wherein the first electronic device includes a universal serial bus USB interface, and the device includes:
[0010] An acquisition module, used to acquire the actual location of the first electronic device;
[0011] The acquisition module is further configured to acquire historical communication parameters of the associated electronic device when it is determined that there is at least one associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device; the historical communication parameters are communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before;
[0012] A connection module is used to establish a communication connection with the second electronic device according to the historical communication parameters.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0017] In the embodiment of the present application, when the second electronic device is connected to the first electronic device via the USB interface, it is not necessary to try to connect the communication by constantly adjusting the communication parameters, but first obtain the actual location of the first electronic device, then obtain the associated electronic device associated with the actual location, and establish a communication connection with the second electronic device according to the historical communication parameters of the associated electronic device. Since the historical communication parameters are the communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before, the success rate of establishing a communication connection with the second electronic device according to the historical communication parameters is high, thereby improving the efficiency of the communication connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of the first communication connection method provided in an embodiment of the present application;
[0019] Figure 2 It is a flowchart of a second communication connection method provided in an embodiment of the present application;
[0020] Figure 3 It is a flowchart of a third communication connection method provided in an embodiment of the present application;
[0021] Figure 4 It is a flowchart of a fourth communication connection method provided in an embodiment of the present application;
[0022] Figure 5 It is a structural schematic diagram of a communication connection device provided in an embodiment of the present application;
[0023] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0024] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0027] In order to solve the problems of the prior art, the embodiments of the present application provide a communication connection method, device, electronic device, readable storage medium and computer program product. Among them, the communication connection method can be applied to the scenario where different electronic devices are connected for communication through a USB interface. The execution subject of the communication connection method can be a first electronic device, and the first electronic device includes a USB interface. The first electronic device can be a terminal or other device other than a terminal. Exemplarily, the first electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car-mounted electronic device, a mobile Internet device, an augmented reality / virtual reality device, a robot, a wearable device, a super mobile personal computer, a netbook or a personal digital assistant, etc., and can also be a personal computer, a television, a teller machine or a self-service machine, etc., which is not specifically limited in the embodiments of the present application.
[0028] The communication connection provided by the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0029] Figure 1 FIG. 1 is a flow chart of a communication connection method provided in an embodiment of the present application. Figure 1 As shown, the communication connection method provided in the embodiment of the present application includes the following steps S110-S130, and each step is explained in detail below.
[0030] S110: Acquire the actual location of the first electronic device.
[0031] The actual location may be an actual geographical location. The actual geographical location of the first electronic device may be a point or an area, which is not limited here.
[0032] In order to ensure the accuracy of the actual position, in some embodiments, the above S110 may specifically include at least one of the following:
[0033] The actual location of the first electronic device is obtained through a positioning module of the first electronic device.
[0034] Acquire the actual location of the first electronic device through a WIFI signal connected to the first electronic device;
[0035] Acquire the actual location of the first electronic device through a Bluetooth signal connected to the first electronic device;
[0036] The actual location of the first electronic device is obtained through the near field communication module NFC of the first electronic device.
[0037] Here, the first electronic device may be equipped with a positioning module. The positioning module may be implemented based on the global positioning system (GPS) positioning technology, Beidou satellite positioning technology, base station positioning technology, etc. The positioning module may be applicable to indoor scenes and outdoor scenes.
[0038] In addition, the first electronic device may contain a globally unique Media Access Control Address (MAC). Therefore, the MAC address of the first electronic device can be obtained through the WIFI signal connected to the first electronic device, and the actual location of the first electronic device can be calculated based on the MAC address. WIFI positioning can be applied to indoor scenes such as offices, homes, and vehicles where WIFI signals exist.
[0039] In addition, a Bluetooth module may be installed in the first electronic device. The Bluetooth signal broadcast by the Bluetooth module can have geographic fencing and indoor positioning functions. Because of its low cost, low power consumption, long working time and easy deployment, the Bluetooth module is currently mainly used for indoor positioning and has broad application prospects. Moreover, in indoor scenarios, Bluetooth positioning has higher accuracy and faster speed. For example, when the first electronic device is a vehicle device with an NFC car key or an electronic device for a home with a smart door lock, Bluetooth positioning can be used to obtain the actual location of the first electronic device.
[0040] In addition, a near field communication (NFC) module may be installed in the first electronic device, and NFC positioning may be applied to indoor positioning. For example, when the first electronic device is a vehicle device with an NFC car key or an electronic device for a home with a smart door lock, NFC positioning may be used to obtain the actual location of the first electronic device.
[0041] The embodiment of the present application can use a positioning technology that matches the scenario in different scenarios to obtain the actual location of the first electronic device, thereby ensuring the accuracy of the actual location.
[0042] S120, when it is determined that there is at least one associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device, obtain historical communication parameters of the associated electronic device; the historical communication parameters are communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device. The first electronic device may include the first electronic device or may not include the first electronic device.
[0043] The above-mentioned actual location may or may not have an associated electronic device. The associated electronic device may be a USB device that is inserted into the first electronic device through a USB interface at the above-mentioned actual location and successfully establishes a communication connection with the first electronic device. The associated electronic device may include a mouse, a keyboard, a camera, an external storage device, a charger, a docking station, a mobile phone, a computer, etc.
[0044] For example, if the first electronic device is a computer, at the above-mentioned actual position, the mouse is plugged into the computer through the USB interface and successfully establishes a communication connection with the computer, then the mouse can be an associated electronic device associated with the actual position.
[0045] In addition, communication parameters may be key factors in evaluating and configuring the communication system. Communication parameters may include at least one of the following: signal transmission rate, signal amplitude, signal driving capability, verification version, protocol version. The historical communication parameters of the associated electronic device may be communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device.
[0046] Continuing with the above example, if the mouse successfully establishes a communication connection with the computer, the communication parameters when the mouse successfully establishes a communication connection with the computer may be the historical communication parameters of the mouse.
[0047] As an example, when the first electronic device is at the actual location, it can first determine whether there are associated electronic devices associated with the actual location. When there are one or more associated electronic devices, the historical communication parameters of the one or more associated electronic devices can be called.
[0048] In addition, the second electronic device may be the same as or different from the first electronic device, which is not limited here. For example, by inserting mobile phone A into the USB port of mobile phone B, a communication connection between the two mobile phones can be established for charging or data transmission. In addition, the second electronic device may be the same as or different from the associated electronic device.
[0049] S130: Establish a communication connection with a second electronic device according to the historical communication parameters.
[0050] Here, if there is an associated electronic device, no matter whether the associated electronic device is the same as the second electronic device, a communication connection can be established with the second electronic device according to the historical communication parameters of the associated electronic device.
[0051] If there are multiple associated electronic devices, and the second electronic device is the same as a certain associated electronic device, a communication connection can be established with the second electronic device according to the historical communication parameter of the associated electronic device. If there are multiple associated electronic devices and the second electronic device is different from the multiple associated electronic devices, a communication connection can be established with the second electronic device according to one of the historical communication parameters.
[0052] Based on this, when there are multiple associated electronic devices, and the second electronic device is different from the multiple associated electronic devices, in order to improve the communication quality between the first electronic device and the second electronic device, in some embodiments, the above S130 may further specifically include:
[0053] Establishing a communication connection with a second electronic device using each historical communication parameter in turn;
[0054] When the communication connection is successful, obtaining the quality of the communication signal with the second electronic device;
[0055] Determining a historical communication parameter in which the communication signal quality meets a preset condition as a target communication parameter for establishing a communication connection with a second electronic device;
[0056] A communication connection is established with the second electronic device according to the target communication parameter.
[0057] Here, when there are multiple historical communication parameters, a communication connection can be established with the second electronic device by randomly using each historical communication parameter in sequence, or by using each historical communication parameter in sequence according to a preset order. The preset order can be determined according to the order in which the associated electronic device is associated with the actual location, or according to the number of times the associated electronic device establishes a communication connection with the first electronic device at the actual location.
[0058] If the preset order is determined based on the number of times the associated electronic device establishes a communication connection with the first electronic device at the actual location, the more times the associated electronic device establishes a communication connection with the first electronic device at the actual location, the earlier the order of establishing a communication connection with the second electronic device according to the historical communication parameters of the associated electronic device can be. Since the more times the associated electronic device establishes a communication connection with the first electronic device at the actual location, the greater the possibility of successfully establishing a communication connection with the second electronic device according to the historical communication parameters of the associated electronic device, therefore, by determining the preset order based on the number of times the associated electronic device establishes a communication connection with the first electronic device at the actual location, and establishing a communication connection with the second electronic device according to each historical communication parameter in sequence according to the preset order, the communication connection efficiency can be further improved.
[0059] Establishing a communication connection with the second electronic device according to the historical communication parameters may succeed or fail. If the communication connection fails, the communication connection with the second electronic device may continue to be established according to the next historical communication parameter until the communication connection succeeds. In the case of a successful communication connection, data exchange may be performed directly to improve communication efficiency.
[0060] In addition, the communication signal quality meeting the preset condition may be that a value corresponding to the communication signal quality is greater than a first preset threshold.
[0061] As an example, in order to improve the communication quality, when the communication connection is successful, the communication signal quality of the communication with the second electronic device can also be obtained, and the value corresponding to the communication signal quality can be compared with the first preset threshold. If the value corresponding to the communication signal quality is greater than the first preset threshold, the historical communication parameter corresponding to the communication signal quality can be determined as the target communication parameter, and a communication connection can be established with the second electronic device according to the target communication parameter. If the value corresponding to the communication signal quality is less than or equal to the first preset threshold, the communication connection can continue to be established with the second electronic device according to the next historical communication parameter until the communication connection is successful and the value corresponding to the communication signal quality is greater than the first preset threshold.
[0062] In addition, the communication signal quality meeting the preset condition may be that a certain communication signal quality is the best quality among multiple communication signal qualities.
[0063] As an example, in order to improve communication quality, if a communication connection can be successfully established with a second electronic device based on multiple historical communication parameters, the communication signal qualities corresponding to the multiple historical communication parameters can be obtained, and the historical communication parameters whose communication signal qualities meet preset conditions are determined as target communication parameters for establishing a communication connection with the second electronic device, and finally a communication connection is established with the second electronic device based on the target communication parameters.
[0064] The embodiment of the present application can improve the communication quality between the first electronic device and the second electronic device by establishing a communication connection with the second electronic device according to the target communication parameters.
[0065] In the embodiment of the present application, when the second electronic device is connected to the first electronic device via the USB interface, it is not necessary to try to connect the communication by constantly adjusting the communication parameters, but first obtain the actual location of the first electronic device, then obtain the associated electronic device associated with the actual location, and establish a communication connection with the second electronic device according to the historical communication parameters of the associated electronic device. Since the historical communication parameters are the communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before, the success rate of establishing a communication connection with the second electronic device according to the historical communication parameters is high, thereby improving the efficiency of the communication connection.
[0066] In addition, in order to ensure that the second electronic device can successfully establish a communication connection with the first electronic device, such as Figure 2 As shown, in some embodiments, the communication connection method may further include the following steps:
[0067] S21, obtaining the actual location of the first electronic device;
[0068] S22: if it is determined that there is no associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device, obtain a reference communication parameter;
[0069] S23, establishing a communication connection with a second electronic device according to the reference communication parameters;
[0070] S24. In case of a communication connection failure, adjusting the reference communication parameters to obtain adjusted communication parameters;
[0071] S25. Establish a communication connection with the second electronic device according to the adjusted communication parameters.
[0072] Here, the reference communication parameter may be a default communication parameter for establishing a communication connection with the second electronic device. If the communication connection with the second electronic device fails using the reference communication parameter, the reference communication parameter may be continuously adjusted until the communication connection is successful. After the communication connection is successful, the first electronic device and the second electronic device may exchange data.
[0073] As an example, the method of adjusting the reference communication parameters may include an enumeration method and a training method. Among them, the enumeration method may be to adjust the communication parameters one by one in a pre-set order until the communication connection is successful. The training method may be to gradually adjust the signal driving capability of the USB data until the communication connection is successful. The training method may, for example, be: in the order of signal transmission rate from high to low, at each signal transmission rate, adjust the communication parameters such as signal amplitude, signal driving capability, verification version, protocol version, etc. until the communication connection is successful.
[0074] The embodiment of the present application can ensure that the second electronic device and the first electronic device successfully establish a communication connection by continuously adjusting the baseline communication parameters until the communication connection is successful when it is determined that there is no associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device.
[0075] In addition, after the second electronic device and the first electronic device successfully establish a communication connection, an association relationship between the actual location and the second electronic device may be established, and the second electronic device may be used as an associated electronic device of the actual location.
[0076] Based on this, in order to ensure the validity of the historical communication parameters of the associated electronic devices and improve the communication connection efficiency, such as Figure 3 As shown, in some embodiments, the communication connection method may further include the following steps:
[0077] S31, obtaining the actual location of the first electronic device;
[0078] S32: if it is determined that there is no associated electronic device associated with the actual location and the third electronic device is inserted into the USB interface of the first electronic device, obtain an electronic device identification of the third electronic device;
[0079] S33, accumulating the number of times the third electronic device establishes a communication connection with the first electronic device at the actual location according to the electronic device identifier;
[0080] S34: When the number of connections reaches a preset threshold, determine the third electronic device as an associated electronic device.
[0081] Here, the third electronic device and the second electronic device may be the same or different. The third electronic device and the first electronic device may be the same or different. In addition, the electronic device identifier may uniquely identify the electronic device. In addition, the preset threshold may be, for example, 4.
[0082] As an example, when the third electronic device successfully establishes a communication connection with the first electronic device at the actual location, the number of successful communication connections, the communication parameters when the communication connection is successful, and the communication signal quality when the communication connection is successful can be recorded.
[0083] Based on this, illustratively, at the above-mentioned actual location, when the third electronic device is inserted into the USB interface of the first electronic device, the electronic device identification of the third electronic device can be obtained first, and then the number of successful connection of the electronic device identification with the first electronic device at the above-mentioned actual location is obtained. If the number of successful connections reaches a preset threshold, an association relationship between the actual location and the third electronic device can be established, that is, the third electronic device is determined as an associated electronic device of the actual location.
[0084] The embodiment of the present application can ensure the validity of the historical communication parameters of the associated electronic device and improve the communication connection efficiency by establishing an association relationship between the actual location and the third electronic device when the number of connections reaches a preset threshold.
[0085] In addition, in order to ensure the communication quality between subsequent electronic devices, in some embodiments, after establishing the association relationship between the actual location and the third electronic device, multiple communication parameters and their corresponding communication signal qualities when the third electronic device successfully connects to the first electronic device at the actual location can also be obtained. The communication parameter corresponding to the best communication signal quality among the multiple communication signal qualities is determined as the historical communication parameter of the third electronic device.
[0086] Based on this, in some embodiments, after determining the third electronic device as an associated electronic device, the method may further include:
[0087] When it is detected that the third electronic device is plugged into the USB interface of the first electronic device, acquiring historical communication parameters when the third electronic device establishes a communication connection with the first electronic device at the actual location;
[0088] A communication connection is established with the third electronic device according to the historical communication parameters.
[0089] In order to better describe the entire solution, some specific examples are given based on the above embodiments.
[0090] For example, Figure 4 As shown, the communication connection method provided in the embodiment of the present application may include the following steps:
[0091] S41, obtaining the actual location of the first electronic device;
[0092] S42, determining whether there is at least one associated electronic device associated with the actual location; if so, executing S43; if not, executing S49;
[0093] S43, obtaining and running historical communication parameters of at least one associated electronic device;
[0094] S44, detecting whether a second electronic device is plugged into the first electronic device; if so, executing S45; if not, executing S43;
[0095] S45, establishing a communication connection with a second electronic device according to the historical communication parameters;
[0096] S46, determine whether the connection is successful; if so, execute S47; if not, execute S410;
[0097] S47, performing data exchange;
[0098] S48, disconnecting the communication connection between the first electronic device and the second electronic device;
[0099] S49, detecting whether a third electronic device is plugged into the first electronic device; if so, executing S410; if not, executing S41;
[0100] S410, marking the actual position;
[0101] S411, obtaining an electronic device identification of a third electronic device; thereafter, on the one hand, executing S412, on the other hand, executing S413;
[0102] S412, establishing a communication connection between the first electronic device and the third electronic device; then, executing S47;
[0103] S413, according to the electronic device identifier, obtaining the number of times At1 that the third electronic device has established a communication connection with the first electronic device at the actual location, where At1=n+1, n represents the cumulative number of times that the third electronic device has established a communication connection with the first electronic device at the actual location, and 1 represents the number of times that the third electronic device has established a communication connection with the first electronic device at the actual location this time;
[0104] S414, determine whether At1 reaches a preset threshold, if yes, execute S415, if no, execute S411;
[0105] S415: determining the third electronic device as an associated electronic device of the actual location;
[0106] S416: Determine historical communication parameters of the associated electronic device.
[0107] In an embodiment of the present application, when a user arrives at a new location, such as the actual location of the first electronic device, it can be first determined whether there is already at least one associated electronic device at this location. If so, the historical communication parameters corresponding to at least one associated electronic device can be directly called. In the case of detecting that an electronic device is plugged into the USB interface of the first electronic device, if there are multiple associated electronic devices, a communication connection can be established with the electronic device in turn through each historical communication parameter in a preset order until the connection is successful and data exchange is performed.
[0108] In addition, for the scenario where there is no electronic device associated with the above location, the electronic device can be associated with the above location in two steps, and then the best communication parameter is selected as the historical communication parameter from the communication parameters when the electronic device and the first electronic device are successfully connected at the location. The best communication parameter can be the communication parameter with the highest communication signal quality.
[0109] Specifically, establishing the association between the electronic device and the above-mentioned location may include the following steps.
[0110] On the one hand, the electronic device and the first electronic device adjust communication parameters by enumeration or training to establish a communication connection between the two electronic devices.
[0111] On the other hand, the above-mentioned location is marked as A, the electronic device identifier of the electronic device is marked as A1, and the number of times A1 establishes a communication connection with the first electronic device at A is recorded At1. Including this connection, if At1+1 reaches a preset threshold, an association between A1 and A can be established.
[0112] Afterwards, if the electronic device establishes a communication connection with the first electronic device at location A again, the historical communication parameters can be used directly without enumeration or training again.
[0113] In addition, if a new device is connected to location A, it can be marked as A2, and the above steps are repeated to establish an association with location A and obtain historical communication parameters.
[0114] In this way, when the user brings the first electronic device to location A, the first electronic device can directly obtain historical communication parameters for communication connection, thereby improving communication connection efficiency and USB rate.
[0115] In this way, the embodiment of the present application optimizes the solution for obtaining communication parameters during communication connection and improves the efficiency of communication connection.
[0116] In the communication connection method provided in the embodiment of the present application, the execution subject may be a communication connection device. In the embodiment of the present application, the method for executing the communication connection by the communication connection device is taken as an example to illustrate the communication connection device provided in the embodiment of the present application. Among them, the communication connection device can be applied to a first electronic device. The first electronic device may include a USB interface.
[0117] Figure 5 FIG. 1 shows a schematic diagram of the structure of a communication connection device provided in an embodiment of the present application. Figure 5 As shown, the communication connection device 500 provided in the embodiment of the present application may include:
[0118] An acquisition module 510 is used to acquire an actual location of the first electronic device;
[0119] The acquisition module 510 is further configured to acquire historical communication parameters of the associated electronic device when it is determined that there is at least one associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device; the historical communication parameters are communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before;
[0120] The connection module 520 is used to establish a communication connection with the second electronic device according to the historical communication parameters.
[0121] The communication connection device 500 is described in detail below, as shown below:
[0122] In some embodiments, there are multiple associated electronic devices. Based on this, the connection module 520 includes:
[0123] A connection submodule, used to establish a communication connection with a second electronic device through each historical communication parameter in turn;
[0124] An acquisition submodule, used to acquire the quality of the communication signal with the second electronic device when the communication connection is successful;
[0125] A determination submodule, configured to determine a historical communication parameter whose communication signal quality satisfies a preset condition as a target communication parameter for establishing a communication connection with a second electronic device;
[0126] The connection submodule is further used to establish a communication connection with the second electronic device according to the target communication parameters.
[0127] In some of the embodiments, the acquisition module 510 is further configured to acquire the reference communication parameter when it is determined that there is no associated electronic device associated with the actual location and the second electronic device is plugged into the USB interface of the first electronic device;
[0128] The connection module 520 is further configured to establish a communication connection with the second electronic device according to the reference communication parameters;
[0129] The communication connection device 500 further includes:
[0130] An adjustment module, used for adjusting the reference communication parameters to obtain adjusted communication parameters in case of a communication connection failure;
[0131] The connection module 520 is further configured to establish a communication connection with the second electronic device according to the adjusted communication parameters.
[0132] In some of the embodiments, the acquisition module 510 is further configured to acquire an electronic device identification of a third electronic device when it is determined that there is no associated electronic device associated with the actual location and the third electronic device is plugged into the USB interface of the first electronic device;
[0133] The communication connection device 500 further includes:
[0134] A calculation module, configured to accumulate the number of times the third electronic device establishes a communication connection with the first electronic device at the actual location according to the electronic device identifier;
[0135] The determination module is further configured to determine the third electronic device as an associated electronic device when the number of connections reaches a preset threshold.
[0136] In the embodiment of the present application, when the second electronic device is connected to the first electronic device via the USB interface, it is not necessary to try to connect the communication by constantly adjusting the communication parameters, but first obtain the actual location of the first electronic device, then obtain the associated electronic device associated with the actual location, and establish a communication connection with the second electronic device according to the historical communication parameters of the associated electronic device. Since the historical communication parameters are the communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before, the success rate of establishing a communication connection with the second electronic device according to the historical communication parameters is high, thereby improving the efficiency of the communication connection.
[0137] The communication connection device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application. Among them, the electronic device can specifically be a first electronic device.
[0138] The communication connection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0139] The communication connection device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0140] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores programs or instructions that can be executed on the processor 601, and when the program or instructions are executed by the processor 601, the various steps of the above-mentioned communication connection method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
[0141] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0142] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0143] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
[0144] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0145] Among them, the processor 710 is used to obtain the actual location of the first electronic device; when it is determined that there is at least one associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device, obtain the historical communication parameters of the associated electronic device; the historical communication parameters are the communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device; and establish a communication connection with the second electronic device based on the historical communication parameters.
[0146] In the embodiment of the present application, when the second electronic device is connected to the first electronic device via the USB interface, it is not necessary to try to connect the communication by constantly adjusting the communication parameters, but first obtain the actual location of the first electronic device, then obtain the associated electronic device associated with the actual location, and establish a communication connection with the second electronic device according to the historical communication parameters of the associated electronic device. Since the historical communication parameters are the communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before, the success rate of establishing a communication connection with the second electronic device according to the historical communication parameters is high, thereby improving the efficiency of the communication connection.
[0147] Optionally, the processor 710 is further used to: establish a communication connection with the second electronic device through each of the historical communication parameters in turn; when the communication connection is successful, obtain the communication signal quality of the communication with the second electronic device; determine the historical communication parameter whose communication signal quality meets a preset condition as the target communication parameter for establishing a communication connection with the second electronic device; and establish a communication connection with the second electronic device according to the target communication parameter.
[0148] Optionally, the processor 710 is further used to: obtain baseline communication parameters when it is determined that there is no associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device; establish a communication connection with the second electronic device according to the baseline communication parameters; in the event of a communication connection failure, adjust the baseline communication parameters to obtain adjusted communication parameters; and establish a communication connection with the second electronic device according to the adjusted communication parameters.
[0149] Optionally, the processor 710 is further used to: when it is determined that there is no associated electronic device associated with the actual location and a third electronic device is inserted into the USB interface of the first electronic device, obtain the electronic device identification of the third electronic device; based on the electronic device identification, accumulate the number of connection times of the third electronic device establishing a communication connection with the first electronic device at the actual location; when the number of connections reaches a preset threshold, determine the third electronic device as the associated electronic device.
[0150] The embodiment of the present application optimizes the solution for obtaining communication parameters during communication connection, thereby improving the efficiency of communication connection.
[0151] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0152] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 709 may include a volatile memory or a non-volatile memory, or the memory 709 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0153] The processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 710.
[0154] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned communication connection method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0155] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0156] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned communication connection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0157] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0158] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned communication connection method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0159] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A communication connection method, characterized in that: Applied to a first electronic device, the first electronic device includes a universal serial bus USB interface, and the method includes: Acquire the actual location of the first electronic device; When it is determined that there is at least one associated electronic device associated with the actual location and a second electronic device is inserted into the USB interface of the first electronic device, obtaining historical communication parameters of the associated electronic device; the historical communication parameters are communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before; A communication connection is established with the second electronic device according to the historical communication parameters.
2. The method according to claim 1, characterized in that The associated electronic devices are multiple, and establishing a communication connection with the second electronic device according to the historical communication parameter includes: Establishing a communication connection with the second electronic device through each of the historical communication parameters in sequence; If the communication connection is successful, obtaining the quality of the communication signal with the second electronic device; Determining the historical communication parameter whose communication signal quality meets the preset condition as the target communication parameter for establishing a communication connection with the second electronic device; A communication connection is established with the second electronic device according to the target communication parameter.
3. The method according to claim 1, characterized in that The method further comprises: acquiring a reference communication parameter when it is determined that there is no associated electronic device associated with the actual location and the second electronic device is plugged into the USB interface of the first electronic device; establishing a communication connection with the second electronic device according to the reference communication parameters; In case of a communication connection failure, adjusting the reference communication parameters to obtain adjusted communication parameters; A communication connection is established with the second electronic device according to the adjusted communication parameters.
4. The method according to claim 1, characterized in that The method further comprises: When it is determined that there is no associated electronic device associated with the actual location and a third electronic device is inserted into the USB interface of the first electronic device, acquiring an electronic device identification of the third electronic device; According to the electronic device identifier, accumulating the number of times the third electronic device establishes a communication connection with the first electronic device at the actual location; When the number of connections reaches a preset threshold, the third electronic device is determined as the associated electronic device.
5. A communication connection device, characterized in that: Applied to a first electronic device, the first electronic device includes a universal serial bus USB interface, and the device includes: An acquisition module, used to acquire the actual location of the first electronic device; The acquisition module is further configured to acquire historical communication parameters of the associated electronic device when it is determined that there is at least one associated electronic device associated with the actual location and the second electronic device is inserted into the USB interface of the first electronic device; the historical communication parameters are communication parameters used when the associated electronic device successfully established a communication connection with the first electronic device before; A connection module is used to establish a communication connection with the second electronic device according to the historical communication parameters.
6. The device according to claim 5, characterized in that There are multiple associated electronic devices, and the connection module includes: a connection submodule, configured to establish a communication connection with the second electronic device through each of the historical communication parameters in turn; an acquisition submodule, configured to acquire the quality of the communication signal with the second electronic device when the communication connection is successful; A determination submodule, configured to determine the historical communication parameter whose communication signal quality satisfies a preset condition as a target communication parameter for establishing a communication connection with the second electronic device; The connection submodule is further used to establish a communication connection with the second electronic device according to the target communication parameters.
7. The device according to claim 5, characterized in that The acquisition module is further configured to acquire the reference communication parameter when it is determined that there is no associated electronic device associated with the actual position and the second electronic device is inserted into the USB interface of the first electronic device; The connection module is further used to establish a communication connection with the second electronic device according to the reference communication parameters; The device also includes: An adjustment module, used for adjusting the reference communication parameters to obtain adjusted communication parameters when the communication connection fails; The connection module is further used to establish a communication connection with the second electronic device according to the adjusted communication parameters.
8. The device according to claim 5, characterized in that The acquisition module is further configured to acquire the electronic device identification of the third electronic device when it is determined that there is no associated electronic device associated with the actual location and the third electronic device is inserted into the USB interface of the first electronic device; The device also includes: A calculation module, configured to accumulate, according to the electronic device identifier, the number of times the third electronic device establishes a communication connection with the first electronic device at the actual location; The determination module is used to determine the third electronic device as the associated electronic device when the number of connections reaches a preset threshold.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the communication connection method according to any one of claims 1 to 4 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the communication connection method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method and device for switching antennas, storage medium and electronic equipment
CN108039897A
Method and device for selecting communication mode, electronic equipment and medium
CN111031170A
Method and device for adjusting rate mode of USB (Universal Serial Bus) data transmission
CN118574169A