Connection architecture, method and device for establishing connection, electronic equipment and terminal

By dividing the connection into two layers: physical connection and logical connection, and allowing the reuse of established physical connections to establish logical connections, the problems of slow establishment speed and difficult management in the prior art are solved, and the transmission efficiency of service data and the availability of the system are improved.

CN119907130APending Publication Date: 2025-04-29BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311402908.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, the logical connection established by the service is strongly coupled with the actual physical connection, which leads to management difficulties and the establishment of logical connections is slow, affecting the transmission efficiency of service data.

Method used

By dividing the connection into two layers: physical connection and logical connection, it is managed by using physical connection modules and logical connection modules, allowing the established physical connections to be reused to establish logical connections.

Benefits of technology

The separation of physical connections and logical connections is realized, the establishment speed of logical connections is improved, and the transmission efficiency of service data is improved, and the availability of the system is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119907130A_ABST
    Figure CN119907130A_ABST
Patent Text Reader

Abstract

The invention provides a connection architecture, a method and device for establishing connection, electronic equipment and a terminal. The architecture comprises a physical connection module used for establishing a physical connection between devices based on a connection protocol type; wherein the connection protocol type number is in one-to-one correspondence with the established physical connection number; the logic connection module is used for multiplexing the established physical connection to establish one or more logic connections between the devices so as to transmit service data; wherein the logic connection number is in one-to-one correspondence with the service number. According to the method and the device, the physical connection and the logic connection can be split, and the logic connection is established by multiplexing the existing physical connection, so that the establishment speed of the logic connection is improved, and the availability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communications, and in particular to a connection architecture, a method and device for establishing a connection, an electronic device, and a terminal. Background Art

[0002] At present, different types of connection technologies can be encapsulated to provide a unified application program interface (API) for upper-layer services. Upper-layer services directly use this API to establish connections between devices and transmit service data. However, this will cause the logical connection established by the service to be strongly coupled with the actual physical connection, and the logical connection and physical connection cannot be separated, resulting in difficulty in managing the physical and logical connections, and the logical connection is established slowly, which in turn affects the transmission efficiency of service data. The connection solution between devices needs to be optimized. Summary of the invention

[0003] In view of this, the present application discloses a connection architecture, a method and device for establishing a connection, an electronic device, and a terminal.

[0004] According to a first aspect of an embodiment of the present disclosure, a connection architecture is provided, including:

[0005] A physical connection module, used to establish a physical connection between devices based on a connection protocol type; wherein the number of connection protocol types corresponds one-to-one to the number of physical connections established;

[0006] The logical connection module connected to the physical connection module is used to multiplex the established physical connection to establish one or more logical connections between devices to transmit business data; wherein the number of logical connections corresponds to the number of services.

[0007] According to a second aspect of an embodiment of the present disclosure, a method for establishing a connection is provided, the method comprising:

[0008] Determine the target connection protocol type;

[0009] In response to the existence of a target physical connection corresponding to the target connection protocol type, multiplexing the target physical connection to establish one or more target logical connections to transmit service data; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one-to-one; or

[0010] In response to the absence of a target physical connection corresponding to the target connection protocol type, after establishing the target physical connection based on the target connection protocol type, one or more target logical connections are established based on the target physical connection to transmit business data; wherein, the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds one-to-one to the target business.

[0011] According to a third aspect of an embodiment of the present disclosure, a device for establishing a connection is provided, the device comprising:

[0012] A determination module, used for determining a target connection protocol type;

[0013] A first execution module is used for, in response to the existence of a target physical connection corresponding to the target connection protocol type, multiplexing the target physical connection to establish one or more target logical connections to transmit service data; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one by one; or

[0014] The second execution module is used to establish one or more target logical connections based on the target physical connection to transmit business data in response to the absence of a target physical connection corresponding to the target connection protocol type, after establishing the target physical connection based on the target connection protocol type; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds one-to-one to the target business.

[0015] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, wherein the electronic device adopts the connection architecture described in any one of the first aspects.

[0016] According to a fifth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for establishing a connection described in any one of the second aspects are implemented.

[0017] According to a sixth aspect of an embodiment of the present disclosure, a terminal is provided, including:

[0018] processor;

[0019] a memory for storing processor-executable instructions;

[0020] The processor is configured to execute the executable instructions to implement the steps of the method for establishing a connection as described in any one of the second aspects.

[0021] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0022] In the present disclosure, the physical connection and the logical connection can be split, and the existing physical connection can be directly reused to establish the logical connection, which improves the speed of establishing the logical connection, thereby improving the transmission efficiency of the business data and high availability.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0025] Figure 1 is a schematic diagram of a connection architecture according to an exemplary embodiment of the present disclosure;

[0026] Figure 2 is a schematic diagram of another connection architecture according to an exemplary embodiment of the present disclosure;

