A connection transfer method
By having a second host replace the first host in the local area network to perform the handshake with the slave device, the problem of unbalanced connection between the host and slave devices is solved, and the continuity of business data transmission and the improvement of communication speed are achieved.
Patent Information
- Application Number
- CN202110908644.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-09
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2041-08-09
AI Technical Summary
In the same local area network, uneven connection between the master and slave devices leads to uneven distribution of computing power, which affects the communication speed of the slave devices. Furthermore, the reconnection process after the master disconnects from the slave device affects the normal transmission of business data.
The first host sends the connection parameters to the second host, determines the transfer time to be a multiple of the connection interval, and at this time, the second host replaces the first host to perform a handshake with the slave device to ensure the continuity of business data transmission.
During the connection transfer process, business data transmission between the master and slave devices was not affected, communication speed was improved, and the time consumed for connection reconstruction was reduced.
Smart Images

Figure CN115942396B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, and specifically relates to a connection transfer method. Background Technology
[0002] Within the same local area network (LAN), there may be multiple hosts and slave devices forming a connected network. When each host actively seeks out slave devices to form a tree-like subnet, some hosts may connect to multiple slave devices, while others may connect to fewer. This results in an uneven distribution of computing power across the hosts. Consequently, the communication speed of the slave devices will decrease.
[0003] However, if the master disconnects from the slave and another master establishes a connection with the slave, the new master and slave will need to spend some time reconnecting, discovering services, and establishing a secure channel, which will affect the normal transmission of business data. Summary of the Invention
[0004] This application provides a connection transfer method to solve the technical problem of affecting business data transmission during the connection transfer process between a new host and a slave.
[0005] To solve the above-mentioned technical problems, one technical solution adopted in this application is: a connection transfer method, the connection transfer method comprising: a first host sending connection parameters between the first host and the slave device to a second host, the connection parameters including a connection interval; the first host determining a transfer time for the slave device, the transfer time being a multiple of the connection interval; the first host sending the transfer time to the second host, so that the second host sends a handshake request to the slave device at the transfer time.
[0006] According to one embodiment of this application, the first host sends the connection parameters between the first host and the slave device to the second host, and further includes: the first host changes the connection interval in the connection parameters to a preset interval, and sends the changed connection interval to the second host.
[0007] According to one embodiment of this application, the connection parameters further include slave latency, and the transfer time is a multiple of the connection interval that is less than the slave latency.
[0008] According to one embodiment of this application, before the first host sends the connection parameters between the first host and the slave to the second host, the method further includes: the first host and the second host performing time synchronization at least once.
[0009] According to one embodiment of this application, the connection transfer method further includes: the first host sending connection channel information to the second host, so that the second host sends a handshake request to the slave device through the connection channel; the connection channel is the connection channel between the first host and the slave device at the transfer time.
[0010] According to one embodiment of this application, the connection parameters include a frequency hopping interval; the connection channel is determined by the frequency hopping interval and the transition time.
[0011] According to one embodiment of this application, the first host determines the transfer time of the slave device by: the first host notifying the slave device of the transfer time; the first host receiving a reply from the slave device indicating that the transfer is currently impossible and a transfer attempt is possible; and the first host re-determining the transfer time at the transfer attempt attempt time.
[0012] According to one embodiment of this application, the first host notifies the slave of the transfer time, including: the first host notifies the slave of the transfer time and the identification information of the second host.
[0013] According to one embodiment of this application, the connection transfer method further includes: the first host sending a handshake request to the slave device at the transfer time.
[0014] According to one embodiment of this application, the connection parameters include a frequency hopping interval, and the first host sends a handshake request to the slave device during the transition time, including: the first host sending a handshake request to the slave device through a connection channel during the transition time, wherein the connection channel is the connection channel between the first host and the slave device during the transition time; the connection channel is determined by the frequency hopping interval and the transition time.
[0015] To solve the above-mentioned technical problems, another technical solution adopted in this application is: a connection transfer method, the connection transfer method comprising: a second host receiving connection parameters sent by a first host, the connection parameters being connection parameters between the first host and a slave device, including a connection interval; the second host receiving a transfer time sent by the first host, the transfer time being the transfer time of the slave device; the transfer time being a multiple of the connection interval; and the second host sending a handshake request to the slave device when the transfer time arrives.
[0016] According to one embodiment of this application, before the second host receives the connection parameters sent by the first host, the method further includes: the second host accepting at least one time synchronization with the first host.
[0017] According to one embodiment of this application, the connection parameters further include slave latency, and the transfer time is a multiple of the connection interval that is less than the slave latency.
[0018] According to one embodiment of this application, the connection parameters further include a frequency hopping interval; the connection transfer method further includes: the second host receiving connection channel information sent by the first host, the connection channel being the connection channel between the first host and the slave device at the transfer time; the second host sending a handshake request to the slave device through the connection channel.
[0019] According to one embodiment of this application, the connection parameters include a frequency hopping interval; the connection channel is determined by the frequency hopping interval and the transition time.
[0020] According to one embodiment of this application, the connection transfer method includes: the second host sending a transfer success message to the first host.
[0021] To solve the above-mentioned technical problems, another technical solution adopted in this application is: a connection transfer method, the connection transfer method comprising: a slave device receiving a transfer time and identification information of a second host sent by a first host, wherein the transfer time is a multiple of a connection interval, and the connection interval is a connection parameter for the communication connection between the slave device and the first host; the slave device receiving a handshake request sent by the second host at the transfer time.
[0022] According to one embodiment of this application, the connection transfer method further includes: the slave device replying to the first host with information that it is currently unable to transfer and a transfer time that can be attempted, so that the first host can re-determine the transfer time during the transfer time that can be attempted.
[0023] According to one embodiment of this application, the connection transfer method further includes: if the slave device does not receive a handshake request sent by the second host during the transfer time, then responding to a handshake request sent by the first host during the transfer time.
[0024] The beneficial effects of this application are: by replacing the original first host with the second host that accepts the transfer in a new connection and handshaking with the slave, the normal transmission of business data between the host and the slave is not affected, thus ensuring the communication speed between the host and the slave. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein:
[0026] Figure 1 This is a flowchart illustrating an embodiment of the connection transfer method of this application;
[0027] Figure 2 This is a schematic diagram of a sub-process of the first host determining the transfer time of the slave in one embodiment of the connection transfer method of this application;
[0028] Figure 3 This is a flowchart illustrating another embodiment of the connection transfer method of this application;
[0029] Figure 4 This is a flowchart illustrating another embodiment of the connection transfer method of this application;
[0030] Figure 5 This is a schematic diagram of the framework of an embodiment of the electronic device of this application;
[0031] Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0033] Please see Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating an embodiment of the connection transfer method of this application; Figure 2 This is a schematic diagram of a sub-process of the first host determining the transfer time of the slave in one embodiment of the connection transfer method of this application.
[0034] One embodiment of this application provides a connection transfer method, including the following steps:
[0035] S11: The first host sends the connection parameters between the first host and the slave to the second host. The connection parameters include the connection interval.
[0036] The local area network (LAN) includes at least two hosts and at least one slave. The host currently connected to the slave to be transferred is designated as the first host, and the host waiting to connect to the slave to be transferred is designated as the second host. The first and second hosts can be connected via any communication method, including Ethernet, Wi-Fi, BLE, etc., without restriction. The hosts and slaves can also connect via Bluetooth.
[0037] It should be noted that before the first host sends the connection parameters between the first host and the slave to the second host, the first host and the second host communicate with each other to determine that the second host has enough connection space to transfer the connection with the slave. Then, the first host sends the connection parameters between the first host and the slave to the second host to ensure the success of the connection transfer.
[0038] Furthermore, because communication transmission time may fluctuate slightly, at least one time synchronization is required between the first host and the second host to ensure smooth connection transfer and timestamp alignment. Preferably, multiple time synchronizations are required between the first host and the second host. In one embodiment, the time synchronization between the first host and the second host can be performed before step S11; in other embodiments, it can be performed after step S11.
[0039] The connection parameters include the connection interval between the first master and slave devices. The connection interval is briefly described below:
[0040] Within a connection, the master sends data packets to the slave in each connection event. A connection event refers to the process of the master and slave exchanging data packets. Connection events occur at a consistent frequency; each data packet waits a predetermined time after the previous packet is sent before being sent again. The predetermined waiting time between two connection events is called the connection interval. The connection interval determines the interaction interval between the master and slave; it refers to the time distance between the beginning of two consecutive connection events. In other words, connection events are separated by a series of connection intervals. Each connection event can continue from the moment the master sends a data packet until either the master or slave stops responding.
[0041] Different applications may require different time intervals. The advantage of a long time interval is significant power saving, because the master and slave devices can sleep for a longer period between connection events. The disadvantage is that when the master or slave device has application data to send, it must wait for the next connection event. The advantage of a short time interval is that the master and slave devices connect frequently, and data can be sent and received faster. The disadvantage is that the master or slave device is frequently woken up by the arrival of connection events, resulting in more power consumption.
[0042] If the connection interval between the first master and the slave is too small to enable connection transfer, the connection parameters need to be adjusted. In some embodiments, sending the connection parameters between the first master and the slave to the second master further includes: the first master changing the connection interval in the connection parameters to a preset interval and sending the changed connection interval to the second master. The preset interval is larger than the current connection interval, i.e., upgrading the connection parameters to a larger parameter interval to ensure greater communication tolerance and enable connection transfer.
[0043] Furthermore, the connection parameters also include slave latency, and the transfer time relative to the connection interval is less than the slave latency, thereby ensuring successful connection transfer. Preferably, the transfer time is less than half of the slave latency.
[0044] In some embodiments, the connection parameters may also include service parameters, security parameters, etc., which are not limited here.
[0045] S12: The first master determines the transfer time of the slave, and the transfer time is a multiple of the connection interval.
[0046] The first host determines the transfer time of the slave device, and the transfer time is a multiple of the connection interval between the first host and the slave device. This ensures that in a new connection, the slave device, with the second host accepting the transfer replacing the original first host, performs a handshake with the slave device without affecting the normal transmission of service data between the host and the slave device. In some embodiments, step S12 can be performed simultaneously with step S11. In other embodiments, step S12 can be performed after or before step S11.
[0047] In some embodiments, the first host determines the slave's transfer time, including:
[0048] S121: The first master will notify the slave of the transfer time.
[0049] The first master notifies the slave of the transfer time, which should be a multiple of the current connection interval between the first master and the slave. Specifically, the first master notifying the slave of the transfer time includes: the first master notifying the slave of the transfer time and the identification information of the second master, so as to facilitate the slave to connect with the second master with the corresponding identification information at the transfer time.
[0050] S122: The first host receives the slave's reply indicating that the transfer is currently impossible and the transfer time can be attempted.
[0051] If the slave device is currently transmitting data to the master device or other devices, or if it is processing computationally intensive tasks and cannot currently perform a connection transfer, it will send a transfer failure message and an estimated transfer attempt time to the master device. The master device receives the transfer failure message and the estimated transfer attempt time from the slave device.
[0052] S123: The first host re-determines the transfer time during the available transfer period.
[0053] The first master re-determines the transfer time in the slave's reply of the transfer attempt time. The re-determined transfer time is still a multiple of the connection interval between the first master and the slave, thus ensuring that in a new connection, the second master accepting the transfer replaces the original first master and performs a handshake with the slave without affecting the normal transmission of business data between the master and the slave.
[0054] Of course, if the first master notifies the slave of the re-determined transfer time, and still receives the slave's reply that the transfer is currently not possible and the transfer time can be attempted, then the first master will re-determine the transfer time again during the transfer time that can be attempted, and notify the slave, repeating this process until the slave no longer replies with the information that the transfer is currently not possible, that is, the slave can perform the connection transfer during the transfer time.
[0055] S13: The first host sends the transfer time to the second host so that the second host can send a handshake request to the slave during the transfer time.
[0056] The first host sends the transfer time to the second host, so that the second host sends a handshake request to the slave during the transfer time in order to attempt a handshake connection with the slave.
[0057] It should be noted that step S13 can be performed synchronously with step S12. That is, the first host notifies the slave of the transfer time while simultaneously sending the transfer time to the second host. At this time, if the slave cannot transfer information, the second host will still send a handshake request to the slave at the agreed transfer time, but will not be able to successfully establish a handshake connection. Alternatively, the first host can send the transfer time to the second host only after the slave has determined that the connection transfer can be performed at the agreed transfer time, so that the second host sends a handshake request to the slave at the transfer time.
[0058] In some embodiments, the connection transfer method further includes: a first host sending connection channel information to a second host, allowing the second host to identify the connection channel used for communication with the slave device through the connection channel information, so that the second host can send a handshake request to the slave device through the connection channel. It should be noted that multiple connection channels may be used for communication during the communication process, and the connection channel needs to be selected at different transfer times. The connection channel information sent from the first host to the second host includes the specific connection channel used by the first host and the slave device at the transfer time. Further, in addition to allowing the second host to identify the used connection channel, the connection channel information may also include one or more of the following: transmission rate, signal-to-noise ratio, channel gain, and noise power of the connection channel. Thus, the second host will take over from the first host to perform a handshake connection with the slave device on the corresponding connection channel.
[0059] The connection parameters also include the frequency hopping interval, which is the frequency hopping interval between the first master and the slave. The connection channel is determined by the frequency hopping interval and the transfer time. The connection channel between the first master and the slave may change each time they connect. The second master takes over the connection channel corresponding to the first master at the transfer time and performs a handshake connection with the slave.
[0060] To prevent the connection transfer method in this application from failing when the slave device fails to transfer the connection to the second host, thus affecting the normal transmission of service data, the connection transfer method further includes:
[0061] The first master sends a handshake request to the slave during the transfer time; that is, both the first master and the second master will send a handshake request to the slave during the transfer time.
[0062] If the slave device does not receive a handshake request from the second host when the transfer time expires, or if other problems cause the connection transfer to fail, the slave device will continue to respond to the first host's handshake request to ensure normal transmission of business data. Through the above process, while the second host is formally sending a handshake request to the slave device, the slave device still maintains its connection and business communication with the first host, only interrupting business communication during the connection interval when the first host notifies of the connection transfer. However, even if the connection transfer fails, the connection between the first host and the slave device is not interrupted. After a successful connection transfer, the second host will fully inherit all service parameters and security parameters used by the first host during service discovery. The entire process takes only a short time. Compared to the usual method where the first host disconnects the slave device and the second host rescans the slave device, connects, discovers services, and pairs security, this saves at least 2-10 seconds, during which business data is almost uninterrupted.
[0063] If the synchronization handshake between the slave device and the second master device is successful, the second master device will inherit all connection parameters synchronized by the first master device. At the same time, the first master device will receive a connection transfer success notification from the second master device. At this point, the slave device will not respond to the handshake request sent by the first master device during the transfer time.
[0064] Similarly, the connection parameters include the frequency hopping interval, which is the frequency hopping interval between the first master and the slave. The first master sending a handshake request to the slave during the transition time includes: the first master sending a handshake request to the slave through the connection channel during the transition time; the connection channel is the connection channel between the first master and the slave during that transition time. The connection channel may change each time the first master connects with the slave, and the connection channel is determined by the frequency hopping interval and the transition time.
[0065] The connection transfer in this application embodiment can occur when the computing power distribution between hosts is uneven and the communication speed of subordinate slaves will also slow down. Through the method of this application embodiment, in a new connection, the second host that accepts the transfer replaces the original first host and shakes hands with the slave, without affecting the normal transmission of business data between the host and the slave, thus ensuring the communication speed between the host and the slave.
[0066] The connection transfer method of this application has been described above with the first host as the main body. Another embodiment of this application describes the connection transfer method with the second host as the main body, as follows:
[0067] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the connection transfer method of this application.
[0068] Another embodiment of this application discloses a connection transfer method, including the following steps:
[0069] S21: The second host receives the connection parameters sent by the first host. The connection parameters are the connection parameters between the first host and the slave device, including the connection interval.
[0070] The local area network (LAN) includes at least two master hosts and at least one slave host. The host currently connected to the slave host to be transferred is designated as the first master host, and the host waiting to connect to the slave host to be transferred is designated as the second master host. The first and second masters can be connected via any communication method, including Ethernet, Wi-Fi, BLE, etc., without restriction. The master and slave hosts can also connect via Bluetooth.
[0071] It should be noted that before the second host receives the connection parameters sent by the first host, the second host and the first host can communicate with each other first, and the second host can reply to the first host that there is enough connection space to transfer the connection with the slave device. Then the second host receives the connection parameters sent by the first host to ensure the success of the connection transfer.
[0072] Furthermore, because communication transmission time may fluctuate slightly, at least one time synchronization is required between the second host and the first host to ensure smooth connection transfer and timestamp alignment. Preferably, multiple time synchronizations are required between the second host and the first host. In one embodiment, the time synchronization between the second host and the first host can be performed before step S21; in other embodiments, it can be performed after step S21.
[0073] The connection parameters include the connection interval between the first master and slave devices. The connection interval is briefly described below:
[0074] Within a connection, the master sends data packets to the slave in each connection event. A connection event refers to the process of the master and slave exchanging data packets. Connection events occur at a consistent frequency; each data packet waits a predetermined time after the previous packet is sent before being sent again. The predetermined waiting time between two connection events is called the connection interval. The connection interval determines the interaction interval between the master and slave; it refers to the time distance between the beginning of two consecutive connection events. In other words, connection events are separated by a series of connection intervals. Each connection event can continue from the moment the master sends a data packet until either the master or slave stops responding.
[0075] Different applications may require different time intervals. The advantage of a long time interval is significant power saving, because the master and slave devices can sleep for a longer period between connection events. The disadvantage is that when the master or slave device has application data to send, it must wait for the next connection event. The advantage of a short time interval is that the master and slave devices connect frequently, and data can be sent and received faster. The disadvantage is that the master or slave device is frequently woken up by the arrival of connection events, resulting in more power consumption.
[0076] If the connection interval between the first master and the slave is too small to achieve connection transfer, the connection interval in the connection parameters needs to be adjusted to a preset interval greater than the current connection interval. The second master receives the adjusted connection parameters sent by the first master to ensure a larger communication tolerance and achieve connection transfer.
[0077] Furthermore, the connection parameters also include slave latency, and the transfer time relative to the connection interval is less than the slave latency, thereby ensuring successful connection transfer. Preferably, the transfer time is less than half of the slave latency.
[0078] In some embodiments, the connection parameters may also include service parameters, security parameters, etc., which are not limited here.
[0079] S22: The second host receives the transfer time sent by the first host. The transfer time is the connection transfer time of the slave device and is a multiple of the connection interval.
[0080] The second host receives the transfer time sent by the first host. This transfer time is the connection transfer time of the slave device and is a multiple of the connection interval. This ensures that in a new connection, the second host replaces the original first host in the handshake process with the slave device, without affecting the normal transmission of business data between the host and slave.
[0081] S23: When the transfer time is reached, the second host sends a handshake request to the slave.
[0082] When the transfer time arrives, the second master sends a handshake request to the slave. At this point, there are two possible outcomes: connection success or failure. If the second master and slave successfully connect via handshake, the second master sends a transfer success message to the first master. If the connection between the second master and slave fails, the second master can wait for the next transfer time sent by the first master and then attempt to connect with the slave again via handshake.
[0083] The method in this embodiment further includes: a second host receiving connection channel information sent by a first host, which allows the second host to identify the connection channel used for communication with the slave device, so that the second host sends a handshake request to the slave device through the connection channel. It should be noted that multiple connection channels may be used for communication during the communication process, and the connection channel needs to be selected at different transition times. The connection channel information sent from the first host to the second host includes the specific connection channel used by the first host and the slave device at the transition time. Further, in addition to allowing the second host to identify the used connection channel, the connection channel information may also include one or more of the following: transmission rate, signal-to-noise ratio, channel gain, and noise power of the connection channel. The second host sends a handshake request to the slave device through the connection channel, thereby the second host will take over from the first host in performing a handshake connection with the slave device on the corresponding connection channel.
[0084] Furthermore, the connection parameters also include frequency hopping interval, which is the frequency hopping interval between the first master and the slave. The connection channel is determined by the frequency hopping interval and the transfer time. The connection channel between the first master and the slave may change each time they connect. The second master takes over the connection channel corresponding to the first master at the transfer time and performs a handshake connection with the slave.
[0085] The connection transfer in this application embodiment can occur when the computing power distribution between hosts is uneven and the communication speed of subordinate slaves will also slow down. Through the method of this application embodiment, in a new connection, the second host replaces the original first host and shakes hands with the slave, without affecting the normal transmission of business data between the host and the slave, thus ensuring the communication speed between the host and the slave.
[0086] The connection transfer method of this application has been described above with the first host and the second host as the main components. Another embodiment of this application describes the connection transfer method with the slave device as the main component, as follows:
[0087] Please see Figure 4 , Figure 4 This is a flowchart illustrating another embodiment of the connection transfer method of this application.
[0088] Another embodiment of this application provides a connection transfer method, including the following steps:
[0089] S31: The slave device receives the transfer time and the identification information of the second master sent by the first master. The transfer time is a multiple of the connection interval, and the connection interval is the connection parameter for the communication connection between the slave device and the first master.
[0090] The local area network (LAN) includes at least two master hosts and at least one slave host. The host currently connected to the slave host to be transferred is designated as the first master host, and the host waiting to connect to the slave host to be transferred is designated as the second master host. The first and second masters can be connected via any communication method, including Ethernet, Wi-Fi, BLE, etc., without restriction. The master and slave hosts can also connect via Bluetooth.
[0091] The slave device receives the transfer time and the identification information of the second host sent by the first host. The second host is the host to be transferred. The slave device finds the corresponding second host through the identification information.
[0092] The transfer time is a multiple of the connection interval, which is the connection parameter for the communication connection between the slave and the first master. This ensures that in a new connection, the slave can handshake with the second master receiving the transfer instead of the original first master, without affecting the normal transmission of service data between the master and the slave. The connection interval is briefly described below:
[0093] Within a connection, the master sends data packets to the slave in each connection event. A connection event refers to the process of the master and slave exchanging data packets. Connection events occur at a consistent frequency; each data packet waits a predetermined time after the previous packet is sent before being sent again. The predetermined waiting time between two connection events is called the connection interval. The connection interval determines the interaction interval between the master and slave; it refers to the time distance between the beginning of two consecutive connection events. In other words, connection events are separated by a series of connection intervals. Each connection event can continue from the moment the master sends a data packet until either the master or slave stops responding.
[0094] Different applications may require different time intervals. The advantage of a long time interval is significant power saving, because the master and slave devices can sleep for a longer period between connection events. The disadvantage is that when the master or slave device has application data to send, it must wait for the next connection event. The advantage of a short time interval is that the master and slave devices connect frequently, and data can be sent and received faster. The disadvantage is that the master or slave device is frequently woken up by the arrival of connection events, resulting in more power consumption.
[0095] If the slave device is currently transmitting data services to the first host or other devices, or if the slave device is processing services that consume computing power, and the slave device is currently unable to perform connection transfer, the connection transfer method of this application further includes: the slave device replying to the first host with information that it is currently unable to transfer and a transfer attempt time, so that the first host can re-determine the transfer time during the transfer attempt time.
[0096] S32: The slave device receives a handshake request sent by the second master device during the transfer time.
[0097] If the slave device can perform a connection transfer during the transfer time sent by the first host, then the slave device will receive a handshake request sent by the second host during the connection transfer time.
[0098] Because the first host also sends a handshake request to the slave device simultaneously with the second host, if the slave device does not receive the handshake request from the second host when the transfer time expires, or if other problems cause the connection transfer to fail, the slave device will respond to the first host's handshake request, ensuring the normal transmission of business data. Through the above process, while the second host is formally sending the handshake request to the slave device, the slave device still maintains its connection and business communication with the first host, only interrupting business communication during the connection transfer interval notified by the first host. However, even if the connection transfer fails, the connection between the first host and the slave device is not interrupted. After a successful connection transfer, the second host will fully inherit all service parameters and security parameters used by the first host during service discovery. The entire process takes only a short time. Compared to the usual method where the first host disconnects the slave device and the second host rescans the slave device, connects, discovers services, and pairs security, this saves at least 2-10 seconds, during which business data is almost uninterrupted.
[0099] The connection transfer in this application embodiment can occur when the computing power distribution between hosts is uneven and the communication speed of subordinate slaves will also slow down. Through the method of this application embodiment, in a new connection, the second host replaces the original first host and shakes hands with the slave, without affecting the normal transmission of business data between the host and the slave, thus ensuring the communication speed between the host and the slave.
[0100] The link transfer method of this application is described below with two specific embodiments: Specific implementation method one:
[0102] In a local area network, there are a first host, a second host, and a slave device. The first host and the second host communicate via a wired connection, and the first host and the slave device communicate via BLE.
[0103] The first host queries the second host to confirm that the second host has sufficient Bluetooth connection resources.
[0104] The first host and the second host perform time synchronization multiple times to align their times. Simultaneously, the first host updates the connection parameters with the slave device to ensure that connection transfers can be initiated at intervals.
[0105] The first host transmits connection parameters between itself and the slave to the second host, including connection interval, service parameters, security parameters, and slave latency. Simultaneously, the first host queries the slave to determine if a connection transfer can proceed after a 160ms transfer period, carrying the second host's identification information.
[0106] After receiving the acknowledgment from the slave, the first master proposes a connection transfer to the second master. Since the first master is capable of handling the issue, it sends an inquiry to the slave, which takes 80ms to process. The first master then proposes the connection transfer 80ms later, carrying its timestamp, transfer time, and the connection channel information corresponding to that time.
[0107] The second host sends a handshake request to the connection channel after a 80ms transfer time.
[0108] At this point, the slave device hops to the corresponding connection channel, receives the handshake request, and responds.
[0109] After receiving the response from the slave, the second master confirms that the connection transfer was successful and sends a success message to the first master. The first master then stops periodically synchronizing the communication connection with the slave.
[0110] After the second master and slave confirm that the connection transfer is successful, if the second master has not yet sent a transfer success message to the first master, the first master will still send a handshake request to the slave, and the slave will not respond. Specific Implementation Method Two:
[0112] In a local area network, there are a first host, a second host, and a slave device. The first host and the second host communicate via a wired connection, and the first host and the slave device communicate via BLE.
[0113] The first host queries the second host to confirm that the second host has sufficient Bluetooth connection resources.
[0114] The first host and the second host perform time synchronization multiple times to align their times. Simultaneously, the first host updates the connection parameters with the slave device to ensure that connection transfers can be initiated at intervals.
[0115] The first host transmits connection parameters between itself and the slave to the second host, including connection interval, service parameters, security parameters, and slave latency. Simultaneously, the first host queries the slave to determine if a connection transfer can proceed after a 160ms transfer period, carrying the second host's identification information.
[0116] After receiving the acknowledgment from the slave, the first master proposes a connection transfer to the second master. Since the first master is capable of handling the issue, it sends an inquiry to the slave, which takes 80ms to process. The first master then proposes the connection transfer 80ms later, carrying its timestamp, transfer time, and the connection channel information corresponding to that time.
[0117] At the 80ms transition time, the second master did not send a handshake request to the connection channel corresponding to the transition time. The slave hopped to the corresponding connection channel but did not receive the handshake request. The first master, skipping the 80ms connection interval (which should be the transition time for the second master to send the handshake request to the slave), continued to send a handshake request to the slave on the corresponding connection channel at the next connection interval. The slave responded to the first master. The connection transition between the second master and the slave failed.
[0118] The two specific implementation methods described above illustrate two scenarios of the connection transfer method in this application. When the second host formally sends a handshake request to the slave device, the slave device maintains its connection and service communication with the first host, only interrupting service communication during the connection interval when the first host notifies of the connection transfer. However, even if the connection transfer fails, the connection between the first host and the slave device remains uninterrupted. After a successful connection transfer, the second host will fully inherit all service parameters and security parameters used by the first host during service discovery. The entire process takes only a short time, ensuring the communication speed between the host and the slave device.
[0119] Please see Figure 5 , Figure 5 This is a schematic diagram of the framework of an embodiment of the electronic device of this application.
[0120] Another embodiment of this application provides an electronic device 40, including a memory 41 and a processor 42 coupled to each other. The processor 42 is used to execute program instructions stored in the memory 41 to realize the connection transfer of any of the above embodiments. In a specific implementation scenario, the electronic device 40 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 40 may also include mobile devices such as laptops and tablets, which are not limited here. This electronic device 40 can replace the original first host in a new connection and handshake with the slave device through a second host, without affecting the normal transmission of business data between the host and the slave device, thus ensuring the communication speed between the host and the slave device.
[0121] Specifically, processor 42 controls itself and memory 41 to implement the steps in any of the above-described image exposure adjustment method embodiments. Processor 42 can also be referred to as a CPU (Central Processing Unit). Processor 42 may be an integrated circuit chip with signal processing capabilities. Processor 42 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 42 can be implemented using integrated circuit chips.
[0122] Please see Figure 6 , Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application.
[0123] Another embodiment of this application provides a computer-readable storage medium 50 that stores program data 51 thereon, which, when executed by a processor, implements the connection transfer method of any of the above embodiments.
[0124] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0125] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0126] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0127] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium 50. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium 50 and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium 50 includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0128] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method of connection transfer, characterized in that, The connection transfer method comprises: The first host sends connection parameters of the first host and the slave to the second host, the connection parameters comprising a connection interval and a slave time delay; The first host determines a transfer time of the slave, the transfer time being a multiple of the connection interval, the transfer time being less than the slave time delay relative to the multiple of the connection interval; The first host sends the transfer time to the second host, so that the second host sends a handshake request to the slave at the transfer time; The first host sends a handshake request to the slave at the transfer time.
2. The connection transfer method of claim 1, wherein, The first host sends connection parameters of the first host and the slave to the second host, and further comprises: The first host changes the connection interval in the connection parameters to a preset interval, and sends the changed connection interval to the second host.
3. The connection transfer method of claim 1, wherein, Before the first host sends connection parameters of the first host and the slave to the second host, further comprising: The first host and the second host perform at least one time synchronization.
4. The connection transfer method of claim 1, wherein The connection transfer method further comprises: The first host sends information of a connection channel to the second host, so that the second host sends a handshake request to the slave through the connection channel; the connection channel being a connection channel of the first host and the slave at the transfer time.
5. The connection transfer method of claim 4, wherein, The connection parameters comprise a frequency hopping interval; the connection channel being determined by the frequency hopping interval and the transfer time.
6. The connection transfer method of claim 1, wherein The first host determines a transfer time of the slave, comprising: The first host informs the slave of the transfer time; The first host receives information that the slave cannot be transferred at present and a time when the slave can be tried to be transferred in reply; The first host re-determines the transfer time at the time when the slave can be tried to be transferred.
7. The connection transfer method of claim 6, wherein, The first host informs the slave of the transfer time, comprising: The first host informs the slave of the transfer time and identification information of the second host.
8. The connection transfer method of claim 1, wherein The connection parameters comprise a frequency hopping interval; the first host sending a handshake request to the slave at the transfer time, comprising: The first host sends a handshake request to the slave through a connection channel at the transfer time, the connection channel being a connection channel of the first host and the slave at the transfer time; the connection channel being determined by the frequency hopping interval and the transfer time.
9. A method of connection transfer, characterized by, The connection transfer method comprises: The second host receives connection parameters sent by the first host, the connection parameters being connection parameters of the first host and the slave, comprising a connection interval and a slave time delay; The second host receives a transfer time sent by the first host, the transfer time being a connection transfer time of the slave; the transfer time being a multiple of the connection interval, the transfer time being less than the slave time delay relative to the multiple of the connection interval; The second host sends a handshake request to the slave when the transfer time arrives.
10. The connection transfer method of claim 9, wherein, Before the second host receives connection parameters sent by the first host, further comprising: The second host accepts at least one time synchronization with the first host.
11. The connection transfer method of claim 9, wherein, The connection parameters further comprise a frequency hopping interval; the connection transfer method further comprising: The second host receives the information of the connection channel sent by the first host, and the connection channel is the connection channel between the first host and the slave at the transfer time; The second host sends a handshake request to the slave through the connection channel.
12. The method of connection transfer according to claim 11, wherein, The connection parameter includes a frequency hopping interval, and the connection channel is determined by the frequency hopping interval and the transfer time.
13. The connection transfer method of claim 9, wherein, The connection transfer method includes: The second host sends transfer success information to the first host.
14. A method of connection transfer, characterized by, The connection transfer method includes: The slave receives the transfer time and the identification information of the second host sent by the first host, the transfer time is a multiple of a connection interval, the transfer time is less than the slave delay relative to the multiple of the connection interval, the connection interval and the slave delay are connection parameters for the communication connection between the slave and the first host; The slave receives the handshake request sent by the second host at the transfer time; If the slave does not receive the handshake request sent by the second host at the transfer time, the slave responds to the handshake request sent by the first host at the transfer time.
15. The method of transfer of connection according to claim 14, characterized in that, The connection transfer method further includes: The slave replies to the first host that the current transfer is not possible and the time when the transfer can be attempted, so that the first host re-determines the transfer time at the time when the transfer can be attempted.
Citation Information
Patent Citations
BLE link switching method and device, earphone pair, chip and medium
CN112437371A