[0027] Figure 3 is a schematic diagram of another connection architecture according to an exemplary embodiment of the present disclosure;

[0028] Figure 4 is a schematic diagram of another connection architecture according to an exemplary embodiment of the present disclosure;

[0029] Figure 5 is a flowchart of a method for establishing a connection according to an exemplary embodiment of the present disclosure;

[0030] Figure 6 is a flowchart of a method for establishing a connection according to an exemplary embodiment of the present disclosure;

[0031] Figure 7 is a flowchart of another method for establishing a connection according to an exemplary embodiment of the present disclosure;

[0032] Figure 8 is a block diagram of a device for establishing a connection according to an exemplary embodiment of the present disclosure;

[0033] Fig. 9 It is a structural schematic diagram of a device for establishing a connection according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0035] Currently, the connection technology type may include but is not limited to at least one of the following: Bluetooth Low Energy (BLE); Bluetooth (BT); Wireless Local Area Network (WLAN); Peer to Peer (P2P).

[0036] A unified connection and transmission API interface can be formulated to encapsulate the above different connection technologies and shield the differences between different platforms and different hardware devices. The upper-layer business can directly use this API to achieve connection establishment and business data transmission between devices by specifying different connection technologies.

[0037] However, using the above method, although different services can reuse connections using the same connection technology, the logical connection (i.e., virtual connection) established by the service is strongly coupled with the actual physical connection, which makes management difficult and prone to errors. In addition, the above method also requires the service layer to specify the type of connection technology, and it is not possible to dynamically decide to reuse existing connections or establish new connections based on the service usage scenario and the current environment. Especially when multiple devices are interconnected, it is difficult to balance the connection technology, number of connections, performance, and power consumption. In addition, it is not possible to specify different authentication methods when the above-mentioned different services reuse the same connection.

[0038] In order to solve the above technical problems, the present disclosure provides a connection architecture, a method and device for establishing a connection, and an electronic device, which can split the physical connection and the logical connection, and can directly reuse the existing physical connection to establish a logical connection, thereby improving the speed of establishing the logical connection, thereby improving the transmission efficiency of business data, and having high availability.

[0039] The following is an introduction to the connection architecture provided by the present disclosure. Among them, the connection architecture can be used to establish a connection between devices, where the connection between devices includes but is not limited to physical connections and logical connections established between multiple devices. It should also be noted that the connection architecture of the present disclosure can be deployed on electronic devices, and the electronic devices may include but are not limited to mobile phones, laptops, desktop computers, tablet computers, televisions, embedded devices, etc. Specifically, the electronic device can be used to initiate a connection request or receive a connection request, which is not limited by the present disclosure. In addition, the connection architecture provided by the present disclosure can support Android, Windows, Linux, embedded and other platforms, and can support multiple connection protocol types, including but not limited to BT, BLE, WLAN, P2P, etc.

[0040] Reference Figure 1 As shown, Figure 1 is a schematic diagram of a connection architecture shown in an exemplary embodiment of the present disclosure, and the connection architecture can be deployed on any of the above electronic devices. Figure 1 As shown, the connection architecture 100 may include:

[0041] A physical connection module 101, used to establish a physical connection between devices based on a connection protocol type; wherein the number of connection protocol types corresponds one-to-one to the number of physical connections established;

[0042] The logical connection module 102 connected to the physical connection module 101 is used to multiplex the established physical connection to establish one or more logical connections to transmit service data; wherein the number of logical connections corresponds to the number of services.

[0043] In some embodiments, the connection protocol type includes but is not limited to at least one of the following: BLE, BT, WLAN, P2P, etc.

[0044] In some embodiments, the number of connection protocol types refers to the number of connection protocol types supported between devices. The number of physical connections refers to the number of actual physical connections established between devices.

[0045] In some embodiments, the one-to-one correspondence between the number of connection protocol types and the number of established physical connections means that one physical connection is established between the same two devices for each connection protocol type, that is, two or more physical connections are generally not established between the same two devices for the same connection protocol type.

[0046] For example, physical connection #1 is established between device #1 and device #2 using BLE, physical connection #2 is established using BT, etc. Physical connection #3 is established between device #1 and device #3 using BLE, physical connection #4 is established using BT, and so on.

[0047] In one example, if two devices that need to establish a physical connection simultaneously initiate a connection request, for example, electronic device #1 initiates a connection request to electronic device #2, and in the process of establishing a physical connection with electronic device #2, electronic device #2 also initiates a connection request to electronic device #1, then there may be a situation where the same connection protocol type corresponds to two physical connections.

[0048] In the embodiment of the present disclosure, when it is determined that two physical connections corresponding to the same connection protocol type are established, one of the physical connections can be disconnected to ensure that each link protocol type between devices corresponds to one physical connection, which effectively saves connection resource usage between devices and has high availability.

[0049] In the embodiment of the present disclosure, the physical connection module 101 can also be based on the environment monitoring module 109 ( Figure 1 It is responsible for link heartbeat maintenance, monitoring device environment changes, and timely sensing connection status changes.

[0050] The link heartbeat maintenance may refer to maintaining a local area network connection.

[0051] Among them, the device environment changes may include but are not limited to network disconnection, Bluetooth switch being turned off, the screen of the electronic device being off, the operating system being in sleep mode, etc.

[0052] The connection status change includes but is not limited to whether the physical connection between devices is disconnected.

[0053] In some embodiments, the logical connection module 102 may be connected to the physical connection module 101, wherein the logical connection module 102 may reuse the established physical connection to establish one or more logical connections between devices to transmit service data.

[0054] In some embodiments, the number of logical connections refers to the number of virtual logical connections established between devices, and the number of services refers to the number of services executed between devices.

[0055] In some embodiments, the one-to-one correspondence between the number of logical connections and the number of services means that one logical connection can be established for each service between the same two devices. For example, logical connection #1 can be established between device #1 and device #2 for service #1, and logical connection #2 can be established between device #1 and device #2 for service #2. . . .

[0056] In the embodiments of the present disclosure, one or more logical connections may be established on one physical connection, and these logical connections may reuse the transmission channel of the same physical connection.

[0057] In the embodiment of the present disclosure, each logical connection may correspond to a different device authentication method, wherein the device authentication method includes but is not limited to any of the following: same account authentication method; point-to-point device authentication method, etc.

[0058] Among them, the same account device authentication method refers to the negotiation of secret keys and authentication between devices based on cloud certificates, which is the most secure authentication method. Among them, the point-to-point device authentication method refers to the negotiation of secret keys and authentication based on Elliptic Curve Diffie-Hellman key Exchange (ECDH) after binding through a binding code.

[0059] In the above embodiment, the connection is divided into two layers: physical connection and logical connection, which are managed by physical connection module and logical connection module, and multiple logical connections can reuse one physical connection, thereby realizing the coexistence and reuse of connections. Under the premise of meeting different business requirements, the established physical connection is reused to establish a logical connection, which can improve the low-latency connection experience for the business and have high availability.

[0060] In some optional embodiments, reference Figure 2 As shown, Figure 2 is based on Figure 1 The connection architecture shown in the figure shows another connection structure. The connection architecture 100 may also include but is not limited to at least one of the following:

[0061] One or more first interfaces 103, wherein the first interfaces 103 correspond to the connection protocol types one by one;

[0062] A link management module 104 connected to one or more of the first interfaces 103 and the physical connection module 101, used to provide a connection interface for establishing a physical connection between devices;

[0063] The transmission management module 105 connected to one or more of the first interfaces 103, the link management module 104 and the physical connection module 101 is used to provide a data transmission interface for service data transmission between devices.

[0064] In some embodiments, a corresponding first interface 103 may be provided for each connection protocol type. Figure 2 As shown, BLE corresponds to the first interface 103-1, BT corresponds to the first interface 103-2, WLAN corresponds to the first interface 103-3, and P2P corresponds to the first interface 103-4.

[0065] It is understandable that if there is a new connection protocol type, the number of the first interfaces 103 can be expanded, for example, the new connection protocol type #1 corresponds to the first interface 103-5, and so on.

[0066] In some embodiments, each connection protocol type may also provide multiple first interfaces, so that when a connection needs to be established between a large number of devices, the problem of being unable to establish a connection due to being unable to call the first interface corresponding to the adopted connection protocol type can be avoided.

[0067] In some embodiments, multiple connection protocol types may also correspond to one first interface, which is not limited in the present disclosure.

[0068] In some embodiments, the link management module 104 may be connected to each first interface 103 and the physical connection module 101. The link management module 104 is used to shield protocol differences between different connection protocol types, establish a basic link connection between devices, and provide a unified connection interface for establishing a physical connection between devices.

[0069] Among them, the link management module 104 establishes a basic link connection between devices, which can be understood as the link management module 104 is able to realize the establishment of a physical connection between devices, that is, a connection interface has been provided for the establishment of a physical connection, but the physical connection module 101 is still needed to actually establish the final physical connection.

[0070] It is understandable that the physical connection module 101 does not need to pay attention to the specific first interface 103 called by the link management module 104 . The physical connection module 101 can establish a physical connection between devices through the unified connection interface provided by the link management module 104 .

[0071] In some embodiments, the transmission management module 105 may be connected to each first interface 103, link management module 104 and physical connection module 101. The transmission management module 105 is used to shield the protocol differences of different connection protocol types, and provide a unified service transmission interface based on the above link connection provided by the link management module 104 to perform service data transmission between devices, such as sending and / or receiving service data.

[0072] In addition, the transmission management module 105 can also be used for business data queue management, quality of service (Quality of Service, QoS) control, etc., which is not limited in the present disclosure.

[0073] It is understandable that, for the logical connection module 102, there is no need to pay attention to the specific first interface 103 called by the transmission management module 105. When performing business data transmission with the peer device based on the logical connection (each logical connection is established based on the actual physical connection), the unified data transmission interface provided by the transmission management module 105 can be directly called. Among them, the peer device is the electronic device at the opposite end that establishes a connection with the current electronic device, and is hereinafter referred to as the peer device.

[0074] In the above embodiments, the high scalability of the connection architecture can be achieved through the system adaptation layer, including but not limited to the link management module, the transmission management module, etc. And because the connection is divided into two layers, physical connection and logical connection, it is managed through the physical connection module and the logical connection module, and multiple logical connections can reuse one physical connection, which realizes the coexistence and reuse of connections. Under the premise of meeting different business needs, the established physical connection is reused to establish a logical connection, which can improve the low-latency connection experience for the business. When it is necessary to expand to a new platform, a new device or a new connection protocol type, it can be achieved by extending the link management module, the transmission management module, the first interface, etc., with high availability.

[0075] In some optional embodiments, reference Figure 3 As shown, Figure 3 is based on Figure 2 The connection architecture shown in the figure shows another connection structure. The connection architecture 100 may also include but is not limited to at least one of the following:

[0076] An application program interface 106 for connecting the application layer and the logic connection module 102;

[0077] The device management module 107 connected to the physical connection module 101 is used to store information of connected devices.

[0078] In some embodiments, the application program interface 106 may be an API interface for connecting an application program of the application layer and the logic connection module 102. In the present disclosure, the connection between devices established based on the instruction of the application layer actually refers to a logical connection.

[0079] In some embodiments, the device management module 107 can be connected to the physical connection module 101 to save the information of the connected device. The information of the connected device includes but is not limited to at least one of the identification of the opposite device that has established a connection with the electronic device, the type of the opposite device that has established a connection with the electronic device, the name of the opposite device that has established a connection with the electronic device, and the type of the connection protocol between the electronic device and the opposite device.

[0080] In the above embodiment, the logical connection module can be connected to the application layer through the application program interface to establish corresponding logical connections for the business in a timely manner, thereby improving the speed of establishing logical connections, thereby improving the transmission efficiency of business data, and the information of connected devices can be saved separately in the device management module, thereby improving the reliability of connection maintenance between devices.

[0081] In some optional embodiments, the physical connection module 101 can be further split, referring to Figure 4 As shown, Figure 4is based on Figure 1 , Figure 2 or Figure 3 A schematic diagram of another connection architecture is shown in an embodiment, wherein the physical connection module 101 can be used as a physical connection server to receive a physical connection request initiated by a peer device, and / or the physical connection module 101 can be used as a physical connection client to initiate a physical connection request to the peer device.

[0082] Figure 4 The connection architecture shown also includes but is not limited to at least one of the following:

[0083] A first protocol interaction module 108 connected to the physical connection module 101, used for performing signaling interaction in the process of establishing the physical connection;

[0084] The environment monitoring module 109 connected to the physical connection module 101 is used to monitor the device environment and / or determine the connection status between devices.

[0085] In some embodiments, the first protocol interaction module 108 may be connected to the physical connection module 101 and used to perform signaling interaction with the peer device during the process of establishing the physical connection. The electronic device may obtain information of the peer device by performing signaling interaction with the peer device, including but not limited to the peer device identifier, the peer device type, the peer device name, etc.

[0086] In some embodiments, the environment monitoring module 109 may be connected to the physical connection module 101 and used to monitor the device environment and / or determine the connection status between devices so as to provide the information to the physical connection module 101 .

[0087] In one example, the environment monitoring module 109 monitors the device environment, including but not limited to detecting whether the network is disconnected, whether the Bluetooth switch is turned off, whether the screen of the electronic device is off, whether the system is in sleep mode, etc.

[0088] In one example, the environment monitoring module 109 determines the connection status between devices, which may include but is not limited to determining whether the local area network is disconnected.

[0089] In the above embodiment, the physical connection may be further split, and other functional modules connected to the physical connection module may be added to improve the reliability of the physical connection.

[0090] In some optional embodiments, the logical connection module 102 may be further split, referring to Figure 5 As shown, Figure 5 is based on Figure 1 , Figure 2 or Figure 3A schematic diagram of another connection architecture is shown in an embodiment, wherein the logical connection module 102 is used to serve as a logical connection server to receive a logical connection request initiated by a peer device, and / or the logical connection module 102 can be used to serve as a logical connection client to initiate a logical connection request to the peer device.

[0091] Figure 5 The connection architecture shown also includes at least one of the following:

[0092] A second protocol interaction module 110 connected to the logical connection module 102, configured to perform signaling interaction in the process of establishing the logical connection;

[0093] A device authentication module 111 connected to the logic connection module 102, used to provide a device authentication method corresponding to each of the services;

[0094] A connection multiplexing module 112 connected to the physical connection module 101 and the logical connection module 102, used for managing and / or multiplexing the physical connection;

[0095] The connection upgrade module 113 connected to the physical connection module 101 and the logical connection module 102 is used to establish a first type of physical connection and / or a second type of physical connection between devices; wherein the first type of physical connection is a type of physical connection established based on the address of the peer device, and the second type of physical connection is a type of physical connection established after obtaining the address of the peer device based on the established first type of physical connection.

[0096] In some embodiments, the second protocol interaction module 110 may be connected to the logic connection module 102 and configured to perform signaling interaction with the opposite device during the process of establishing the logic connection.

[0097] In some embodiments, the device authentication module 111 may be connected to the logic connection module 102 and used to provide a device authentication method corresponding to each of the services. The logical connection is a virtual connection provided for the service, thereby achieving the purpose of supporting different device authentication methods.

[0098] In some embodiments, the connection multiplexing module 112 may be connected to the physical connection module 101 and the logical connection module 102. The connection multiplexing module 112 is used to manage and / or multiplex the physical connections.

[0099] In one example, the connection multiplexing module 112 is used to manage the currently established physical connection (including the physical connection actively or passively established by the electronic device). Specifically, when the reference count corresponding to the physical connection is 0, the established physical connection is disconnected. The reference count is used to count the number of logical connections established based on the physical connection.

[0100] It is understandable that when the number of logical connections established based on an established physical connection is 0, it means that no service occupies the physical connection for service data transmission. In this case, in order to avoid wasting connection resources, the physical connection can be disconnected.

[0101] Alternatively, when the reference count corresponding to the physical connection is not 0, the established physical connection continues to be maintained.

[0102] It is understandable that when the number of logical connections established based on an established physical connection is not 0, it means that there are still businesses that need to occupy the physical connection for business data transmission. At this time, in order to avoid affecting business data transmission, the physical connection should continue to be maintained.

[0103] In one example, the connection multiplexing module 112 is used to multiplex the physical connection, including but not limited to any of the following:

[0104] The application specifies a first connection protocol type and has established a first physical connection corresponding to the first connection protocol type. In this case, the first physical connection can be directly reused to establish one or more logical connections.

[0105] The application specifies a first connection protocol type, but does not establish a first physical connection corresponding to the first connection protocol type. At this time, the connection multiplexing module 112 may request the physical connection module to establish a first physical connection corresponding to the first connection protocol type, so that after the first physical connection is established, the first physical connection is reused to establish one or more logical connections.

[0106] The application does not specify the first connection protocol type. In this case, the connection multiplexing module 112 may determine the second connection protocol type based on the first factor, and when a second physical connection corresponding to the second connection protocol type has been established, the second physical connection is directly multiplexed to establish one or more logical connections;

[0107] When the application does not specify the first connection protocol type, the connection multiplexing module 112 can determine the second connection protocol type based on the first factor. When the second physical connection corresponding to the second connection protocol type is not established, the connection multiplexing module 112 can request the physical connection module to establish a second physical connection so that after the second physical connection is established, the second physical connection can be multiplexed to establish one or more logical connections.

[0108] In one example, the first factor may include but is not limited to at least one of the following: connection speeds corresponding to different types of connection protocols; transmission speeds corresponding to different types of connection protocols; whether there is an established physical connection; whether the established physical connection can be reused; whether the established physical connection can be preempted.

[0109] Exemplarily, the priorities of different first factors can be set. For example, the priority of an established physical connection is the highest. As long as a physical connection has been established between devices, the connection protocol type corresponding to the physical connection can be determined as the second connection protocol type. Thus, the established physical connection can be directly reused to establish a logical connection.

[0110] Exemplarily, when multiple physical connections have been established between devices, the second connection type can be determined according to whether the established physical connection can be preempted. For example, if physical connection #1 corresponding to BLE and physical connection #2 corresponding to BT have been established, and physical connection #1 can be preempted, the second connection protocol type can be BLE.

[0111] Exemplarily, when no physical connection is established between devices, the second connection protocol type can be determined by selecting according to connection speeds, transmission speeds, etc. corresponding to different connection protocol types.

[0112] The above description is merely an exemplary description, and the present disclosure does not limit the solution of the connection multiplexing module 112 automatically determining the connection protocol type.

[0113] In the disclosed embodiment, the service itself does not need to specify the connection protocol type. It can dynamically decide whether to reuse the existing physical connection or whether to establish a new physical connection based on the service usage scenario, current environment, etc., thereby balancing the relationship between connection technology, connection data and performance, and power consumption when multiple devices are interconnected.

[0114] In some embodiments, the connection upgrade module 113 may be connected to the physical connection module 101 and the logical connection module 102. The connection upgrade module 113 is used to establish a first type of physical connection and / or a second type of physical connection between devices.

[0115] In the embodiments of the present disclosure, the physical connections between devices may be further classified, illustratively, into a first type of physical connection and a second type of physical connection.

[0116] In an example, the first type of physical connection may be a basic connection, which is a type of physical connection established based on the peer device address, including but not limited to the following scenarios:

[0117] Physical connection based on broadcast discovery: electronic devices can discover the address of peer devices through broadcast messages, and then directly establish a physical connection with the peer device based on the address of the peer device. It can be applicable to but not limited to connection protocol types such as BLE and WLAN;

[0118] Address-based connection: The address of the peer device is obtained through methods other than broadcast messages, such as QR code scanning, manual input, etc., and a connection is established with the peer device based on the peer device address. It can be applicable to but not limited to BT, BLE, P2P and other connection protocol types.

[0119] In an example, the second type of physical connection may be an advanced connection, which is a type of physical connection established after acquiring the address of the opposite device based on the established first type of physical connection.

[0120] The electronic device can exchange the roles of the two end devices and the address of the opposite end device based on the established first type of physical connection or create a new first type of physical connection, and then establish a second type of physical connection based on the opposite end device address. It can be applicable to but not limited to BT, P2P and other connection protocol types.

[0121] For example, after obtaining the address of the peer device through a first type of physical connection established between devices, such as a BLE connection, a second type of physical connection, such as a P2P connection, is established with the peer device based on the address of the peer device.

[0122] The above is only an exemplary description, and all solutions for establishing a second type of physical connection after acquiring the address of the opposite device based on the first type of physical connection should fall within the protection scope of the present disclosure.

[0123] In the above embodiment, the logical connection can be further split, and functional modules connected to the logical connection module and the physical connection module can be added to realize the management and reuse of the existing physical connection, speed up the establishment of the logical connection, support different device authentication methods, and have high availability.

[0124] Reference Figure 6 As shown, Figure 6 is a flow chart of a method for establishing a connection shown in an exemplary embodiment of the present disclosure, and the method can be executed by the above electronic device. Figures 1 to 5 Any connection architecture as described in claim 1, Figure 6 As shown, the method may include:

[0125] In step 601, the target connection protocol type is determined.

[0126] In some embodiments, the electronic device is a connection initiating device.

[0127] In one example, in response to receiving a first connection protocol type specified by an application, the first connection protocol type is determined as the target connection protocol type.

[0128] In one example, in response to not receiving the first connection protocol type specified by the application, the electronic device may determine the second connection protocol type based on the first factor, and determine the second connection protocol type as the target connection protocol type.

[0129] Among them, the first factor includes but is not limited to at least one of the following: the connection speed corresponding to different types of connection protocols; the transmission speed corresponding to different types of connection protocols; whether there is an established physical connection; whether the established physical connection can be reused; whether the established physical connection can be preempted.

[0130] The scheme for the electronic device to determine the second connection protocol type based on the first factor is similar to the scheme for determining the second connection type in the above embodiment, and will not be described in detail herein.

[0131] In some embodiments, the electronic device is a device that receives a connection request. In this case, the electronic device can determine the target connection protocol type through the connection request sent by the peer device.

[0132] In step 602, in response to the existence of a target physical connection corresponding to the target connection protocol type, the target physical connection is multiplexed to establish one or more target logical connections to transmit service data.

[0133] The target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one by one.

[0134] In the disclosed embodiment, the electronic device, whether it is a device that initiates a connection request or a device that receives a connection request, can directly reuse the target physical connection to establish one or more corresponding target logical connections to transmit service data when there is a target physical connection corresponding to the target connection protocol type. The target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one-to-one.

[0135] In step 603, in response to the absence of a target physical connection corresponding to the target connection protocol type, after establishing the target physical connection based on the target connection protocol type, one or more target logical connections are established based on the target physical connection to transmit business data.

[0136] The target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one by one.

[0137] Among them, different services may correspond to different device authentication methods.

[0138] In the disclosed embodiment, the electronic device, whether it is a device that initiates a connection request or a device that receives a connection request, can establish the target physical connection based on the target connection protocol type when there is no target physical connection, for example, the connection multiplexing module initiates a request message to the physical connection module, requesting the physical connection module to establish the target physical connection. Then, one or more target logical connections are established based on the target physical connection to transmit service data.

[0139] The above step 602 and step 603 can be performed alternatively.

[0140] In the above embodiment, if there is an established target physical connection, the target physical connection can be directly reused to establish a target logical connection, thereby improving the efficiency of establishing the logical connection. If there is no target physical connection, the service does not need to specify the connection protocol type, thereby balancing the relationship between the connection protocol type, the number of connections, performance, and power consumption, and achieving high availability.

[0141] In some embodiments, reference Figure 7 As shown, Figure 7 is Figure 6 A schematic flow chart of another method for establishing a connection based on the embodiment shown, which can be executed by the above electronic device. Figures 1 to 5 Any connection architecture as described in claim 1, Figure 7 As shown, the method may also include:

[0142] In step 604, in response to the target reference count corresponding to the target physical connection being 0, the target physical connection is disconnected.

[0143] The target reference count is used to count the number of target logical connections established based on the target physical connection.

[0144] In the embodiment of the present disclosure, if the target reference count is 0, the target physical connection may be disconnected.

[0145] In step 605, in response to the target reference count corresponding to the target physical connection being not 0, the target physical connection is maintained.

[0146] The target reference count is used to count the number of target logical connections established based on the target physical connection.

[0147] In the embodiment of the present disclosure, if the target reference count is not 0, the target physical connection may continue to be maintained.

[0148] The above steps 604 and 605 can be performed either one of them.

[0149] In the above embodiment, the number of target references corresponding to the target physical connection can be counted. When there is no business need to occupy the target physical connection, the target physical connection can be disconnected to reduce the occupation of connection resources. When there is a business need to continue to occupy the target physical connection, the target physical connection can continue to be maintained to ensure business data transmission with high availability.

[0150] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device embodiment.

[0151] Reference Figure 8 , Figure 8 is a block diagram of a device for establishing a connection according to an exemplary embodiment, the device comprising:

[0152] Determination module 801, used to determine the target connection protocol type;

[0153] The first execution module 802 is used for, in response to the existence of a target physical connection corresponding to the target connection protocol type, multiplexing the target physical connection to establish one or more target logical connections to transmit service data; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one by one; or

[0154] The second execution module 803 is used to establish one or more target logical connections based on the target physical connection to transmit business data in response to the absence of a target physical connection corresponding to the target connection protocol type, after establishing the target physical connection based on the target connection protocol type; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target business one-to-one.

[0155] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.

[0156] Accordingly, the present disclosure further provides a computer-readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the computer program is used to implement the steps of any of the above methods for establishing a connection.

[0157] Correspondingly, the present disclosure also provides an electronic device, which can deploy any of the connection architectures described above to establish a connection between devices.

[0158] Accordingly, the present disclosure also provides a terminal, including:

[0159] processor;

[0160] a memory for storing processor-executable instructions;

[0161] The processor is configured to execute the executable instructions to implement the steps of any one of the above methods for establishing a connection.

[0162] Fig. 9 900 is a block diagram of a device for establishing a connection according to an exemplary embodiment. For example, the device 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or other terminal.

[0163] Reference Fig. 9 , the device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 916 , and a communication component 918 .

[0164] The processing component 902 generally controls the overall operation of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.

[0165] One of the processors 920 in the processing component 902 may be configured to execute any of the above-mentioned methods for establishing a connection.

[0166] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0167] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.

[0168] The multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0169] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 918. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0170] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0171] The sensor assembly 916 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 916 can detect the open / closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor assembly 916 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 916 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 916 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 916 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0172] The communication component 918 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 3G, 4G, 5G, 6G or a combination thereof. In an exemplary embodiment, the communication component 918 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 918 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0173] In an exemplary embodiment, the apparatus 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0174] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by the processor 920 of the device 900 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0175] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also 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 statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0176] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0177] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A connection architecture, characterized in that: include: A physical connection module, used to establish a physical connection between devices based on a connection protocol type; wherein the number of connection protocol types corresponds one-to-one to the number of physical connections established; The logical connection module connected to the physical connection module is used to multiplex the established physical connection to establish one or more logical connections between devices to transmit business data; wherein the number of logical connections corresponds to the number of services.

2. The connection architecture according to claim 1, characterized in that: Also includes at least one of the following: One or more first interfaces, the first interfaces corresponding to the connection protocol types one by one; A link management module connected to one or more of the first interfaces and the physical connection module, used to provide a connection interface for establishing the physical connection between devices; The transmission management module connected to one or more of the first interfaces, the link management module and the physical connection module is used to provide a data transmission interface for business data transmission between devices.

3. The connection architecture according to claim 1, characterized in that: Also includes at least one of the following: An application program interface for connecting the application layer and the logical connection module; The device management module connected to the physical connection module is used to store information of connected devices.

4. The connection architecture according to claim 1, characterized in that: Also includes at least one of the following: A first protocol interaction module connected to the physical connection module, used for performing signaling interaction in the process of establishing the physical connection; The environment monitoring module connected to the physical connection module is used to monitor the device environment and / or determine the connection status between devices.

5. The connection architecture according to any one of claims 1 to 4, characterized in that: The physical connection module is also used for at least one of the following: Receive physical connection requests as a physical connection server; Initiates a physical connection request as a physical connection client.

6. The connection architecture according to claim 1, characterized in that: Also includes at least one of the following: A second protocol interaction module connected to the logical connection module, used for performing signaling interaction in the process of establishing the logical connection; A device authentication module connected to the logic connection module, used to provide a device authentication method corresponding to each of the services; A connection multiplexing module connected to the physical connection module and the logical connection module, used for managing and / or multiplexing the physical connection; A connection upgrade module connected to the physical connection module and the logical connection module is used to establish a first type of physical connection and / or a second type of physical connection between devices; wherein the first type of physical connection is a type of physical connection established based on the address of the peer device, and the second type of physical connection is a type of physical connection established after obtaining the address of the peer device based on the established first type of physical connection.

7. The connection architecture according to claim 6, characterized in that: The connection multiplexing module is further configured to perform any of the following: When the reference count corresponding to the physical connection is 0, disconnect the established physical connection; wherein the reference count is used to count the number of logical connections established based on the physical connection; When the reference count corresponding to the physical connection is not 0, the established physical connection is maintained; wherein the reference count is used to count the number of logical connections established based on the physical connection; Based on a first connection protocol type specified by an application, multiplexing an established first physical connection corresponding to the first connection protocol type to establish one or more logical connections; Based on a first connection protocol type specified by the application, requesting the physical connection module to establish a first physical connection corresponding to the first connection protocol type; After not receiving the first connection protocol type specified by the application, based on the first factor, after determining the second connection protocol type, multiplexing the established second physical connection corresponding to the second connection protocol type to establish one or more logical connections; The first connection protocol type specified by the application is not received, and after determining the second connection protocol type based on the first factor, the physical connection module is requested to establish a second physical connection corresponding to the second connection protocol type.

8. The connection architecture according to claim 7, characterized in that: The first factor includes at least one of the following: The connection speeds corresponding to the different types of connection protocols; The transmission speeds corresponding to the different types of connection protocols; Whether there is an established physical connection; Whether the established physical connection can be reused; Whether an established physical connection can be preempted.

9. The connection architecture according to any one of claims 1-4 or 6-8, characterized in that: The logic connection module is also used for at least one of the following: Receive logical connection requests as a logical connection server; Initiates a logical connection request as a logical connection client.

10. A method for establishing a connection, characterized in that: The method comprises: Determine the target connection protocol type; In response to the existence of a target physical connection corresponding to the target connection protocol type, multiplexing the target physical connection to establish one or more target logical connections to transmit service data; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one-to-one; or In response to the absence of a target physical connection corresponding to the target connection protocol type, after establishing the target physical connection based on the target connection protocol type, one or more target logical connections are established based on the target physical connection to transmit business data; wherein, the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds one-to-one to the target business.

11. The method according to claim 10, characterized in that The method further comprises any of the following: In response to the target reference count corresponding to the target physical connection being 0, disconnecting the target physical connection; wherein the target reference count is used to count the number of target logical connections established based on the target physical connection; In response to the target reference count corresponding to the target physical connection being not 0, maintaining the target physical connection; wherein the target reference count is used to count the number of target logical connections established based on the target physical connection.

12. The method according to claim 10, characterized in that The determining of the target connection protocol type includes any of the following: In response to receiving a first connection protocol type specified by an application, determining the first connection protocol type as the target connection protocol type; In response to not receiving the first connection protocol type specified by the application, determining a second connection protocol type as the target connection protocol type; wherein the second connection protocol type is determined based on a first factor; In response to receiving a connection request message, the target connection protocol type is determined based on the connection request message.

13. A device for establishing a connection, characterized in that: The device comprises: A determination module, used for determining a target connection protocol type; A first execution module is used for, in response to the existence of a target physical connection corresponding to the target connection protocol type, multiplexing the target physical connection to establish one or more target logical connections to transmit service data; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds to the target service one by one; or The second execution module is used to establish one or more target logical connections based on the target physical connection to transmit business data in response to the absence of a target physical connection corresponding to the target connection protocol type, after establishing the target physical connection based on the target connection protocol type; wherein the target connection protocol type corresponds to one target physical connection, and the target logical connection corresponds one-to-one to the target business.

14. An electronic device, characterized in that: The electronic device adopts the connection architecture described in any one of claims 1-9.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for establishing a connection described in any one of claims 10 to 13 are implemented.

16. A terminal, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the steps of the method for establishing a connection as described in any one of claims 10-13.