CN114928899B - Physical link establishment method and electronic equipment - Google Patents
Physical link establishment method and electronic equipment Download PDFInfo
- Publication number
- CN114928899B CN114928899B CN202210841718.8A CN202210841718A CN114928899B CN 114928899 B CN114928899 B CN 114928899B CN 202210841718 A CN202210841718 A CN 202210841718A CN 114928899 B CN114928899 B CN 114928899B
- Authority
- CN
- China
- Prior art keywords
- communication interface
- count value
- electronic device
- interface module
- physical link
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/30—Connection release
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请实施例提供了一种物理链路的建立方法和电子设备,该方法由第一电子设备执行,第一电子设备包括第一通信接口模块和第一业务模块,第二电子设备包括第二通信接口模块,该方法包括:第一通信接口模块接收第一业务模块发送的第一连接请求,第一连接请求用于指示第一通信接口模块建立第一物理链路;响应于第一连接请求,第一通信接口模块获取第一总计数值;在第一总计数值大于0的情况下,第一通信接口模块向第二通信接口模块发送第一复用连接请求,并将第一总计数值加一,第一复用连接请求用于向第二通信接口模块请求复用第一物理链路。该方法能够实现对物理链路的复用。
Embodiments of the present application provide a method and electronic device for establishing a physical link. The method is executed by a first electronic device, where the first electronic device includes a first communication interface module and a first service module, and the second electronic device includes a second electronic device. a communication interface module, the method includes: the first communication interface module receives a first connection request sent by the first service module, where the first connection request is used to instruct the first communication interface module to establish a first physical link; in response to the first connection request , the first communication interface module obtains the first total value; if the first total value is greater than 0, the first communication interface module sends a first multiplexing connection request to the second communication interface module, and adds one to the first total value , the first multiplexing connection request is used to request multiplexing of the first physical link from the second communication interface module. The method enables multiplexing of physical links.
Description
技术领域technical field
本申请涉及通信技术领域,具体涉及一种物理链路的建立方法和电子设备。The present application relates to the technical field of communications, and in particular to a method for establishing a physical link and an electronic device.
背景技术Background technique
设备间的短距离无线通信技术,例如无线保真端对端(wireless fidelity peerto peer,Wi-Fi p2p)技术、蓝牙(bluetooth,BT)技术等,给用户带来了很大的方便。以Wi-Fi p2p技术为例来说,两个设备可以基于Wi-Fi p2p技术建立Wi-Fi p2p物理链路,并进一步建立逻辑链路,从而使两个设备间能够直接传输数据,以完成文件传输、投屏、联机游戏等业务。Short-range wireless communication technologies between devices, such as wireless fidelity peer to peer (Wi-Fi p2p) technology, Bluetooth (bluetooth, BT) technology, etc., have brought great convenience to users. Taking Wi-Fi p2p technology as an example, two devices can establish a Wi-Fi p2p physical link based on Wi-Fi p2p technology, and further establish a logical link, so that data can be directly transmitted between the two devices to complete File transfer, screen projection, online games and other services.
相关技术中,设备间的Wi-Fi p2p物理链路是通过应用程序(application,APP)中的通信模块建立。然而,同一时刻,一个设备能够建立的Wi-Fi p2p物理链路是有限的,一般为1个或2个。若当前两个设备之间的Wi-Fi p2p物理链路被某一应用程序占用,其他的应用程序需要传输数据时,只能通过抢占、重新建立或等待的方式获得Wi-Fi p2p物理链路,存在效率低下的问题。In related technologies, a Wi-Fi p2p physical link between devices is established through a communication module in an application program (application, APP). However, at the same time, the number of Wi-Fi p2p physical links that a device can establish is limited, usually 1 or 2. If the current Wi-Fi p2p physical link between the two devices is occupied by an application, when other applications need to transmit data, they can only obtain the Wi-Fi p2p physical link by preempting, re-establishing or waiting. , there is a problem of low efficiency.
发明内容Contents of the invention
本申请提供了一种物理链路的建立方法和电子设备,能够实现物理链路的复用,解决物理链路建立效率低下的问题。The present application provides a method for establishing a physical link and an electronic device, which can realize the multiplexing of the physical link and solve the problem of low efficiency of establishing the physical link.
第一方面,本申请提供一种物理链路的建立方法,用于建立第一电子设备与第二电子设备之间的第一物理链路,该方法由第一电子设备执行,第一电子设备包括第一通信接口模块和第一业务模块,第二电子设备包括第二通信接口模块,该方法包括:第一通信接口模块接收第一业务模块发送的第一连接请求,第一连接请求用于指示第一通信接口模块建立第一物理链路;响应于第一连接请求,第一通信接口模块获取第一总计数值,第一总计数值存储于第一电子设备、表征第一电子设备和第二电子设备对第一物理链路的有效请求次数,有效请求次数通过对有效连接请求次数和有效断开连接请求次数进行计数得到,第一总计数值的初始值为0;在第一总计数值大于0的情况下,第一通信接口模块向第二通信接口模块发送第一复用连接请求,并将第一总计数值加一,第一复用连接请求用于向第二通信接口模块请求复用第一物理链路。In the first aspect, the present application provides a method for establishing a physical link, which is used to establish a first physical link between a first electronic device and a second electronic device, the method is executed by the first electronic device, and the first electronic device It includes a first communication interface module and a first service module, the second electronic device includes a second communication interface module, and the method includes: the first communication interface module receives a first connection request sent by the first service module, and the first connection request is used for Instructing the first communication interface module to establish a first physical link; in response to the first connection request, the first communication interface module acquires a first total count value, the first total count value is stored in the first electronic device, and represents the first electronic device and the second The number of valid requests of the electronic device to the first physical link, the number of valid requests is obtained by counting the number of valid connection requests and the number of valid disconnection requests, the initial value of the first total count value is 0; when the first total count value is greater than 0 In the case of , the first communication interface module sends the first multiplexing connection request to the second communication interface module, and adds one to the first total count value, and the first multiplexing connection request is used to request the second communication interface module to multiplex the second a physical link.
第一总计数值大于0,表征当前第一电子设备和第二电子设备对第一物理链路的有效请求次数大于0,表明当前第一物理链路已建立,因而可以复用第一物理链路。The first total count value is greater than 0, indicating that the current number of valid requests for the first physical link by the first electronic device and the second electronic device is greater than 0, indicating that the current first physical link has been established, so the first physical link can be reused .
可选的,第一连接请求中可以包括第一业务模块对应的业务标识信息、第二电子设备的物理地址信息以及第一物理链路的链路类型等中的一个或多个。其中,业务标识信息例如可以为第一业务模块对应的进程标识(process identification,PID)。链路类型例如可以为Wi-Fi p2p链路、蓝牙基本速率(basic rate,BR)链路、蓝牙套接字(Socket)链路或蓝牙增强数据速率(enhanced data rate,EDR)链路等中的一种。Optionally, the first connection request may include one or more of service identification information corresponding to the first service module, physical address information of the second electronic device, and link type of the first physical link. Wherein, the service identification information may be, for example, a process identification (process identification, PID) corresponding to the first service module. The link type can be, for example, a Wi-Fi p2p link, a Bluetooth basic rate (basic rate, BR) link, a Bluetooth socket (Socket) link, or a Bluetooth enhanced data rate (enhanced data rate, EDR) link, etc. kind of.
可选的,第一复用连接请求中可以包括第一电子设备的物理地址信息和第一物理链路的链路标识等中的一个或多个。Optionally, the first multiplexed connection request may include one or more of physical address information of the first electronic device, a link identifier of the first physical link, and the like.
可选的,第一通信接口模块可以在确定第一总计数值大于0的情况下,直接将第一总计数值加一,也可以在收到第二通信接口模块发送的第一复用回复信息后再将第一总计数值加一,本申请实施例对此不做任何限定。Optionally, the first communication interface module may directly add one to the first total count value when it is determined that the first total count value is greater than 0, or after receiving the first multiplexing reply message sent by the second communication interface module Then add one to the first total value, which is not limited in this embodiment of the present application.
本申请第一方面提供的物理链路的建立方法,通过第一通信接口模块和第二通信接口模块实现第一电子设备与第二电子设备之间物理链路的统一建立和管理,第一通信接口模块和第二通信接口模块作为物理链路的管理者,能够获知物理链路的所有信息,因而在需要时能够对物理链路进行复用,无需等待或重新建立物理链路,解决物理链路建立效率低下的问题,从而提高设备间数据传输的效率,提高用户体验。同时,复用物理链路也提高了物理链路的利用率,节约资源和功耗。另外,该方法通过管理第一总计数值,简单方便的对第一物理链路的有效请求次数进行管理,也即对第一电子设备和第二电子设备对第一物理链路的使用情况进行管理,从而在需要使用第一物理链路时,通过判断第一总计数值是否为0即能准确获知第一物理链路是否已建立,是否能够复用第一物理链路。而且,通过第一总计数值能够及时准确的获知第一物理链路是否使用完成,是否需要断开,便于需要时及时断开物理链路。总而言之,本实施例提供的方法能够提高第一电子设备和第二电子设备之间物理链路的管理效率和准确率,进而提高数据传输效率。而且,该方法中,在发送第一复用连接请求后,将第一总计数值加一,更新第一总计数值,保证了第一总计数值的准确性。In the method for establishing a physical link provided in the first aspect of the present application, the unified establishment and management of the physical link between the first electronic device and the second electronic device is realized through the first communication interface module and the second communication interface module. As the manager of the physical link, the interface module and the second communication interface module can know all the information of the physical link, so they can reuse the physical link when needed, without waiting or re-establishing the physical link, solving the problem of physical link The problem of low efficiency of road establishment can be solved, so as to improve the efficiency of data transmission between devices and improve user experience. At the same time, multiplexing physical links also improves the utilization of physical links, saving resources and power consumption. In addition, the method simply and conveniently manages the number of effective requests of the first physical link by managing the first total count value, that is, manages the usage of the first physical link by the first electronic device and the second electronic device , so that when the first physical link needs to be used, it can be accurately known whether the first physical link has been established and whether the first physical link can be reused by judging whether the first total count value is 0. Moreover, through the first total count value, it can be timely and accurately known whether the first physical link has been used and whether it needs to be disconnected, so that the physical link can be disconnected in time when necessary. In a word, the method provided in this embodiment can improve the management efficiency and accuracy of the physical link between the first electronic device and the second electronic device, thereby improving the data transmission efficiency. Moreover, in this method, after the first multiplexed connection request is sent, the first total count value is increased by one to update the first total count value, thereby ensuring the accuracy of the first total count value.
一种可能的实现方式中,该方法还包括:在第一总计数值等于0的情况下,第一通信接口模块向第二通信接口模块发送第二连接请求,第二连接请求用于请求与第二通信接口模块建立第一物理链路;响应于接收到第二通信接口模块发送的连接成功信息,第一通信接口模块将第一总计数值加一,连接成功信息表征第一物理链路建立成功。In a possible implementation manner, the method further includes: when the first total count value is equal to 0, the first communication interface module sends a second connection request to the second communication interface module, and the second connection request is used for requesting communication with the first The second communication interface module establishes the first physical link; in response to receiving the connection success information sent by the second communication interface module, the first communication interface module adds one to the first total count value, and the connection success information indicates that the first physical link is established successfully .
第一总计数值等于0,表征当前第一电子设备和第二电子设备对第一物理链路的有效请求次数为0,表明当前第一物理链路未建立,因而通过第一通信接口模块向第二通信接口模块发送第二连接请求,以建立第一物理链路。The first total count value is equal to 0, indicating that the number of effective requests for the first physical link by the first electronic device and the second electronic device is 0, indicating that the current first physical link has not been established, so the first communication interface module communicates with the first physical link The second communication interface module sends a second connection request to establish the first physical link.
该实现方式中,接收到第二通信接口模块发送的连接成功信息,说明第一连接请求为有效连接请求,将第一总计数值加一,更新第一总计数值,保证了第一总计数值的准确性。In this implementation, after receiving the connection success information sent by the second communication interface module, indicating that the first connection request is a valid connection request, the first total count value is increased by one, and the first total count value is updated to ensure the accuracy of the first total count value sex.
一种可能的实现方式中,该方法还包括:响应于接收到第二通信接口模块发送的第二复用连接请求,第一通信接口模块将第一总计数值加一,第二复用连接请求用于向第一通信接口模块请求复用第一物理链路。In a possible implementation manner, the method further includes: in response to receiving the second multiplexed connection request sent by the second communication interface module, the first communication interface module adds one to the first total count value, and the second multiplexed connection request It is used to request the first communication interface module to multiplex the first physical link.
具体的,第二电子设备中的某一业务模块向第二通信接口模块发送连接请求(第四连接请求),第二通信接口模块确定第二总计数值大于0的情况下,向第一通信接口模块发送第二复用连接请求。其中,第二总计数值存储于第二电子设备、表征第一电子设备和第二电子设备对第一物理链路的有效请求次数。第一通信接口模块接收到第二通信接口模块发送的第二复用连接请求,将第一总计数值加一。之后,第一通信接口模块还可以向第二通信接口模块发送第二复用回复信息,第二通信接口模块接收到第二复用回复信息后,将第二总计数值加一。Specifically, a certain service module in the second electronic device sends a connection request (fourth connection request) to the second communication interface module, and when the second communication interface module determines that the second total count value is greater than 0, it sends a connection request to the first communication interface module. The module sends a second multiplexing connection request. Wherein, the second total count value is stored in the second electronic device, and represents the number of valid requests for the first physical link by the first electronic device and the second electronic device. The first communication interface module receives the second multiplexing connection request sent by the second communication interface module, and adds one to the first total count value. Afterwards, the first communication interface module may also send second multiplexing reply information to the second communication interface module, and the second communication interface module adds one to the second total count value after receiving the second multiplexing reply information.
该实现方式中,在第二电子设备对第一物理链路进行复用时,也更新第一总计数值,将第一总计数值加一,进一步保证了第一总计数值的准确性,从而保证了对第一物理链路管理的准确性。In this implementation, when the second electronic device multiplexes the first physical link, it also updates the first total count value, and adds one to the first total count value, which further ensures the accuracy of the first total count value, thereby ensuring The accuracy of the management of the first physical link.
一种可能的实现方式中,在第一总计数值大于0的情况下,该方法还包括:第一通信接口模块将第一业务计数值加一,第一业务计数值表征第一业务模块对第一物理链路的有效请求次数。In a possible implementation manner, when the first total count value is greater than 0, the method further includes: the first communication interface module adds one to the first service count value, and the first service count value represents The number of valid requests for a physical link.
一种可能的实现方式中,该方法还包括:第一通信接口模块接收第一业务模块发送的第一断开连接请求,第一断开连接请求用于指示第一通信接口模块断开第一物理链路;响应于第一断开连接请求,在第一业务计数值大于0的情况下,第一通信接口模块将第一总计数值减一;在第一总计数值减一后等于0的情况下,第一通信接口模块向第二通信接口模块发送第二断开连接请求,第二断开连接请求用于向第二通信接口模块请求断开第一物理链路。In a possible implementation, the method further includes: the first communication interface module receives a first disconnection request sent by the first service module, and the first disconnection request is used to instruct the first communication interface module to disconnect the first Physical link; in response to the first disconnection request, when the first service count value is greater than 0, the first communication interface module decreases the first total count value by one; when the first total count value is equal to 0 after the first total count value is reduced by one Next, the first communication interface module sends a second disconnection request to the second communication interface module, where the second disconnection request is used to request the second communication interface module to disconnect the first physical link.
可选的,第一断开连接请求中可以包括第一业务模块的业务标识信息、第一物理链路的链路标识等中的一个或多个。第一业务计数值大于0,说明第一断开连接请求为有效断开连接请求。Optionally, the first disconnection request may include one or more of service identification information of the first service module, link identification of the first physical link, and the like. The first service count value is greater than 0, indicating that the first disconnection request is a valid disconnection request.
一种可能的实现方式中,响应于第一断开连接请求,在第一业务计数值大于0的情况下,该方法还包括:第一通信接口模块将第一业务计数值减一。In a possible implementation manner, in response to the first disconnection request, if the first service count value is greater than 0, the method further includes: the first communication interface module decrements the first service count value by one.
上述几种实现方式中,在第一业务模块请求断开物理链路时,确定第一业务模块对应的第一业务计数值大于0,即确定第一断开连接请求为有效断开连接请求时,才将第一总计数值和第一业务计数值分别减一。在确定第一业务计数值等于0,即断开连接请求为无效断开连接请求,不处理此次断开连接请求。这样能够保证第一业务计数值和第一总计数值的准确性,提高对物理链路管理的准确性。另外,该方法中,只有减一后的第一总计数值为0时才断开第一物理链路,最大程度复用第一物理链路,提高第一物理链路利用率。而且,无论第一物理链路由哪个业务模块发起建立,只要在接收到有效断开连接请求,减一后的第一总计数值为0,就断开连接第一物理链路。这样,第一物理链路的断开不用受限于发起连接的业务模块的限制,防止出现某一业务模块的发起的连接只能由该业务模块断开的情况,保证了业务模块之间的独立性,提高了电子设备业务功能的稳定性和可靠性。In the above several implementations, when the first service module requests to disconnect the physical link, it is determined that the first service count value corresponding to the first service module is greater than 0, that is, when it is determined that the first disconnection request is a valid disconnection request , the first total count value and the first service count value are decremented by one respectively. When it is determined that the first service count value is equal to 0, that is, the disconnection request is an invalid disconnection request, the disconnection request is not processed. In this way, the accuracy of the first service count value and the first total count value can be guaranteed, and the accuracy of physical link management can be improved. In addition, in this method, the first physical link is disconnected only when the first total count value after subtracting one is 0, the first physical link is multiplexed to the greatest extent, and the utilization rate of the first physical link is improved. Moreover, no matter which service module initiates the establishment of the first physical link, as long as the first total count value after subtracting one is 0 after receiving a valid disconnection request, the first physical link is disconnected. In this way, the disconnection of the first physical link does not need to be limited by the service module that initiates the connection, preventing the situation that the connection initiated by a certain service module can only be disconnected by the service module, and ensuring the connection between the service modules. Independence improves the stability and reliability of electronic equipment business functions.
一种可能的实现方式中,响应于第一断开连接请求,在第一总计数值减一后大于0的情况下,该方法还包括:第一通信接口模块向第二通信接口模块发送减少计数指令,减少计数指令用于指示将第二总计数值减一,第二总计数值存储于第二电子设备、表征第一电子设备和第二电子设备对第一物理链路的有效请求次数。In a possible implementation manner, in response to the first disconnection request, in the case where the first total count value is greater than 0 after being subtracted by one, the method further includes: the first communication interface module sends the decrement count value to the second communication interface module The instruction, the count reduction instruction is used to instruct to subtract one from the second total count value, the second total count value is stored in the second electronic device, and represents the number of valid requests for the first physical link by the first electronic device and the second electronic device.
该实现方式中,不满足断开第一物理链路的条件时,第一通信接口模块向第二通信接口模块发送减少计数指令,以同步更新第二电子设备中的第二总计数值,保证了第二总计数值的准确性,从而便于第二电子设备准确的获知当前对第一物理链路的有效请求次数,从而便于获知是否能够复用或断开第一物理链路,提高对第一物理链路管理的准确性。In this implementation, when the condition for disconnecting the first physical link is not met, the first communication interface module sends a count reduction instruction to the second communication interface module to synchronously update the second total count value in the second electronic device, ensuring The accuracy of the second total count value, so that the second electronic device can accurately know the current number of valid requests for the first physical link, so as to know whether the first physical link can be reused or disconnected, and improve the accuracy of the first physical link. Accuracy of link management.
一种可能的实现方式中,第一电子设备还包括第二业务模块,该方法还包括:第一通信接口模块接收第二业务模块发送的第三连接请求,第三连接请求用于指示第一通信接口模块建立第一物理链路;响应于第三连接请求,第一通信接口模块获取第一总计数值;在第一总计数值大于0的情况下,第一通信接口模块向第二通信接口模块发送第一复用连接请求,并将第一总计数值和第二业务计数值分别加一,第二业务计数值表征第二业务模块对第一物理链路的有效请求次数。In a possible implementation manner, the first electronic device further includes a second service module, and the method further includes: the first communication interface module receives a third connection request sent by the second service module, and the third connection request is used to instruct the first The communication interface module establishes the first physical link; in response to the third connection request, the first communication interface module obtains the first total count value; when the first total count value is greater than 0, the first communication interface module sends the second communication interface module Send the first multiplex connection request, and add one to the first total count value and the second service count value respectively, and the second service count value represents the number of valid requests for the first physical link by the second service module.
可选的,第三连接请求可以与第一连接请求类似,不同点在于第三连接请求中的业务标识信息为第二业务模块对应的业务标识信息。Optionally, the third connection request may be similar to the first connection request, except that the service identification information in the third connection request is service identification information corresponding to the second service module.
该实现方式中,在第一电子设备中除第一业务模块外的其他业务模块(第二业务模块)发起对第一物理链路的连接请求时,若确定第一总计数值大于0,即确定第一物理链路已存在,则更新第一总计数值,并更新第二业务模块对应的第二业务计数值。也就是说,该实现方式中,除第一业务模块能够复用第一物理链路外,其他业务模块也能够复用第一物理链路模块,且复用后更新计数值,保证计数值的准确性,提高对第一物理链路管理的准确性。In this implementation, when other service modules (second service modules) in the first electronic device other than the first service module initiate a connection request for the first physical link, if it is determined that the first total count value is greater than 0, it is determined If the first physical link already exists, the first total count value is updated, and the second service count value corresponding to the second service module is updated. That is to say, in this implementation, in addition to the first service module that can multiplex the first physical link, other service modules can also multiplex the first physical link module, and update the count value after multiplexing to ensure the accuracy of the count value. Accuracy, improving the accuracy of the management of the first physical link.
一种可能的实现方式中,第二电子设备还包括第三业务模块和第四业务模块,该方法还包括:第一业务模块根据第二电子设备的网络地址信息和第三业务模块的端口信息,基于第一物理链路,建立与第三业务模块之间的逻辑链路;第二业务模块根据第二电子设备的网络地址信息和第四业务模块的端口信息,基于第一物理链路,建立与第四业务模块之间的逻辑链路。In a possible implementation manner, the second electronic device further includes a third service module and a fourth service module, and the method further includes: the first service module according to the network address information of the second electronic device and the port information of the third service module , establish a logical link with the third service module based on the first physical link; the second service module, based on the first physical link, according to the network address information of the second electronic device and the port information of the fourth service module, Establish a logical link with the fourth service module.
该实现方式中,第一业务模块基于第一物理链路建立了与第三业务模块之间的逻辑链路,第二业务模块基于第一物理链路建立了与第四业务模块之间的逻辑链路。也就是说,不同的业务模块共用物理链路,但是各自的逻辑链路独立,这样能够保证各个业务模块数据传输的独立性,在某一逻辑链路或业务端口出现问题时,不会影响其他的逻辑链路,不会对其他业务造成影响,提高电子设备业务功能的稳定性。In this implementation, the first service module establishes a logical link with the third service module based on the first physical link, and the second service module establishes a logical link with the fourth service module based on the first physical link. link. That is to say, different business modules share physical links, but their respective logical links are independent, which can ensure the independence of data transmission of each business module, and when a logical link or service port has a problem, it will not affect other The logical link will not affect other services, improving the stability of electronic equipment business functions.
第二方面,本申请提供一种物理链路的建立方法,用于建立第一电子设备与第二电子设备之间的第一物理链路,该方法由第二电子设备执行,第一电子设备包括第一通信接口模块,第二电子设备包括第二通信接口模块,该方法包括:第二通信接口模块接收第一通信接口模块发送的第一复用连接请求,第一复用连接请求用于向第二通信接口模块请求复用第一物理链路;第二通信接口模块响应于第一复用连接请求,向第二总计数值加一,第二总计数值存储于第二电子设备、表征第一电子设备和第二电子设备对第一物理链路的有效请求次数,有效请求次数通过对有效连接请求次数和有效断开连接请求次数进行计数得到,第二总计数值的初始值为0。In a second aspect, the present application provides a method for establishing a physical link, which is used to establish a first physical link between a first electronic device and a second electronic device, the method is executed by the second electronic device, and the first electronic device A first communication interface module is included, the second electronic device includes a second communication interface module, and the method includes: the second communication interface module receives a first multiplexed connection request sent by the first communication interface module, and the first multiplexed connection request is used for Request to the second communication interface module to multiplex the first physical link; the second communication interface module adds one to the second total count value in response to the first multiplex connection request, and the second total count value is stored in the second electronic device, representing the first The number of valid requests for the first physical link from the first electronic device and the second electronic device, the number of valid requests is obtained by counting the number of valid connection requests and the number of valid disconnection requests, and the initial value of the second total count is 0.
一种可能的实现方式中,第二电子设备还包括第五业务模块,该方法还包括:第二通信接口模块接收第五业务模块的第四连接请求,第四连接请求用于指示第二通信接口模块建立第一物理链路;响应于第四连接请求,在第二总计数值大于0的情况下,第二通信接口模块向第一通信接口模块发送第二复用连接请求,并将第二总计数值加一,第二复用连接请求用于向第一通信接口模块请求复用第一物理链路。In a possible implementation manner, the second electronic device further includes a fifth service module, and the method further includes: the second communication interface module receives a fourth connection request from the fifth service module, and the fourth connection request is used to indicate the second communication The interface module establishes the first physical link; in response to the fourth connection request, when the second total count value is greater than 0, the second communication interface module sends a second multiplexing connection request to the first communication interface module, and the second The total count value is increased by one, and the second multiplexing connection request is used to request the first communication interface module to multiplex the first physical link.
一种可能的实现方式中,第二通信接口模块接收第一通信接口模块发送的第一复用连接请求之前,该方法还包括:第二通信接口模块接收第一通信接口模块发送的连接请求;第二通信接口模块响应于连接请求,与第一通信接口模块建立第一物理链路;第二通信接口模块将第二总计数值加一;第二通信接口模块向第一通信接口模块发送连接成功信息,连接成功信息表征第一物理链路建立成功。In a possible implementation manner, before the second communication interface module receives the first multiplexing connection request sent by the first communication interface module, the method further includes: the second communication interface module receives the connection request sent by the first communication interface module; The second communication interface module establishes the first physical link with the first communication interface module in response to the connection request; the second communication interface module adds one to the second total count value; the second communication interface module sends a connection success to the first communication interface module Information, the connection success information indicates that the first physical link is established successfully.
一种可能的实现方式中,该方法还包括:第二通信接口模块接收第一通信接口模块发送的第二断开连接请求;第二通信接口模块响应于第二断开连接请求,将第二总计数值减一,并断开第一物理链路。In a possible implementation manner, the method further includes: the second communication interface module receiving the second disconnection request sent by the first communication interface module; the second communication interface module responding to the second disconnection request, connecting the second The total count value is decremented by one, and the first physical link is disconnected.
一种可能的实现方式中,该方法还包括:第二通信接口模块接收第一通信接口模块发送的减少计数指令;第二通信接口模块响应于减少计数指令,将第二总计数值减一。In a possible implementation manner, the method further includes: the second communication interface module receiving a count-down instruction sent by the first communication interface module; and the second communication interface module decrementing the second total count value by one in response to the count-down instruction.
本申请第二方面提供的物理链路的建立方法与第一方面提供的物理链路的建立方法对应,具体的实现方式和有益效果类似,不再赘述。The method for establishing a physical link provided in the second aspect of the present application corresponds to the method for establishing a physical link provided in the first aspect, and the specific implementation manner and beneficial effects are similar and will not be repeated here.
第三方面,本申请提供一种装置,该装置包含在电子设备中,该装置具有实现上述第一方面及上述第一方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,接收模块或单元、处理模块或单元等。In a third aspect, the present application provides an apparatus, which is included in an electronic device, and has a function of realizing the behavior of the electronic device in the above-mentioned first aspect and possible implementation manners of the above-mentioned first aspect. The functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware. Hardware or software includes one or more modules or units corresponding to the functions described above. For example, a receiving module or unit, a processing module or unit, and the like.
第四方面,本申请提供一种装置,该装置包含在电子设备中,该装置具有实现上述第二方面及上述第二方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,接收模块或单元、处理模块或单元等。In a fourth aspect, the present application provides an apparatus, which is included in an electronic device, and has a function of realizing the behavior of the electronic device in the above-mentioned second aspect and possible implementation manners of the above-mentioned second aspect. The functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware. Hardware or software includes one or more modules or units corresponding to the functions described above. For example, a receiving module or unit, a processing module or unit, and the like.
第五方面,本申请提供一种物理链路的建立系统,包括第一电子设备和第二电子设备,第一电子设备用于执行第一方面的技术方案中任意一种方法,第二电子设备用于执行第一方面的技术方案中任意一种方法。In the fifth aspect, the present application provides a system for establishing a physical link, including a first electronic device and a second electronic device, the first electronic device is used to execute any method in the technical solution of the first aspect, and the second electronic device It is used to implement any method in the technical solution of the first aspect.
第六方面,本申请提供一种电子设备,电子设备包括:处理器、存储器和接口;处理器、存储器和接口相互配合,使得电子设备执行第一方面或者第二方面的技术方案中任意一种方法。In a sixth aspect, the present application provides an electronic device, the electronic device includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other, so that the electronic device executes any one of the technical solutions of the first aspect or the second aspect method.
第七方面,本申请提供一种芯片,包括处理器。处理器用于读取并执行存储器中存储的计算机程序,以执行第一方面及其任意可能的实现方式中的方法,或者执行第二方面及其任意可能的实现方式中的方法。In a seventh aspect, the present application provides a chip, including a processor. The processor is used to read and execute the computer program stored in the memory, so as to execute the method in the first aspect and any possible implementation thereof, or execute the method in the second aspect and any possible implementation thereof.
可选的,芯片还包括存储器,存储器与处理器通过电路或电线连接。Optionally, the chip further includes a memory, and the memory is connected to the processor through a circuit or wires.
进一步可选的,芯片还包括通信接口。Further optionally, the chip further includes a communication interface.
第八方面,本申请提供一种计算机可读存储介质,计算机可读存储介质中存储了计算机程序,当计算机程序被处理器执行时,使得该处理器执行第一方面或者第二方面的技术方案中任意一种方法。In an eighth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor executes the technical solution of the first aspect or the second aspect any of the methods.
第九方面,本申请提供一种计算机程序产品,计算机程序产品包括:计算机程序代码,当计算机程序代码在电子设备上运行时,使得该电子设备执行第一方面或者第二方面的技术方案中任意一种方法。In the ninth aspect, the present application provides a computer program product, the computer program product including: computer program code, when the computer program code is run on the electronic device, the electronic device is made to execute any of the technical solutions of the first aspect or the second aspect. a way.
附图说明Description of drawings
图1是相关技术中一例电子设备中应用程序的模块示意图;Fig. 1 is a block diagram of an application program in an electronic device in the related art;
图2是相关技术中另一例电子设备中应用程序的模块示意图;Fig. 2 is a schematic diagram of modules of an application program in another electronic device in the related art;
图3是本申请实施例提供的一例电子设备的模块示意图;FIG. 3 is a schematic diagram of modules of an electronic device provided in an embodiment of the present application;
图4是本申请实施例提供的一例电子设备100的结构示意图;FIG. 4 is a schematic structural diagram of an example of an electronic device 100 provided by an embodiment of the present application;
图5是本申请实施例提供的电子设备100的软件结构框图;FIG. 5 is a software structural block diagram of the electronic device 100 provided by the embodiment of the present application;
图6是本申请实施例提供的一例物理链路的建立方法的流程示意图;FIG. 6 is a schematic flowchart of a method for establishing a physical link provided in an embodiment of the present application;
图7是本申请实施例提供的一例初次建立物理链路涉及的信息交互和计数值变化示意图;FIG. 7 is a schematic diagram of information interaction and count value changes involved in the initial establishment of a physical link provided by the embodiment of the present application;
图8是本申请实施例提供的另一例物理链路的建立方法的流程示意图;FIG. 8 is a schematic flowchart of another example of a method for establishing a physical link provided by an embodiment of the present application;
图9是本申请实施例提供的一例再次建立物理链路涉及的信息交互和计数值变化示意图;FIG. 9 is a schematic diagram of information interaction and count value changes involved in re-establishing a physical link provided by the embodiment of the present application;
图10是本申请实施例提供的又一例物理链路的建立方法的流程示意图;FIG. 10 is a schematic flowchart of another example of a method for establishing a physical link provided by an embodiment of the present application;
图11是本申请实施例提供的另一例再次建立物理链路涉及的信息交互和计数值变化示意图;FIG. 11 is another example of information interaction and count value changes involved in re-establishing a physical link provided by the embodiment of the present application;
图12是本申请实施例提供的又一例物理链路的建立方法的流程示意图;FIG. 12 is a schematic flowchart of another example of a method for establishing a physical link provided by an embodiment of the present application;
图13是本申请实施例提供的又一例再次建立物理链路涉及的信息交互和计数值变化示意图;FIG. 13 is another example of information interaction and count value changes involved in re-establishing a physical link provided by the embodiment of the present application;
图14是本申请实施例提供的一例断开物理链路的流程示意图;FIG. 14 is a schematic flow diagram of an example of disconnecting a physical link provided by the embodiment of the present application;
图15是本申请实施例提供的一例断开物理链路涉及的信息交互和计数值变化示意图;Fig. 15 is a schematic diagram of information interaction and count value changes involved in disconnecting a physical link provided by the embodiment of the present application;
图16是本申请实施例提供的另一例断开物理链路涉及的信息交互和计数值变化示意图;Fig. 16 is a schematic diagram of another example of information interaction and count value changes involved in disconnecting a physical link provided by the embodiment of the present application;
图17是本申请实施例提供的又一例断开物理链路涉及的信息交互和计数值变化示意图;FIG. 17 is another example of information interaction and count value changes involved in disconnecting a physical link provided by the embodiment of the present application;
图18是本申请实施例提供的又一例断开物理链路涉及的信息交互和计数值变化示意图;Fig. 18 is a schematic diagram of another example of information interaction and count value changes involved in disconnecting a physical link provided by the embodiment of the present application;
图19是本申请实施例提供的一例物理链路的建立和断开的时序图。FIG. 19 is a sequence diagram of an example of establishment and disconnection of a physical link provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this article is only a description of associated objects The association relationship of indicates that there may be three kinds of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括一个或者更多个该特征。Hereinafter, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first", "second" and "third" may explicitly or implicitly include one or more of these features.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本申请说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc., appearing in various places in this specification are not All references are necessarily to the same embodiment but mean "one or more but not all of the embodiments" unless specifically stated otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise.
为了更好的理解本申请实施例提供的方法,以下首先对本申请要解决的技术问题进行分析。In order to better understand the method provided by the embodiment of the present application, the following firstly analyzes the technical problem to be solved in the present application.
目前,电子设备的很多业务场景都会使用到设备间的短距离无线通信技术,例如,设备间的文件传输、投屏、联机游戏等等。设备间的短距离无线通信技术包括Wi-Fi p2p技术、蓝牙技术等。At present, short-distance wireless communication technologies between devices are used in many business scenarios of electronic devices, such as file transfer between devices, screen projection, online games, and so on. Short-distance wireless communication technologies between devices include Wi-Fi p2p technology, Bluetooth technology, etc.
相关技术中,主要由电子设备中的应用程序基于无线通信技术建立物理链路。具体的,参见图1,图1为相关技术中电子设备中应用程序的模块示意图。如图1所示,电子设备A中包括应用程序A1、A2和A3,这三个应用程序能够分别与电子设备B中的应用程序B1、B2和B3建立物理链路(也称为物理通道、物理数据传输通道等)。应用程序A1、A2、A3、B1、B2和B3分别包括业务模块和通信模块。应用程序通过自身的通信模块与对端的应用程序的通信模块建立物理链路。In the related art, an application program in an electronic device mainly establishes a physical link based on a wireless communication technology. Specifically, refer to FIG. 1 , which is a schematic diagram of a module of an application program in an electronic device in the related art. As shown in Figure 1, electronic device A includes application programs A1, A2, and A3, and these three application programs can respectively establish physical links (also called physical channels, physical data transmission channels, etc.). The application programs A1, A2, A3, B1, B2 and B3 respectively include a business module and a communication module. The application program establishes a physical link with the communication module of the peer application program through its own communication module.
然而,通过上述方式建立的物理链路,由于同一电子设备中的不同应用程序之间无法互相获知对方建立的物理链路的信息,因而无法实现链路复用,物理链路建立阶段需要消耗更多的时间和/或功耗,导致效率低下。具体的,以建立Wi-Fi p2p物理链路为例,结合应用场景分析如下:However, for the physical link established by the above method, because different application programs in the same electronic device cannot know the information of the physical link established by the other party, link multiplexing cannot be realized, and the physical link establishment stage needs to consume more resources. much time and/or power consumption, resulting in inefficiency. Specifically, taking the establishment of a Wi-Fi p2p physical link as an example, combined with the application scenario, the analysis is as follows:
参见图2,假设应用程序A1和应用程序B1分别为图库A和图库B,应用程序A2和应用程序B2分别为游戏A和游戏B。响应于用户在图库A中的分享照片操作,图库A的通信模块与图库B的通信模块建立了Wi-Fi p2p物理链路,并基于该物理链路传输照片。此时,用户又在游戏A中发起了联机请求。由于图库A和图库B正在占用Wi-Fi p2p物理链路,在电子设备A和电子设备B支持同一时刻只能建立1个Wi-Fi p2p物理链路的情况下,游戏A和游戏B只能通过抢占或等待(图2中示出为等待)的方式获得Wi-Fi p2p物理链路。通过抢占的方式,会导致照片传输中断,降低照片的传输效率,且影响用户体验。通过等待的方式,需要消耗更多的时间,效率较低。在电子设备A和电子设备B支持同一时刻建立2个Wi-Fi p2p物理链路的情况下,游戏A和游戏B可以重新建立一个Wi-Fi p2p物理链路,但是,重建Wi-Fi p2p物理链路也需要消耗时间,效率较低,且会导致电子设备的功耗增大。Referring to FIG. 2 , it is assumed that application program A1 and application program B1 are gallery A and gallery B respectively, and application program A2 and application program B2 are game A and game B respectively. In response to the user's photo sharing operation in gallery A, the communication module of gallery A establishes a Wi-Fi p2p physical link with the communication module of gallery B, and transmits photos based on the physical link. At this time, the user initiates an online request in game A again. Since Gallery A and Gallery B are occupying the Wi-Fi p2p physical link, when electronic device A and electronic device B can only establish one Wi-Fi p2p physical link at the same time, game A and game B can only The Wi-Fi p2p physical link is obtained by preempting or waiting (shown as waiting in FIG. 2 ). The way of preemption will cause the interruption of photo transmission, reduce the efficiency of photo transmission, and affect the user experience. By waiting, it takes more time and is less efficient. In the case that electronic device A and electronic device B support the establishment of two Wi-Fi p2p physical links at the same time, game A and game B can re-establish a Wi-Fi p2p physical link, however, rebuilding the Wi-Fi p2p physical Links are also time consuming, inefficient, and lead to increased power consumption of electronic devices.
同样的,蓝牙物理链路也存在上述问题,在此不作赘述。Similarly, the Bluetooth physical link also has the above-mentioned problems, which will not be repeated here.
总而言之,相关技术中建立物理链路的方法存在效率低、影响用户体验以及设备功耗大等问题。All in all, the method for establishing a physical link in the related art has problems such as low efficiency, affecting user experience, and high power consumption of the device.
示例性的,图3为本申请实施例提供的一例电子设备的模块示意图。如图3所示,本申请实施例中,电子设备A和电子设备B中均包括通信接口程序(也称为通信接口模块),其中,电子设备A中的通信接口程序称为通信接口程序A,电子设备B中的通信接口程序称为接口程序B。本申请实施例提供的物理链路的建立方法通过通信接口程序A和通信接口程序B实现电子设备A与电子设备B之间物理链路的统一建立和管理,通信接口程序A和通信接口程序B作为物理链路的管理者,能够获知物理链路的所有信息,因而在需要时能够对物理链路进行复用,无需等待或重新建立物理链路,解决物理链路建立效率低下的问题,进而提高设备间数据传输的效率,提高用户体验。同时,复用物理链路也提高了物理链路的利用率,节约资源和功耗。Exemplarily, FIG. 3 is a schematic diagram of modules of an electronic device provided in an embodiment of the present application. As shown in Figure 3, in the embodiment of the present application, both electronic equipment A and electronic equipment B include a communication interface program (also called a communication interface module), wherein the communication interface program in electronic equipment A is called communication interface program A , the communication interface program in electronic device B is called interface program B. The method for establishing a physical link provided in the embodiment of the present application realizes the unified establishment and management of the physical link between the electronic device A and the electronic device B through the communication interface program A and the communication interface program B, and the communication interface program A and the communication interface program B As the manager of the physical link, he can know all the information of the physical link, so he can reuse the physical link when needed, without waiting or re-establishing the physical link, solving the problem of low efficiency of physical link establishment, and then Improve the efficiency of data transmission between devices and improve user experience. At the same time, multiplexing physical links also improves the utilization of physical links, saving resources and power consumption.
本申请实施例提供的物理链路的建立方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等可以安装应用程序(application,APP)的电子设备上,本申请实施例对电子设备的具体类型不作任何限制。The method for establishing a physical link provided in the embodiment of this application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) devices, notebook computers, Mobile personal computer (ultra-mobile personal computer, UMPC), netbook, personal digital assistant (personal digital assistant, PDA) and other electronic devices that can install applications (Application, APP). No restrictions are imposed.
示例性的,图4是本申请实施例提供的一例电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universalserial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Exemplarily, FIG. 4 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments,
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the
天线1和天线2用于发射和接收电磁波信号。图4中的天线1和天线2的结构仅为一种示例。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 170A,
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本申请实施例中,可以通过无线通信模块160发现周围的电子设备,并建立物理链路。The
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。无In some embodiments, the
线通信技术可以包括全球移动通讯系统(global system for mobilecommunications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband codedivision multiple access,WCDMA),时分码分多址(time-division code divisionmultiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system ,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenithsatellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。Wire communication technologies may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or or IR technology etc. GNSS can include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou satellite navigation system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi-zenith satellite system) system, QZSS) and/or satellite based augmentation systems (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light emitting diode). AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
图5是本申请实施例的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。FIG. 5 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can consist of a series of application packages.
如图5所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in FIG. 5, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图5所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器和通信接口程序等。As shown in Figure 5, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and a communication interface program.
其中,通信接口程序,也称为通信接口模块、中间件应用等,用于为电子设备100中的一个或多个应用程序(例如图库、视频等)提供跨设备通信的接口,与其他电子设备建立物理链路,并实现对物理链路的管理(包括复用、断开等)。可选的,通信接口程序例如可以为电子设备100中的“超级终端”能力。Among them, the communication interface program, also referred to as a communication interface module, a middleware application, etc., is used to provide an interface for cross-device communication for one or more application programs (such as a gallery, video, etc.) in the electronic device 100, and communicate with other electronic devices. Establish physical links and realize the management of physical links (including multiplexing, disconnection, etc.). Optionally, the communication interface program may be, for example, the “Hyper Terminal” capability in the electronic device 100 .
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。The Android runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如: MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
为了便于理解,在对本申请实施例提供的物理链路的建立方法进行具体阐述之前,先对方法中可能涉及的名词和定义进行说明。For ease of understanding, before the method for establishing a physical link provided in the embodiment of the present application is described in detail, nouns and definitions that may be involved in the method are described first.
1、业务模块1. Business module
业务模块是指应用程序中实现某一业务功能的模块。本申请实施例中,电子设备中可以包括一个或多个应用程序,每个应用程序可以包括一个或多个业务模块,每个业务模块用于实现不同的业务功能。例如,备忘录应用程序中可以包括笔记模块和待办模块。本申请实施例中,业务模块在需要与其他电子设备建立物理链路时,可以向通信接口程序发起连接请求。A business module refers to a module that implements a certain business function in an application program. In the embodiment of the present application, the electronic device may include one or more application programs, and each application program may include one or more service modules, and each service module is used to implement a different service function. For example, a note module and a to-do module may be included in the memo application program. In the embodiment of the present application, when the service module needs to establish a physical link with other electronic devices, it can initiate a connection request to the communication interface program.
2、有效连接请求2. Valid connection request
本申请实施例中,对于某一业务模块发起的连接请求,若响应于该连接请求,成功建立对应的物理链路,或成功复用对应的物理链路,则称该连接请求为有效连接请求。In this embodiment of the application, for a connection request initiated by a certain service module, if the corresponding physical link is successfully established in response to the connection request, or the corresponding physical link is successfully multiplexed, then the connection request is called a valid connection request .
例如,某一设备中的业务模块A向通信接口程序发送连接请求X,连接请求X用于指示通信接口程序建立物理链路x1,响应于该连接请求X,若通信接口程序成功建立物理链路x1,或成功复用物理链路x1,则称该连接请求X为有效连接请求,也称该连接请求为业务模块A对物理链路x1的有效连接请求;若通信接口程序未成功建立物理链路x1,也未成功复用物理链路x1,则称该连接请求X为无效连接请求,也称该连接请求为业务模块A对物理链路x1的无效连接请求。For example, the service module A in a certain device sends a connection request X to the communication interface program. The connection request X is used to instruct the communication interface program to establish a physical link x1. In response to the connection request X, if the communication interface program successfully establishes the physical link x1, or the successful multiplexing of physical link x1, the connection request X is called a valid connection request, and the connection request is also called an effective connection request of business module A to physical link x1; if the communication interface program fails to establish the physical link x1, and the physical link x1 has not been reused successfully, then the connection request X is called an invalid connection request, and the connection request is also called an invalid connection request of the service module A to the physical link x1.
3、有效断开连接请求3. Valid disconnect request
本申请实施例中,对于某一业务模块,每增加一次该业务模块对某一物理链路的有效连接请求,对应的业务计数值加1,每接收一次该业务模块对该物理链路的断开连接请求,若当前业务计数值大于0,则确定该次断开连接请求为有效断开连接请求;若当前业务计数值等于0,则确定该次断开连接请求为无效断开连接请求。In the embodiment of the present application, for a certain service module, every time an effective connection request of the service module to a certain physical link is added, the corresponding service count value is increased by 1, and every time the service module receives a disconnection request of the physical link For a connection opening request, if the current service count value is greater than 0, then determine that the disconnection request is a valid disconnection request; if the current service count value is equal to 0, then determine that the disconnection request is an invalid disconnection request.
4、有效请求次数4. Number of valid requests
有效请求次数通过对某一物理链路的有效连接请求次数和有效断开连接请求次数进行计数得到。可以理解,有效请求次数实质为当前对某一物理链路的有效连接请求的总次数减去对该物理链路的有效断开连接请求的总次数。例如,当前时刻,模块A对物理链路x1的有效连接请求总次数为5次,对物理链路x1的有效连接请求总次数为3次,则当前有效请求次数为2次。The number of valid requests is obtained by counting the number of valid connection requests and the number of valid disconnection requests of a physical link. It can be understood that the number of valid requests is essentially the total number of current valid connection requests for a certain physical link minus the total number of valid disconnection requests for the physical link. For example, at the current moment, the total number of effective connection requests of module A to physical link x1 is 5 times, and the total number of valid connection requests to physical link x1 is 3 times, so the current number of effective connection requests is 2 times.
5、业务计数值5. Business count value
业务计数值,也称为业务连接计数值、业务连接计数或业务引用(reference)值等,表征某一业务当前对某一物理链路的有效请求次数。具体的,业务计数值通过业务模块对物理链路的有效连接请求和有效断开连接请求次数进行计数得到,该业务模块每增加一次对该物理链路的有效连接请求,业务计数值加1,业务模块每增加一次对该物理链路的有效断开连接请求,业务计数值减1。The service count value, also called the service connection count value, service connection count or service reference (reference) value, etc., represents the number of valid requests of a certain service to a certain physical link. Specifically, the service count value is obtained by counting the number of effective connection requests and effective disconnection requests of the physical link by the service module. Every time the service module adds an effective connection request to the physical link, the service count value is increased by 1, Each time the service module adds an effective disconnection request to the physical link, the service count value is decremented by 1.
6、总计数值6. Total value
总计数值,也称为总连接计数值、总连接计数或总引用(reference)值等,表征某一物理链路两端的两个设备(如电子设备A和电子设备B)对该物理链路的有效请求的总次数。具体的,总计数值通过对该物理链路两端的两个设备中各个业务模块对物理链路的有效连接请求,以及两个设备中各个业务模块对该物理链路的有效断开连接次数进行计数得到,两个设备中任意一个业务模块每增加一次对该物理链路的有效连接请求,总计数值加1,两个设备中任意一个业务模块每增加一次对该物理链路的有效断开连接请求,总计数值减1。The total count value, also known as the total connection count value, total connection count or total reference (reference) value, etc., represents the connection between two devices (such as electronic device A and electronic device B) at both ends of a physical link on the physical link. The total number of valid requests. Specifically, the total count value counts the effective connection requests of each service module in the two devices at both ends of the physical link to the physical link, and the effective disconnection times of the physical link by each service module in the two devices Obtained, every time any service module in the two devices adds a valid connection request to the physical link, the total count value is increased by 1, and every time any service module in the two devices adds a valid disconnection request to the physical link , minus 1 from the total count value.
总计数值是一个动态变化的数值。本申请实施例中,总计数值的初始值为0,即总计数值为大于或等于0的正整数。总计数值大于0,说明物理链路存在,且当前存在有效连接请求,说明当前可能有业务正在使用或即将需要使用物理链路。总计数值为0,说明物理链路未建立,或者物理链路已断开。The total count value is a dynamically changing value. In the embodiment of the present application, the initial value of the total count value is 0, that is, the total count value is a positive integer greater than or equal to 0. If the total count value is greater than 0, it indicates that the physical link exists, and there is currently a valid connection request, indicating that there may be services currently using or will soon need to use the physical link. If the total count is 0, it means that the physical link is not established or the physical link is disconnected.
本申请以下实施例将以具有图4和图5所示结构的电子设备为例,结合附图和应用场景,对本申请实施例提供的物理链路的建立方法进行具体阐述。The following embodiments of the present application will take the electronic device with the structure shown in FIG. 4 and FIG. 5 as an example, and describe the method for establishing a physical link provided by the embodiment of the present application in detail in combination with the drawings and application scenarios.
以下实施例中,继续以建立电子设备A和电子设备B之间物理链路为例进行说明。本申请实施例提供的方法建立的物理链路包括但不限于Wi-Fi p2p链路、蓝牙基本速率(basic rate,BR)链路、蓝牙套接字(Socket)链路或蓝牙增强数据速率(enhanced datarate,EDR)链路等,下述实施例均以Wi-Fi p2p链路为例进行说明,其他类型的物理链路与此类似,不作赘述。In the following embodiments, the establishment of a physical link between electronic device A and electronic device B will continue to be described as an example. The physical link established by the method provided in the embodiment of this application includes but is not limited to Wi-Fi p2p link, Bluetooth basic rate (basic rate, BR) link, Bluetooth socket (Socket) link or Bluetooth enhanced data rate ( enhanced datarate (EDR) link, etc., the following embodiments are described by taking a Wi-Fi p2p link as an example, and other types of physical links are similar to this, and will not be described in detail.
下述实施例中,以电子设备A中的应用程序A1包括业务模块a1,应用程序A2包括业务模块a2,电子设备B中的应用程序B1包括业务b1,应用程序B2包括业务b2为例进行说明。In the following embodiments, the application program A1 in the electronic device A includes the service module a1, the application program A2 includes the service module a2, the application program B1 in the electronic device B includes the service b1, and the application program B2 includes the service b2 as examples for illustration. .
本申请实施例中,物理链路的建立包括初次请求建立物理链路和再次请求建立物理链路两种情况。此外,本申请实施例还涉及物理链路的断开过程,以下结合实施例,以电子设备A和电子设备B为例,对任意类型的一条物理链路——第一物理链路的建立、复用和断开过程分别进行说明。In the embodiment of the present application, the establishment of the physical link includes two cases of initially requesting to establish the physical link and requesting to establish the physical link again. In addition, the embodiment of the present application also involves the disconnection process of the physical link. In the following, in combination with the embodiment, taking electronic device A and electronic device B as examples, for any type of physical link—the establishment of the first physical link, The multiplexing and disconnection processes are explained separately.
1)初次请求建立物理链路1) The initial request to establish a physical link
图6是本申请实施例提供的一例物理链路的建立方法的流程示意图,该方法包括:Fig. 6 is a schematic flowchart of a method for establishing a physical link provided by an embodiment of the present application, the method including:
S101、电子设备A中的应用程序A1的业务模块a1向通信接口程序A发送第一连接请求,第一连接请求用于指示通信接口程序A与电子设备B建立第一物理链路。S101. The service module a1 of the application program A1 in the electronic device A sends a first connection request to the communication interface program A, and the first connection request is used to instruct the communication interface program A to establish a first physical link with the electronic device B.
首先,需要说明的是,在执行本步骤之前,电子设备A已完成设备发现,且业务模块a1接收到了用户的连接指令。连接指令用于指示电子设备A与电子设备B建立第一物理链路。连接指令中可以包括对端设备的物理地址信息以及链路类型等。这里,本端设备为电子设备A,对端设备为电子设备B。物理地址信息例如可以为媒体存取控制(media accesscontrol address,MAC)地址等。链路类型是指需要建立的物理链路的类型,例如,Wi-Fip2p链路、BR链路、Socket连接或EDR链路等。本申请实施例中,链路类型为Wi-Fi p2p链路。First of all, it should be noted that before performing this step, the electronic device A has completed device discovery, and the service module a1 has received the user's connection instruction. The connection instruction is used to instruct electronic device A to establish a first physical link with electronic device B. The connection instruction may include physical address information and link type of the peer device. Here, the local device is electronic device A, and the peer device is electronic device B. The physical address information may be, for example, a media access control (media access control address, MAC) address and the like. The link type refers to the type of physical link that needs to be established, for example, Wi-Fip2p link, BR link, Socket connection, or EDR link. In this embodiment of the application, the link type is a Wi-Fi p2p link.
响应于用户的连接指令,业务模块a1生成第一连接请求,并将第一连接请求发送至通信接口程序A。可以理解,应用程序A1运行过程中,每个业务模块可以建立有至少一个进程。可选的,业务模块a1可以基于对应的进程,通过进程间的通信,向通信接口程序A发送第一连接请求。In response to the user's connection instruction, the service module a1 generates a first connection request, and sends the first connection request to the communication interface program A. It can be understood that, during the running of the application program A1, at least one process can be established for each business module. Optionally, the service module a1 may send the first connection request to the communication interface program A through inter-process communication based on the corresponding process.
可选的,第一连接请求中可以包括业务模块a1对应的业务标识信息、对端设备的物理地址信息和链路类型等。其中,业务标识信息用于标识不同的业务模块,以区分每个第一连接请求的来源。不同的应用程序中的业务模块的业务标识不同,同一应用程序中的不同业务模块的业务标识也不同。业务标识信息例如可以为业务模块对应的进程标识(process identification,PID),如,本实施例中,第一连接请求中的业务标识信息为业务模块a1对应的进程的PID。Optionally, the first connection request may include service identification information corresponding to the service module a1, physical address information and link type of the peer device, and the like. Wherein, the service identification information is used to identify different service modules, so as to distinguish the source of each first connection request. The business identifiers of the business modules in different application programs are different, and the service identifiers of different business modules in the same application program are also different. The service identification information may be, for example, a process identification (process identification, PID) corresponding to the service module. For example, in this embodiment, the service identification information in the first connection request is the PID of the process corresponding to the service module a1.
S102、通信接口程序A响应于第一连接请求,确定电子设备A中第一物理链路对应的总计数值A是否为0。S102. The communication interface program A determines whether the total count value A corresponding to the first physical link in the electronic device A is 0 in response to the first connection request.
可以理解,同一时刻,电子设备A和电子设备B之间可以建立有一条或多条物理链路,而且,同一类型的物理链路也可能多次建立。本申请实施例中,每一次建立的物理链路可以设置有唯一的标识(以下称为链路标识),以与其他物理链路进行区分。链路标识的形式和内容不限,例如,可以包括本端设备和对端的设备MAC地址以及预设的链路编号。每一条物理链路可以对应一个总计数值。本实施例中,电子设备A中存储的第一物理链路对应的总计数值称为总计数值A,或称为电子设备A的总计数值A。It can be understood that at the same moment, one or more physical links may be established between electronic device A and electronic device B, and the same type of physical links may also be established multiple times. In this embodiment of the present application, each established physical link may be provided with a unique identifier (hereinafter referred to as a link identifier) to distinguish it from other physical links. The form and content of the link identifier are not limited, for example, it may include the MAC addresses of the local device and the peer device and a preset link number. Each physical link may correspond to a total count value. In this embodiment, the total count value corresponding to the first physical link stored in the electronic device A is called the total count value A, or the total count value A of the electronic device A.
本实施例为初次请求建立第一物理链路,因而,总计数值A为0,执行步骤S103。In this embodiment, it is the first request to establish the first physical link, therefore, the total count value A is 0, and step S103 is executed.
S103、通信接口程序A根据第一连接请求生成第二连接请求,并向电子设备B的通信接口程序B发送第二连接请求,第二连接请求用于请求与电子设备B建立第一物理链路。S103, the communication interface program A generates a second connection request according to the first connection request, and sends the second connection request to the communication interface program B of the electronic device B, and the second connection request is used to request to establish a first physical link with the electronic device B .
可选的,第二连接请求中可以包括电子设备A的物理地址信息、链路标识等,以便于对端设备获知本端设备的物理地址信息,并在建立第一物理链路后将第一物理链路与其他物理链路进行区分。另外,第二连接请求中还可以包括其他建立物理链路所需要的信息,例如,本实施例中,链路类型为Wi-Fi p2p链路的情况下,第二连接请求中可以包括连接角色,连接角色可以为组所有者(group owner,GO)或组客户端(group client,GC)。Optionally, the second connection request may include the physical address information of the electronic device A, the link identifier, etc., so that the peer device can know the physical address information of the local device, and after the first physical link is established, the first Physical links are distinguished from other physical links. In addition, the second connection request may also include other information required to establish a physical link. For example, in this embodiment, when the link type is a Wi-Fi p2p link, the second connection request may include the connection role , the connection role can be group owner (group owner, GO) or group client (group client, GC).
可选的,第二连接请求可以为JS对象简谱(javascript object notation,JSON)格式,如表1(未包含连接角色和链路标识)所示:Optionally, the second connection request can be in JS object notation (javascript object notation, JSON) format, as shown in Table 1 (excluding connection roles and link identifiers):
表1Table 1
可选的,通信接口程序A可以根据第一连接请求中的对端设备的网络地址信息,基于电子设备A与电子设备B预先协商的通信通道,将第二连接请求发送至电子设备B的通信接口程序B。其中,不同类型的物理链路,协商的通信通道不同。可以理解,本申请实施例中通信接口程序A和通信接口程序B之间的其他信息或请求,例如断开连接请求、复用连接请求、连接成功信息、减少计数指令、复用回复信息等,均可以通过预先协商的通信通道传输,后续实施例不再赘述。Optionally, the communication interface program A may send the second connection request to the communication channel of electronic device B based on the network address information of the peer device in the first connection request and based on the communication channel pre-negotiated between electronic device A and electronic device B. Interface program B. Wherein, different types of physical links have different communication channels negotiated. It can be understood that other information or requests between communication interface program A and communication interface program B in the embodiment of the present application, such as disconnection request, multiplexing connection request, connection success information, count reduction instruction, multiplexing reply information, etc., Both can be transmitted through a pre-negotiated communication channel, and details will not be described in subsequent embodiments.
S104、电子设备B中的通信接口程序B响应于第二连接请求,与通信接口程序B建立第一物理链路。S104. The communication interface program B in the electronic device B establishes a first physical link with the communication interface program B in response to the second connection request.
具体的,通信接口程序B可以根据接收第二连接请求的通信通道确定需要建立的第一物理链路的类型。本实施例中,根据接收第二连接请求的通信通道确定第一物理链路的链路类型为Wi-Fi p2p链路。通信接口程序B根据第二连接请求中电子设备A的物理地址信息,基于通信协议(Wi-Fi p2p协议),与通信接口B建立第一物理链路。Specifically, the communication interface program B may determine the type of the first physical link that needs to be established according to the communication channel that receives the second connection request. In this embodiment, it is determined that the link type of the first physical link is a Wi-Fi p2p link according to the communication channel that receives the second connection request. The communication interface program B establishes the first physical link with the communication interface B based on the communication protocol (Wi-Fi p2p protocol) according to the physical address information of the electronic device A in the second connection request.
在一些其他的实施例中,建立第一物理链路后,还可以进一步进行设备授信。设备授信的过程可以如下:通信接口程序A向通信接口程序B发送设备授信请求,设备授信请求中可以包括电子设备A的用户信息,用户信息例如可以为设备中登录的预设平台的账号信息,如X云平台的账号信息等。通信接口程序B响应于设备授信请求,将电子设备A的用户信息与电子设备B的用户信息进行对比,确定是否一致,若一致,则通过对电子设备A授信认证。通过设备授信,保证了电子设备A和电子设备B之间第一物理链路的安全性和可靠性。In some other embodiments, after the first physical link is established, further device authorization may be performed. The process of device authorization can be as follows: communication interface program A sends a device authorization request to communication interface program B, and the device authorization request can include user information of electronic device A, for example, user information can be account information of a preset platform logged in the device, Such as the account information of the X cloud platform, etc. In response to the device credit request, the communication interface program B compares the user information of electronic device A with the user information of electronic device B to determine whether they are consistent. If they are consistent, the electronic device A is authenticated. The security and reliability of the first physical link between the electronic device A and the electronic device B are guaranteed through the device trust.
S105、通信接口程序B向电子设备B中第一物理链路对应的总计数值B加1。S105. The communication interface program B adds 1 to the total count value B corresponding to the first physical link in the electronic device B.
总计数值B是存储于电子设备B中第一物理链路对应的总计数值,也称为电子设备B的总计数值B。通信接口程序B与通信接口程序A成功建立第一物理链路后,可以向总计数值B加1。The total count value B is the total count value corresponding to the first physical link stored in the electronic device B, and is also referred to as the total count value B of the electronic device B. After the communication interface program B and the communication interface program A successfully establish the first physical link, 1 may be added to the total count value B.
S106、通信接口程序B向通信接口程序A发送连接成功信息。S106. The communication interface program B sends connection success information to the communication interface program A.
连接成功信息表征第一物理链路建立成功。可选的,连接成功信息中可以携带有第一物理链路的链路标识和连接成功信息中还可以携带有第二连接请求的信息等。The connection success information indicates that the first physical link is established successfully. Optionally, the connection success information may carry the link identifier of the first physical link, and the connection success information may also carry information of the second connection request, and the like.
S107、通信接口程序A接收到连接成功信息,向总计数值A加1,并向业务模块a1对应的业务计数值a1加1。S107. The communication interface program A receives the connection success information, adds 1 to the total count value A, and adds 1 to the service count value a1 corresponding to the service module a1.
可选的,通信接口程序A接收到连接成功信息后,可以根据连接成功信息中的第二连接请求的信息,确定该第二连接请求对应的第一连接请求的发起业务模块,向该业务模块对应的业务计数值加1。具体的,通信接口程序A可以建立第二连接请求与第一连接请求的对应关系,当接收到第二连接请求的连接成功信息后,根据第二连接请求确定对应的第一连接请求,从而获知发起本次连接请求的业务模块,向该业务模块对应的业务计数值加1。本实施例中,发起业务模块为业务模块a1,业务模块a1对应的业务计数值称为业务计数值a1,向业务计数值a1加1。Optionally, after the communication interface program A receives the connection success information, it may determine the initiating service module of the first connection request corresponding to the second connection request according to the information of the second connection request in the connection success information, and send the service module to the service module The corresponding service count value is increased by 1. Specifically, the communication interface program A may establish a corresponding relationship between the second connection request and the first connection request, and after receiving the connection success information of the second connection request, determine the corresponding first connection request according to the second connection request, so as to know The service module that initiates this connection request adds 1 to the service count value corresponding to the service module. In this embodiment, the initiating service module is the service module a1, and the service count value corresponding to the service module a1 is called the service count value a1, and 1 is added to the service count value a1.
本实施例中,通过管理电子设备A的总计数值A,简单方便的对第一物理链路的有效请求次数进行管理,也即对电子设备A和电子设备B对第一物理链路的使用情况进行管理,从而在需要使用第一物理链路时,通过判断总计数值A是否为0即能准确获知第一物理链路是否已建立,是否能够复用第一物理链路。另外,通过总计数值能够及时准确的获知第一物理链路是否使用完成,是否需要断开,便于需要时及时断开物理链路。总而言之,本实施例提供的方法能够提高对第一物理链路管理效率和准确率,进而提高电子设备A和电子设备B之间的数据传输效率。而且,本实施例中,在第一物理链路建立成功后,向业务模块a1对应的业务计数值a1和电子设备A的总计数值A分别加1,更新计数值,保证了计数值的准确性。In this embodiment, by managing the total count value A of electronic device A, the effective number of requests for the first physical link is managed simply and conveniently, that is, the use of the first physical link by electronic device A and electronic device B Management is performed so that when the first physical link needs to be used, it can be accurately known whether the first physical link has been established and whether the first physical link can be reused by judging whether the total count value A is 0. In addition, through the total count value, it can be timely and accurately known whether the first physical link is used and whether it needs to be disconnected, so that the physical link can be disconnected in time when necessary. In a word, the method provided in this embodiment can improve the management efficiency and accuracy of the first physical link, and further improve the data transmission efficiency between the electronic device A and the electronic device B. Moreover, in this embodiment, after the first physical link is successfully established, 1 is added to the service count value a1 corresponding to the service module a1 and the total count value A of the electronic device A, and the count value is updated to ensure the accuracy of the count value .
可以理解,在第一物理链路建立成功之后,业务模块a1可以基于第一物理链路,与电子设备B中相关的业务模块建立逻辑链路,从而形成数据传输通道。例如,第一物理链路建立成功后,业务模块a1可以根据电子设备B的网络地址信息和电子设备B中的业务模块b1的端口信息,基于第一物理链路,建立业务模块a1与业务模块b1之间的逻辑链路。其中,网络地址信息例如可以为IP地址,端口信息例如可以为端口号。It can be understood that, after the first physical link is successfully established, the service module a1 may establish a logical link with a related service module in the electronic device B based on the first physical link, thereby forming a data transmission channel. For example, after the first physical link is successfully established, the service module a1 can establish the service module a1 and the service module b1 based on the first physical link according to the network address information of the electronic device B and the port information of the service module b1 in the electronic device B. Logical link between b1. Wherein, the network address information may be, for example, an IP address, and the port information may be, for example, a port number.
示例性的,图7是本申请实施例提供的一例初次建立物理链路涉及的信息交互和计数值变化示意图。如图7所示,电子设备A中的业务模块a1向通信接口程序A发送第一连接请求。通信接口程序A响应于第一连接请求,确定总计数值A。如图7所示,本实施例为初次请求建立第一物理链路,业务模块a1对应的业务计数值a1为0,电子设备A的总计数值A也为0,电子设备B的总计数值B也为0。因而,通信接口程序A确定总计数值A为0,即确定当前第一连接请求为初次连接请求,通信接口程序A向电子设备B的通信接口程序B发送第二连接请求。通信接口程序B响应于第二连接请求,与通信接口程序A建立第一物理链路,并向总计数值B加1,总计数值B由0变为1。而且,通信接口程序B向通信接口程序A发送连接成功信息,通信接口程序A接收到连接成功信息后,向业务计数值a1加1,并向总计数值A加1,向业务计数值a1由0变为1,总计数值A由0变为1。Exemplarily, FIG. 7 is a schematic diagram of information exchange and count value changes involved in establishing a physical link for the first time provided by an embodiment of the present application. As shown in FIG. 7 , the service module a1 in the electronic device A sends a first connection request to the communication interface program A. The communication interface program A determines the total count value A in response to the first connection request. As shown in Figure 7, this embodiment is the initial request to establish the first physical link, the service count value a1 corresponding to the service module a1 is 0, the total count value A of electronic device A is also 0, and the total count value B of electronic device B is also 0. is 0. Therefore, the communication interface program A determines that the total count value A is 0, that is, determines that the current first connection request is an initial connection request, and the communication interface program A sends the second connection request to the communication interface program B of the electronic device B. The communication interface program B establishes the first physical link with the communication interface program A in response to the second connection request, and adds 1 to the total count value B, and the total count value B changes from 0 to 1. Moreover, the communication interface program B sends the connection success information to the communication interface program A, and after the communication interface program A receives the connection success information, it adds 1 to the business count value a1, adds 1 to the total count value A, and adds 1 to the business count value a1 by 0 becomes 1, and the total count value A changes from 0 to 1.
2)再次请求建立物理链路2) Request to establish a physical link again
在按照上述1)的过程建立第一物理链路之后,业务模块还有可能再次请求建立物理链路,即再次发起连接请求。再次发起连接请求包括三种情况:①、业务模块a1再次发起连接请求;②、电子设备A中的其他业务模块(除业务模块a1之外的业务模块)发起连接请求;③、电子设备B中的业务模块发起连接请求。以下对三种情况分别进行说明。After the first physical link is established according to the process of 1) above, the service module may request to establish the physical link again, that is, initiate a connection request again. Initiating the connection request again includes three situations: ①, the service module a1 initiates the connection request again; ②, other service modules in the electronic device A (service modules other than the service module a1) initiate the connection request; ③, the electronic device B The business module initiates a connection request. The three situations are described below.
①、业务模块a1再次发起连接请求①. Business module a1 initiates a connection request again
示例性的,图8为本申请实施例提供的另一例物理链路的建立方法的流程示意图,该方法包括:Exemplarily, FIG. 8 is a schematic flowchart of another example of a method for establishing a physical link provided in an embodiment of the present application. The method includes:
S201、电子设备A中的应用程序A1的业务模块a1向通信接口程序A发送第一连接请求,第一连接请求用于指示通信接口程序A与电子设备B建立第一物理链路。S201. The service module a1 of the application program A1 in the electronic device A sends a first connection request to the communication interface program A, where the first connection request is used to instruct the communication interface program A to establish a first physical link with the electronic device B.
可选的,第一连接请求与上述实施例相同,不再赘述。Optionally, the first connection request is the same as that in the foregoing embodiment, and details are not repeated here.
S202、通信接口程序A响应于第一连接请求,确定当前电子设备A的总计数值A是否为0。S202. The communication interface program A determines whether the current total count value A of the electronic device A is 0 in response to the first connection request.
总计数值A大于0,说明第一物理链路已存在。本实施例中,电子设备A的总计数值为1,执行步骤S203。If the total count value A is greater than 0, it indicates that the first physical link already exists. In this embodiment, the total count value of the electronic device A is 1, and step S203 is executed.
S203、通信接口程序A向电子设备B的通信接口程序B发送第一复用连接请求,第一复用连接请求用于向通信接口程序B请求复用第一物理链路。S203. The communication interface program A sends a first multiplexing connection request to the communication interface program B of the electronic device B, where the first multiplexing connection request is used to request the communication interface program B to multiplex the first physical link.
可选的,第一复用连接请求中可以包括电子设备A的物理地址信息和第一物理链路的链路标识。链路标识便于通信接口程序B获知需要复用的物理链路为哪一条物理链路。Optionally, the first multiplexed connection request may include the physical address information of the electronic device A and the link identifier of the first physical link. The link identifier facilitates the communication interface program B to know which physical link the physical link that needs to be multiplexed is.
可选的,第一复用连接请求可以为JSON格式,如表2(未包含链路标识)所示:Optionally, the first multiplexed connection request can be in JSON format, as shown in Table 2 (link identifier not included):
表2Table 2
S204、电子设备B中的通信接口程序B响应于第一复用连接请求,向电子设备B的总计数值B加1。S204. The communication interface program B in the electronic device B adds 1 to the total count value B of the electronic device B in response to the first multiplexed connection request.
S205、通信接口程序B向通信接口程序A发送第一复用回复信息。S205. The communication interface program B sends the first multiplexing reply information to the communication interface program A.
通信接口程序B向总计数值B加1之后,向通信接口程序A发送第一复用回复信息,表征第一物理链路可复用。After the communication interface program B adds 1 to the total count value B, it sends the first multiplexing reply information to the communication interface program A, indicating that the first physical link can be multiplexed.
S206、通信接口程序A接收到第一复用回复信息,向电子设备A的总计数值A加1,并向业务模块a1对应的业务计数值a1加1。S206. The communication interface program A receives the first multiplexing reply information, adds 1 to the total count value A of the electronic device A, and adds 1 to the service count value a1 corresponding to the service module a1.
可以理解的是,在一些其他的实施例中,通信接口程序B也可以不向通信接口程序A发送第一复用回复信息。通信接口程序B在向通信接口程序B发送第一复用连接请求之后,直接向总计数值A加1,并向业务计数值a1加1。It can be understood that, in some other embodiments, the communication interface program B may not send the first multiplexing reply information to the communication interface program A. After the communication interface program B sends the first multiplexed connection request to the communication interface program B, it directly adds 1 to the total count value A, and adds 1 to the service count value a1.
示例性的,图9是本申请实施例提供的一例再次建立物理链路涉及的信息交互和计数值变化示意图。如图9所示,电子设备A中的业务模块a1向通信接口程序A发送第一连接请求。通信接口程序A响应于第一连接请求,确定电子设备A的总计数值A。如图9所示,本实施例中,业务模块a1对应的业务计数值a1为1,电子设备A的总计数值A也为1,电子设备B的总计数值也为1。因而,通信接口程序A确定总计数值A大于0,即确定当前连接请求为再次连接请求,通信接口程序A向电子设备B的通信接口程序B发送第一复用连接请求。通信接口程序B响应于第一复用连接请求,向总计数值B加1,总计数值B由1变为2。而且,通信接口程序B向通信接口程序A发送第一复用回复信息,通信接口程序A接收到第一复用回复信息后,向业务计数值a1加1,并向总计数值A加1,业务计数值a1由1变为2,总计数值A由1变为2。Exemplarily, FIG. 9 is a schematic diagram of information exchange and count value changes involved in re-establishing a physical link provided by an embodiment of the present application. As shown in FIG. 9 , the service module a1 in the electronic device A sends a first connection request to the communication interface program A. The communication interface program A determines the total count value A of the electronic device A in response to the first connection request. As shown in FIG. 9 , in this embodiment, the service count value a1 corresponding to the service module a1 is 1, the total count value A of electronic device A is also 1, and the total count value of electronic device B is also 1. Therefore, the communication interface program A determines that the total count value A is greater than 0, that is, determines that the current connection request is a reconnection request, and the communication interface program A sends the first multiplexed connection request to the communication interface program B of the electronic device B. The communication interface program B adds 1 to the total count value B in response to the first multiplexed connection request, and the total count value B changes from 1 to 2. Moreover, the communication interface program B sends the first multiplexing reply message to the communication interface program A, and after the communication interface program A receives the first multiplexing reply message, it adds 1 to the business count value a1, and adds 1 to the total count value A, and the business The count value a1 changes from 1 to 2, and the total count value A changes from 1 to 2.
②、电子设备A中的其他业务模块发起连接请求②. Other business modules in electronic device A initiate a connection request
本实施例中,接续图8和图9所示的实施例,以应用程序A2的业务模块a2向通信接口程序A发起连接请求为例进行说明。In this embodiment, following the embodiments shown in FIG. 8 and FIG. 9 , the service module a2 of the application program A2 initiates a connection request to the communication interface program A as an example for illustration.
示例性的,图10为本申请实施例提供的又一例物理链路的建立方法的流程示意图,该方法包括:Exemplarily, FIG. 10 is a schematic flowchart of another example of a method for establishing a physical link provided in an embodiment of the present application, and the method includes:
S301、电子设备A中的应用程序A2的业务模块a2向通信接口程序A发送第三连接请求,第三连接请求用于请求指示通信接口程序A与电子设备B建立第一物理链路。S301. The service module a2 of the application program A2 in the electronic device A sends a third connection request to the communication interface program A, and the third connection request is used to request and instruct the communication interface program A to establish a first physical link with the electronic device B.
第三连接请求与第一连接请求类似,不同点在于第三连接请求中的业务标识信息为业务模块a2对应的业务标识信息。The third connection request is similar to the first connection request, except that the service identification information in the third connection request is service identification information corresponding to the service module a2.
S302、通信接口程序A响应于第三连接请求,确定当前电子设备A的总计数值A是否为0。S302. The communication interface program A determines whether the current total count value A of the electronic device A is 0 in response to the third connection request.
本实施例中,电子设备A的总计数值为2,说明第一物理链路已存在,执行步骤S303。In this embodiment, the total count value of the electronic device A is 2, indicating that the first physical link already exists, and step S303 is executed.
S303、通信接口程序A向电子设备B的通信接口程序B发送第一复用连接请求,第一复用连接请求用于向通信接口程序B请求复用第一物理链路。S303. The communication interface program A sends a first multiplexing connection request to the communication interface program B of the electronic device B, where the first multiplexing connection request is used to request the communication interface program B to multiplex the first physical link.
第一复用连接请求同上述实施例,不再赘述。The first multiplexed connection request is the same as the above embodiment, and will not be repeated here.
S304、电子设备B中的通信接口程序B响应于第一复用连接请求,向电子设备B的总计数值B加1。S304. The communication interface program B in the electronic device B adds 1 to the total count value B of the electronic device B in response to the first multiplexed connection request.
S305、通信接口程序B向通信接口程序A发送第一复用回复信息。S305. The communication interface program B sends the first multiplexing reply information to the communication interface program A.
S306、通信接口程序A接收到第一复用回复信息,向电子设备A的总计数值A加1,并向业务模块a2对应的业务计数值a2加1。S306. The communication interface program A receives the first multiplexing reply information, adds 1 to the total count value A of the electronic device A, and adds 1 to the service count value a2 corresponding to the service module a2.
本实施例中,业务模块a2对应的业务计数值称为业务计数值a2。In this embodiment, the service count value corresponding to the service module a2 is called the service count value a2.
上述过程与图8对应的实施例所示的过程类似,不再赘述。The foregoing process is similar to the process shown in the embodiment corresponding to FIG. 8 , and will not be repeated here.
示例性的,图11是本申请实施例提供的另一例再次建立物理链路涉及的信息交互和计数值变化示意图。如图11所示,电子设备A中的业务模块a2向通信接口程序A发送第三连接请求。通信接口程序A响应于第三连接请求,确定电子设备A的总计数值A。如图11所示,本实施例中,当前业务模块a1对应的业务计数值a1为2,业务模块a2对应的业务计数值a2为0,电子设备A的总计数值A为2,电子设备B的总计数值B为2。因而,通信接口程序A确定总计数值A大于0,即确定当前连接请求为再次连接请求,通信接口程序A向电子设备B的通信接口程序B发送第一复用连接请求。通信接口程序B响应于第一复用连接请求,向总计数值B加1,总计数值B由2变为3。而且,通信接口程序B向通信接口程序A发送第一复用回复信息,通信接口程序A接收到第一复用回复信息后,向业务计数值a2加1,并向总计数值A加1,业务计数值a2由0变为1,总计数值A由2变为3,业务计数值a1仍为2。Exemplarily, FIG. 11 is a schematic diagram of another example of information interaction and count value changes involved in re-establishing a physical link provided by the embodiment of the present application. As shown in FIG. 11 , the service module a2 in the electronic device A sends a third connection request to the communication interface program A. The communication interface program A determines the total count value A of the electronic device A in response to the third connection request. As shown in Figure 11, in this embodiment, the business count value a1 corresponding to the current business module a1 is 2, the business count value a2 corresponding to the business module a2 is 0, the total count value A of electronic device A is 2, and the business count value a2 of electronic device B is 2. The total count value B is 2. Therefore, the communication interface program A determines that the total count value A is greater than 0, that is, determines that the current connection request is a reconnection request, and the communication interface program A sends the first multiplexed connection request to the communication interface program B of the electronic device B. The communication interface program B adds 1 to the total count value B in response to the first multiplexed connection request, and the total count value B changes from 2 to 3. Moreover, the communication interface program B sends the first multiplexing reply message to the communication interface program A, and after the communication interface program A receives the first multiplexing reply message, it adds 1 to the business count value a2, and adds 1 to the total count value A, and the business The count value a2 changes from 0 to 1, the total count value A changes from 2 to 3, and the service count value a1 remains 2.
本实施例中,在接收到第一复用回复信息后将总计数值A加1,且在接收到第二复用请求时,也将总计数值A加1。也就是说,无论是电子设备A中的业务模块复用第一物理链路,还是电子设备B中的业务模块复用第一物理链路,均更新总计数值A,同时,还对总计数值B进行同步更新,如此,保证了总计数值A和总计数值B的准确性,进而保证对第一物理链路管理的准确性。In this embodiment, 1 is added to the total count value A after receiving the first multiplexing reply information, and 1 is also added to the total count value A when the second multiplexing request is received. That is to say, whether the service module in electronic device A multiplexes the first physical link or the service module in electronic device B multiplexes the first physical link, the total count value A is updated, and at the same time, the total count value B is also updated. Synchronous updating is performed, so that the accuracy of the total count value A and the total count value B is guaranteed, thereby ensuring the accuracy of the management of the first physical link.
需要说明的是,本实施例以与应用程序A2中的业务模块a2为例,对电子设备A中的其他业务模块发起连接时复用第一物理链路的过程进行了说明。在其他实施例中,当应用程序A1中与业务模块a1不同的其他业务模块,例如应用程序A1中的业务模块a3发起业务连接请求时,实现过程与上述过程相同。也就是说,无论是否应用程序是否相同,只要是与上述业务模块a1不同的业务模块均定义为其他业务模块,实现过程均与上述过程相同。It should be noted that this embodiment takes the service module a2 in the application program A2 as an example to describe the process of multiplexing the first physical link when other service modules in the electronic device A initiate a connection. In other embodiments, when a service module different from the service module a1 in the application program A1 initiates a service connection request, for example, the service module a3 in the application program A1, the implementation process is the same as the above process. That is to say, no matter whether the application program is the same or not, as long as the business modules different from the above business module a1 are defined as other business modules, the implementation process is the same as the above process.
另外,可以理解,在通过上述过程完成对第一物理链路的复用请求之后,业务模块a2可以基于第一物理链路,与电子设备B中两个的业务模块建立逻辑链路,从而形成数据传输通道。例如,完成上述步骤S305后,业务模块a2可以根据电子设备B的网络地址信息和电子设备B中的业务模块b2的端口信息,基于第一物理链路,建立业务模块a2与业务模块b2之间的逻辑链路。需要说明的是,上述实施例中,业务模块a1基于第一物理链路建立了与业务模块b1之间的逻辑链路,本实施例中,业务模块a2基于第一物理链路建立了与业务模块b2之间的逻辑链路。也就是说,本申请实施例中,不同的业务模块共用物理链路,但是各自的逻辑链路独立,这样能够保证各个业务模块数据传输的独立性,在某一逻辑链路或业务端口出现问题时,不会影响其他的逻辑链路,不会对其他业务造成影响,提高电子设备业务功能的稳定性。In addition, it can be understood that after completing the multiplexing request for the first physical link through the above process, the service module a2 can establish logical links with the two service modules in the electronic device B based on the first physical link, thereby forming Data transmission channel. For example, after the above step S305 is completed, the service module a2 can establish a connection between the service module a2 and the service module b2 based on the first physical link according to the network address information of the electronic device B and the port information of the service module b2 in the electronic device B. logical link. It should be noted that, in the above embodiment, the service module a1 establishes a logical link with the service module b1 based on the first physical link. In this embodiment, the service module a2 establishes a logical link with the service module based on the first physical link. Logical link between modules b2. That is to say, in the embodiment of this application, different business modules share physical links, but their respective logical links are independent, which can ensure the independence of data transmission of each business module, and problems occur in a certain logical link or service port , it will not affect other logical links, will not affect other services, and improve the stability of electronic equipment service functions.
③、电子设备B中的业务模块发起连接请求③. The service module in electronic device B initiates a connection request
本实施例中,接续上述图10和图11所示的实施例,以电子设备B中的应用程序B1的业务模块b1向通信接口程序B发起连接请求为例进行说明。In this embodiment, following the above-mentioned embodiments shown in FIG. 10 and FIG. 11 , the service module b1 of the application program B1 in the electronic device B initiates a connection request to the communication interface program B as an example for illustration.
示例性的,图12为本申请实施例提供的又一例物理链路的建立方法的流程示意图,该方法包括:Exemplarily, FIG. 12 is a schematic flowchart of another example of a method for establishing a physical link provided in an embodiment of the present application, and the method includes:
S401、电子设备B中的应用程序B1的业务模块b1向通信接口程序B发送第四连接请求,第四连接请求用于请求指示通信接口程序B与电子设备A建立第一物理链路。S401. The service module b1 of the application program B1 in the electronic device B sends a fourth connection request to the communication interface program B, where the fourth connection request is used to request and instruct the communication interface program B to establish a first physical link with the electronic device A.
可选的,第四连接请求中可以包括对端设备的物理地址信息和链路类型。这里,对端设备是指电子设备A。Optionally, the fourth connection request may include physical address information and link type of the peer device. Here, the peer device refers to electronic device A.
S402、通信接口程序B响应于第四连接请求,确定当前电子设备B的总计数值B是否为0。S402. The communication interface program B determines whether the current total count value B of the electronic device B is 0 in response to the fourth connection request.
本实施例中,电子设备B的总计数值为3,说明第一物理链路已存在,执行步骤S403。In this embodiment, the total count value of the electronic device B is 3, indicating that the first physical link already exists, and step S403 is executed.
S403、通信接口程序B向电子设备A的通信接口程序A发送第二复用连接请求,第二复用连接请求用于向通信接口程序A请求复用第一物理链路。S403. The communication interface program B sends a second multiplexing connection request to the communication interface program A of the electronic device A, where the second multiplexing connection request is used to request the communication interface program A to multiplex the first physical link.
第二复用连接请求与第一复用连接请求类似,不同点在于第二复用连接请求中携带的物理地址信息为电子设备B的物理地址信息。The second multiplex connection request is similar to the first multiplex connection request, except that the physical address information carried in the second multiplex connection request is the physical address information of the electronic device B.
S404、电子设备A中的通信接口程序A响应于第二复用连接请求,向电子设备A的总计数值A和业务模块b1对应的业务计数值b1分别加1。S404. The communication interface program A in the electronic device A responds to the second multiplexed connection request and adds 1 to the total count value A of the electronic device A and the service count value b1 corresponding to the service module b1.
S405、通信接口程序A向通信接口程序B发送第二复用回复信息。S405. The communication interface program A sends the second multiplexing reply information to the communication interface program B.
S406、通信接口程序B接收到第二复用回复信息,向电子设备B的总计数值B加1。S406, the communication interface program B receives the second multiplexing reply information, and adds 1 to the total count value B of the electronic device B.
上述过程与图10对应的实施例所示的过程类似,不再赘述。The foregoing process is similar to the process shown in the embodiment corresponding to FIG. 10 , and will not be repeated here.
示例性的,图13是本申请实施例提供的又一例再次建立物理链路涉及的信息交互和计数值变化示意图。如图13所示,电子设备B中的业务模块b1向通信接口程序B发送第四连接请求。通信接口程序B响应于第四连接请求,确定电子设备B的总计数值B。如图13所示,本实施例中,当前业务模块a1对应的业务计数值a1为2,业务模块a2对应的业务计数值a2为1,电子设备A的总计数值A为3,电子设备B的总计数值B为3,业务模块b1对应的业务计数值b1为0。因而,通信接口程序B确定总计数值B大于0,即确定当前连接请求为再次连接请求,通信接口程序B向电子设备A的通信接口程序A发送第二复用连接请求。通信接口程序A响应于第二复用连接请求,向总计数值A加1,总计数值A由3变为4。而且,通信接口程序A向通信接口程序B发送第二复用回复信息,通信接口程序B接收到第二复用回复信息后,向业务计数值b1加1,向总计数值B加1,业务计数值b1由0变为1,总计数值B由3变为4。Exemplarily, FIG. 13 is a schematic diagram of another example of information interaction and count value changes involved in re-establishing a physical link provided by the embodiment of the present application. As shown in FIG. 13 , the service module b1 in the electronic device B sends a fourth connection request to the communication interface program B. The communication interface program B determines the total count value B of the electronic device B in response to the fourth connection request. As shown in Figure 13, in this embodiment, the business count value a1 corresponding to the current business module a1 is 2, the business count value a2 corresponding to the business module a2 is 1, the total count value A of electronic device A is 3, and the business count value a2 of electronic device B is The total count value B is 3, and the service count value b1 corresponding to the service module b1 is 0. Therefore, the communication interface program B determines that the total count value B is greater than 0, that is, determines that the current connection request is a reconnection request, and the communication interface program B sends a second multiplexed connection request to the communication interface program A of the electronic device A. The communication interface program A adds 1 to the total count value A in response to the second multiplexed connection request, and the total count value A changes from 3 to 4. Moreover, the communication interface program A sends the second multiplexing reply message to the communication interface program B, and after the communication interface program B receives the second multiplexing reply message, it adds 1 to the business count value b1, adds 1 to the total count value B, and the business count The value b1 changes from 0 to 1, and the total count value B changes from 3 to 4.
3)断开物理链路3) Disconnect the physical link
本实施例中,接续上述图12和图13所示的实施例,以业务模块a1发起断开连接请求为例,进一步说明断开第一物理链路的处理过程。In this embodiment, following the above-mentioned embodiments shown in FIG. 12 and FIG. 13 , taking the disconnection request initiated by the service module a1 as an example, the process of disconnecting the first physical link is further described.
示例性的,图14为本申请实施例提供的一例断开物理链路的流程示意图,该方法包括:Exemplarily, FIG. 14 is a schematic flowchart of an example of disconnecting a physical link provided by the embodiment of the present application. The method includes:
S501、电子设备A中的应用程序A1的业务模块a1向通信接口程序A发送第一断开连接请求,第一断开连接请求用于指示通信接口程序A断开与电子设备B的第一物理链路。S501. The business module a1 of the application program A1 in the electronic device A sends a first disconnection request to the communication interface program A, and the first disconnection request is used to instruct the communication interface program A to disconnect the first physical connection with the electronic device B. link.
可选的,第一断开连接请求中可以包括业务模块a1对应的业务标识信息、对端设备的物理地址信息和第一物理链路的链路标识等。Optionally, the first disconnection request may include service identification information corresponding to the service module a1, physical address information of the peer device, link identification of the first physical link, and the like.
S502、通信接口程序A响应于第一断开连接请求,确定当前业务模块a1对应的业务计数值a1是否为0;若否,则执行步骤S503;若是,不执行任何操作。S502, the communication interface program A responds to the first disconnection request, and determines whether the service counter value a1 corresponding to the current service module a1 is 0; if not, execute step S503; if yes, do not perform any operation.
可以理解,在一些情况下,虽然某些业务模块的业务计数值为0,但是特殊原因,该业务模块仍可能向通信接口程序发送第一断开连接请求。例如,特殊原因例如:业务计数值为0但是用户仍然操作了第一断开连接请求,或者业务模块按照预设流程检测到第一物理连接仍存在等等。这种情况下,认为该第一断开连接请求为无效连接请求。It can be understood that in some cases, although the service count value of some service modules is 0, for special reasons, the service module may still send the first disconnection request to the communication interface program. For example, special reasons such as: the service count value is 0 but the user still operates the first disconnection request, or the service module detects that the first physical connection still exists according to a preset process, and so on. In this case, it is considered that the first disconnection request is an invalid connection request.
具体的,通信接口程序A接收到第一断开连接请求时,确定对应的业务计数值a1是否为0,若为0,说明业务模块a1对未发起过第一连接请求,或者业务模块a1对应的所有第一断开连接请求已经处理完毕,说明当前第一断开连接请求为无效断开连接请求,不再对业务计数值a1减1,也不对总计数值A减1,即不做任何操作。若业务计数值a1大于0,则说明当前第一断开连接请求为有效断开连接请求。Specifically, when the communication interface program A receives the first disconnection request, it determines whether the corresponding service count value a1 is 0. If it is 0, it means that the service module a1 has not initiated the first connection request, or the service module a1 corresponds to All the first disconnection requests have been processed, indicating that the current first disconnection request is an invalid disconnection request, and the business count value a1 will not be decremented by 1, and the total count value A will be decremented by 1, that is, no operation will be performed . If the service count value a1 is greater than 0, it indicates that the current first disconnection request is a valid disconnection request.
S503、将电子设备A的总计数值A和业务计数值a1分别减1。S503. Subtract 1 from the total count value A and the service count value a1 of the electronic device A, respectively.
S504、通信接口程序A确定减1后的总计数值A是否均为0;若是,则执行步骤S505和S506;若否,则执行步骤S507和S508。S504, the communication interface program A determines whether the total count value A after subtracting 1 is all 0; if yes, execute steps S505 and S506; if not, execute steps S507 and S508.
减1后的总计数值A为0,说明当前没有业务需要再使用第一物理链路,可以断开第一物理链路,执行步骤S505和S506。减1后的总计数值A不为0,说明还有其他业务需要使用第一物理链路,只对更新计数值即可,不断开第一物理链路,执行步骤S507和S508。The total count value A after decrementing 1 is 0, indicating that there is no service that needs to use the first physical link again, and the first physical link can be disconnected, and steps S505 and S506 are performed. The total count value A after subtracting 1 is not 0, indicating that there are other services that need to use the first physical link, and only the count value needs to be updated, and the first physical link is not disconnected, and steps S507 and S508 are performed.
S505、通信接口程序A根据第一断开连接请求生成第二断开连接请求,并将第二断开连接请求发送至电子设备B中的通信接口程序B。S505. The communication interface program A generates a second disconnection request according to the first disconnection request, and sends the second disconnection request to the communication interface program B in the electronic device B.
可选的,第二断开连接请求中包括电子设备A的物理地址信息和第一物理链路的链路标识。Optionally, the second disconnection request includes the physical address information of electronic device A and the link identifier of the first physical link.
可选的,第二断开连接请求可以为JSON格式,如表3(未包含链路标识)所示:Optionally, the second disconnection request can be in JSON format, as shown in Table 3 (link identifier not included):
表3table 3
S506、电子设备B中的通信接口程序B响应于第二断开连接请求,将电子设备B的总计数值B减1,并断开与通信接口程序A的第一物理链路。S506. The communication interface program B in the electronic device B decreases the total count value B of the electronic device B by 1 in response to the second disconnection request, and disconnects the first physical link with the communication interface program A.
S507、通信接口程序A向电子设备B的通信接口程序B发送减少计数指令,减少计数指令用于指示通信接口程序B减少电子设备B的总计数值B。S507. The communication interface program A sends a decrement count instruction to the communication interface program B of the electronic device B, and the decrement count command is used to instruct the communication interface program B to reduce the total count value B of the electronic device B.
S508、通信接口程序B响应于减少计数指令,将电子设备B的总计数值B减1。S508. The communication interface program B decreases the total count value B of the electronic device B by 1 in response to the count down instruction.
需要说明的是,本申请实施例以电子设备A中的业务模块a1发起第一断开连接请求为例进行说明,对于电子设备A中的其他业务模块(例如业务模块a2),以及电子设备B中的业务模块(例如业务模块b1)发起第一断开连接请求的过程与此类似,不再赘述。It should be noted that the embodiment of this application takes the service module a1 in electronic device A as an example to initiate the first disconnection request. For other service modules in electronic device A (such as service module a2) and electronic device B The process of initiating the first disconnection request by a service module (for example, service module b1 ) in is similar to this and will not be repeated here.
以下结合附图,对几种不同业务计数值和总计数值对应的场景下,断开物理链路涉及的信息交互和计数值变化分别进行说明。The information interaction and count value changes involved in disconnecting the physical link in several scenarios corresponding to different service count values and total count values are described below with reference to the accompanying drawings.
示例性的,图15是本申请实施例提供的一例断开物理链路涉及的信息交互和计数值变化示意图。本实施例以业务模块a2发起断开连接请求(称为第三断开连接请求),且发起第三断开连接请求时,电子设备A的总计数值A为4,业务计数值a1为2,业务计数值a2为1,电子设备B的总计数值B为4,业务计数值b1为1为例进行说明。Exemplarily, FIG. 15 is a schematic diagram of information interaction and count value changes involved in disconnection of a physical link provided by an embodiment of the present application. In this embodiment, the service module a2 initiates a disconnection request (referred to as the third disconnection request), and when the third disconnection request is initiated, the total count value A of the electronic device A is 4, and the service count value a1 is 2. The service count value a2 is 1, the total count value B of the electronic device B is 4, and the service count value b1 is 1 as an example for illustration.
如图15所示,电子设备A中的业务模块a2向通信接口程序A发送第三断开连接请求。第三断开连接请求用于指示通信接口程序A断开第一物理链路,与第一断开连接请求不同的是,第三断开连接指令中携带的业务标识信息不同。通信接口程序A响应于第三断开连接请求,确定当前业务计数值a2是否为0。本实施例中,当前业务计数值a2为1,大于0,因而通信接口程序A将总计数值A和业务计数值a2分别减1,总计数值A由4变为3,业务计数值a2由1变为0。之后,通信接口程序A确定减1后的总计数值A是否为0。本实施例中,减1后的总计数值A为3,大于0,因而,通信接口程序A向电子设备B的通信接口程序B发送减少计数指令。通信接口程序B响应于减少计数指令,将总计数值B减1,总计数值B由4变为3。As shown in FIG. 15 , the service module a2 in the electronic device A sends a third disconnection request to the communication interface program A. The third disconnection request is used to instruct communication interface program A to disconnect the first physical link. The difference from the first disconnection request is that the service identification information carried in the third disconnection instruction is different. The communication interface program A determines whether the current traffic count value a2 is 0 in response to the third disconnection request. In this embodiment, the current business count value a2 is 1, which is greater than 0. Therefore, the communication interface program A reduces the total count value A and the business count value a2 by 1 respectively, the total count value A changes from 4 to 3, and the business count value a2 changes from 1 to is 0. After that, the communication interface program A determines whether the total count value A decremented by 1 is 0 or not. In this embodiment, the total count value A after decrementing by 1 is 3, which is greater than 0. Therefore, the communication interface program A sends a count down instruction to the communication interface program B of the electronic device B. The communication interface program B decreases the total count value B by 1 in response to the decrement count instruction, and the total count value B changes from 4 to 3.
示例性的,图16是本申请实施例提供的另一例断开物理链路涉及的信息交互和计数值变化示意图。本实施例接续图15所示实施例,以业务模块a2发起第三断开连接请求为例进行说明。即,业务模块a2发起第三断开连接请求时,电子设备A的总计数值A为3,业务计数值a1为2,业务计数值a2为0,电子设备B的总计数值B为3,业务计数值b1为1。Exemplarily, FIG. 16 is a schematic diagram of another example of information interaction and count value changes involved in disconnection of a physical link provided by the embodiment of the present application. This embodiment continues the embodiment shown in FIG. 15 , and the third disconnection request initiated by the service module a2 is taken as an example for description. That is, when the service module a2 initiates the third disconnection request, the total count value A of the electronic device A is 3, the service count value a1 is 2, the service count value a2 is 0, the total count value B of the electronic device B is 3, and the service count value is 3. The value b1 is 1.
如图16所示,电子设备A中的业务模块a2向通信接口程序A发送第三断开连接请求。通信接口程序A响应于第三断开连接请求,确定当前业务计数值a2是否为0。本实施例中,当前业务计数值a2为0,因而通信接口程序A确定该第三断开连接请求为无效断开连接请求,不做任何处理。As shown in FIG. 16 , the service module a2 in the electronic device A sends a third disconnection request to the communication interface program A. The communication interface program A determines whether the current traffic count value a2 is 0 in response to the third disconnection request. In this embodiment, the current service count value a2 is 0, so the communication interface program A determines that the third disconnection request is an invalid disconnection request, and does not perform any processing.
示例性的,图17是本申请实施例提供的又一例断开物理链路涉及的信息交互和计数值变化示意图。本实施例接续图16所示实施例,以电子设备B中的业务模块b1发起断开连接请求(称为第四断开连接请求)为例进行说明。即,业务模块b1发起第四断开连接请求时,电子设备A的总计数值A为3,业务计数值a1为2,业务计数值a2为0,电子设备B的总计数值B为3,业务计数值b1为1。Exemplarily, FIG. 17 is a schematic diagram of another example of information interaction and count value changes involved in disconnection of a physical link provided by the embodiment of the present application. This embodiment continues the embodiment shown in FIG. 16 , and the service module b1 in the electronic device B initiates a disconnection request (referred to as a fourth disconnection request) as an example for illustration. That is, when the service module b1 initiates the fourth disconnection request, the total count value A of the electronic device A is 3, the service count value a1 is 2, the service count value a2 is 0, the total count value B of the electronic device B is 3, and the service count value is 3. The value b1 is 1.
如图17所示,电子设备B中的业务模块b1向通信接口程序B发送第四断开连接请求。第四断开连接请求用于指示通信接口程序B断开第一物理链路。通信接口程序B响应于第四断开连接请求,确定总计数值B是否为0。本实施例中,总计数值B为3,大于0,因而,通信接口程序B将总计数值B和业务计数值b1分别减1,总计数值A由3变为2,业务计数值b1由1变为0。之后,通信接口程序B确定减1后的总计数值B是否为0。本实施例中,减1后的总计数值B为2,大于0,因而,通信接口程序B向电子设备A的通信接口程序A发送减少计数指令。通信接口程序B响应于减少计数指令,将总计数值A减1,总计数值A由3变为2。As shown in FIG. 17 , the service module b1 in the electronic device B sends a fourth disconnection request to the communication interface program B. The fourth disconnection request is used to instruct the communication interface program B to disconnect the first physical link. The communication interface program B determines whether the total count value B is 0 in response to the fourth disconnection request. In this embodiment, the total count value B is 3, which is greater than 0. Therefore, the communication interface program B subtracts 1 from the total count value B and the business count value b1, the total count value A changes from 3 to 2, and the business count value b1 changes from 1 to 0. After that, the communication interface program B determines whether the total count value B decremented by 1 is 0 or not. In this embodiment, the total count value B after subtracting 1 is 2, which is greater than 0. Therefore, the communication interface program B sends a count down instruction to the communication interface program A of the electronic device A. The communication interface program B decreases the total count value A by 1 in response to the decrement count instruction, and the total count value A changes from 3 to 2.
示例性的,图18是本申请实施例提供的又一例断开物理链路涉及的信息交互和计数值变化示意图。本实施例以业务模块a1发起第一断开连接请求,且发起第一断开连接请求时,电子设备A的总计数值A为1,业务计数值a1为1,业务计数值a2为0,电子设备B的总计数值B为1,业务计数值b1为0为例进行说明。Exemplarily, FIG. 18 is a schematic diagram of another example of information interaction and count value changes involved in disconnection of a physical link provided by an embodiment of the present application. In this embodiment, the service module a1 initiates the first disconnection request, and when the first disconnection request is initiated, the total count value A of the electronic device A is 1, the service count value a1 is 1, the service count value a2 is 0, and the electronic device A The total count value B of the device B is 1, and the service count value b1 is 0 as an example for illustration.
如图18所示,电子设备A中的业务模块a1向通信接口程序A发送第一断开连接请求。通信接口程序A响应于第一断开连接请求,确定当前业务计数值a1是否为0。本实施例中,当前业务计数值a1为1,大于0,因而通信接口程序A将总计数值A和业务计数值a1分别减1,总计数值A由1变为0,业务计数值a1由1变为0。之后,通信接口程序A确定减1后的总计数值A是否为0。本实施例中,减1后的总计数值A为0,因而,通信接口程序A向电子设备B的通信接口程序B第二断开连接请求。通信接口程序B响应于第二断开连接指令,断开第一物理链路,并将总计数值B减1,总计数值B由1变为0。As shown in FIG. 18 , the service module a1 in the electronic device A sends a first disconnection request to the communication interface program A. The communication interface program A determines whether the current traffic count value a1 is 0 in response to the first disconnection request. In this embodiment, the current service count value a1 is 1, which is greater than 0. Therefore, the communication interface program A reduces the total count value A and the service count value a1 by 1, the total count value A changes from 1 to 0, and the service count value a1 changes from 1 to 0. is 0. After that, the communication interface program A determines whether the total count value A decremented by 1 is 0 or not. In this embodiment, the total count value A after subtracting 1 is 0, therefore, the communication interface program A sends a second disconnection request to the communication interface program B of the electronic device B. The communication interface program B disconnects the first physical link in response to the second disconnection instruction, and decreases the total count value B by 1, and the total count value B changes from 1 to 0.
下面结合图19对上述第一物理链路的连接和断开过程进行概括性描述。The process of connecting and disconnecting the above-mentioned first physical link will be described in general below with reference to FIG. 19 .
示例性的,图19为本申请实施例提供的一例物理链路的建立和断开的时序图,如图19所示,第一时刻点t1,业务模块a1发起第一连接请求,建立第一物理链路,业务模块a1对应的业务计数值a1加1,电子设备A的总计数值A加1,电子设备B的总计数值B加1。此时,业务计数值a1=1,总计数值A=1,总计数值B=1。Exemplarily, FIG. 19 is a sequence diagram of the establishment and disconnection of a physical link provided by the embodiment of the present application. As shown in FIG. 19, at the first time point t1, the service module a1 initiates the first For a physical link, the service count value a1 corresponding to the service module a1 is incremented by 1, the total count value A of electronic device A is incremented by 1, and the total count value B of electronic device B is incremented by 1. At this time, the service count value a1=1, the total count value A=1, and the total count value B=1.
第二时刻点t2,业务模块a2发起第三连接请求,复用第一物理链路,业务模块a2对应的业务计数值加1,电子设备A的总计数值A加1,电子设备B的总计数值B加1。此时,业务计数值a1=1,业务计数值a2=1,总计数值A=2,总计数值B=2。At the second time point t2, the service module a2 initiates the third connection request and multiplexes the first physical link, the service count value corresponding to the service module a2 increases by 1, the total count value A of electronic device A increases by 1, and the total count value of electronic
第三时刻点t3,业务模块a1发起第一断开连接请求,当前业务计数值a1=1,因而该第一断开连接请求为有效断开连接请求,业务模块a1对应的业务计数值a1减1,电子设备A的总计数值A减1,电子设备B的总计数值B减1。此时,业务计数值a1=0,业务计数值a2=1,总计数值A=1,总计数值B=1。但是,减1后的总计数值A大于0,因而第一物理链路继续保持,即,不断开第一物理链路。At the third moment t3, the service module a1 initiates the first disconnection request, and the current service count value a1=1, so the first disconnection request is a valid disconnection request, and the service count value a1 corresponding to the service module a1 is decremented 1. The total count value A of electronic device A is decremented by 1, and the total count value B of electronic device B is decremented by 1. At this time, the service count value a1=0, the service count value a2=1, the total count value A=1, and the total count value B=1. However, the total count value A after subtracting 1 is greater than 0, so the first physical link continues to be maintained, that is, the first physical link is not disconnected.
第三时刻点t4,业务模块a1发起第一断开连接请求,当前业务计数值a1=0,因而该第一断开连接请求为无效断开连接请求,各个业务模块计数值和总计数值保持不变,且第一物理链路继续保持。此时,业务计数值a1=0,业务计数值a2=1,总计数值A=1,总计数值B=1。At the third moment t4, the service module a1 initiates the first disconnection request, and the current service count value a1=0, so the first disconnection request is an invalid disconnection request, and the count value of each service module and the total count value remain unchanged. change, and the first physical link continues to be maintained. At this time, the service count value a1=0, the service count value a2=1, the total count value A=1, and the total count value B=1.
第五时刻点t5,业务模块a2发起第三断开连接请求,当前业务计数值a2=1,因而该第三断开连接请求为有效断开连接请求,业务模块a2对应的业务计数值a2减1,电子设备A的总计数值A减1,电子设备B的总计数值B减1。此时,业务计数值a1=0,业务计数值a2=0,总计数值A=0,总计数值B=0。而且,减1后的总计数值A等于0,因而断开第一物理链路。At the fifth moment t5, the service module a2 initiates the third disconnection request, and the current service count value a2=1, so the third disconnection request is a valid disconnection request, and the service count value a2 corresponding to the service module a2 is decremented 1. The total count value A of electronic device A is decremented by 1, and the total count value B of electronic device B is decremented by 1. At this time, the service count value a1=0, the service count value a2=0, the total count value A=0, and the total count value B=0. Moreover, the total count value A after subtracting 1 is equal to 0, thus disconnecting the first physical link.
本申请实施例提供的方法中,在业务模块请求断开物理链路时,会对业务模块对应的业务计数值进行判断。若当前业务计数值0,则确定当前断开连接请求为无效断开连接请求,不处理此次断开连接请求。这样能够保证业务计数值和总计数值的准确性,提高对物理链路管理的准确性。另外,该方法中,只有减1后的总计数值为0时才断开第一物理链路,最大程度复用第一物理链路,提高第一物理链路利用率。而且,由图19可以看出,虽然第一物理链路是在t1时刻点,响应于业务模块a1初次发起的第一连接请求建立的,但是,最终第一物理链路是响应于业务模块a2发起的断开连接请求成功断开的。也就是说,无论第一物理链路由哪个业务模块发起建立,只要在接收到有效断开连接请求后,减1后的总计数值为0,就断开连接第一物理链路。这样,第一物理链路的断开不用受限于发起连接的业务模块的限制,防止出现某一业务模块的发起的连接只能由该业务模块断开的情况,保证了业务模块之间的独立性,提高了电子设备业务功能的稳定性和可靠性。In the method provided in the embodiment of the present application, when the service module requests to disconnect the physical link, the service count value corresponding to the service module is judged. If the current service count value is 0, it is determined that the current disconnection request is an invalid disconnection request, and this disconnection request is not processed. In this way, the accuracy of the service count value and total count value can be guaranteed, and the accuracy of physical link management can be improved. In addition, in this method, the first physical link is disconnected only when the total count value after subtracting 1 is 0, so as to maximize the reuse of the first physical link and improve the utilization rate of the first physical link. Moreover, it can be seen from Figure 19 that although the first physical link is established at time t1 in response to the first connection request initially initiated by the service module a1, the final first physical link is established in response to the first connection request initiated by the service module a2 The disconnect request initiated successfully disconnected. That is to say, no matter which service module initiates the establishment of the first physical link, as long as the total count value after decrementing 1 is 0 after receiving an effective disconnection request, the first physical link is disconnected. In this way, the disconnection of the first physical link does not need to be limited by the service module that initiates the connection, preventing the situation that the connection initiated by a certain service module can only be disconnected by the service module, and ensuring the connection between the service modules. Independence improves the stability and reliability of electronic equipment business functions.
上文详细介绍了本申请实施例提供的物理链路的建立方法的示例。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。An example of the method for establishing a physical link provided by the embodiment of the present application has been introduced in detail above. It can be understood that, in order to realize the above functions, the electronic device includes hardware and/or software modules corresponding to each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本申请实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分为各个功能模块,例如检测单元、处理单元、显示单元等,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the embodiment of the present application, the functional modules of the electronic device can be divided according to the above method examples. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more than two The functions are integrated in one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that all relevant content of the steps involved in the above method embodiments can be referred to the function description of the corresponding function module, and will not be repeated here.
本实施例提供的电子设备,用于执行上述物理链路的建立方法,因此可以达到与上述实现方法相同的效果。The electronic device provided in this embodiment is used to execute the foregoing method for establishing a physical link, and therefore can achieve the same effect as the foregoing implementation method.
在采用集成的单元的情况下,电子设备还可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理。存储模块可以用于支持电子设备执行存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。In the case of an integrated unit, the electronic device may also include a processing module, a memory module and a communication module. Wherein, the processing module can be used to control and manage the actions of the electronic device. The memory module can be used to support electronic devices to execute stored program codes and data, and the like. The communication module can be used to support the communication between the electronic device and other devices.
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。Wherein, the processing module may be a processor or a controller. It can implement or execute the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The processor may also be a combination of computing functions, for example, a combination of one or more microprocessors, a combination of digital signal processing (digital signal processing, DSP) and a microprocessor, and so on. The storage module may be a memory. Specifically, the communication module may be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的电子设备可以为具有图4所示结构的设备。In an embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a device having the structure shown in FIG. 4 .
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储了计算机程序,当计算机程序被处理器执行时,使得处理器执行上述任一实施例的物理链路的建立方法。An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor executes the establishment of the physical link in any of the above-mentioned embodiments method.
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的物理链路的建立方法。An embodiment of the present application also provides a computer program product, which, when running on a computer, causes the computer to execute the above-mentioned related steps, so as to implement the method for establishing a physical link in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的物理链路的建立方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor may execute the computer-executable instructions stored in the memory, so that the chip executes the method for establishing a physical link in the foregoing method embodiments.
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above-mentioned The beneficial effects of the corresponding method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be assigned by different Completion of functional modules means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component shown as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If an integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk, and other media capable of storing program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above content is only the specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application, and should covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (15)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210841718.8A CN114928899B (en) | 2022-07-18 | 2022-07-18 | Physical link establishment method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210841718.8A CN114928899B (en) | 2022-07-18 | 2022-07-18 | Physical link establishment method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114928899A CN114928899A (en) | 2022-08-19 |
CN114928899B true CN114928899B (en) | 2022-10-28 |
Family
ID=82815883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210841718.8A Active CN114928899B (en) | 2022-07-18 | 2022-07-18 | Physical link establishment method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114928899B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102724132A (en) * | 2012-06-29 | 2012-10-10 | 杭州迪普科技有限公司 | Method and device for improving transmission control protocol (TCP) connection multiplexing processing efficiency |
CN103023987A (en) * | 2012-11-27 | 2013-04-03 | 蓝盾信息安全技术股份有限公司 | Multiplexing method based on transmission control protocol (TCP) connection |
CN114679732A (en) * | 2020-12-24 | 2022-06-28 | 华为技术有限公司 | Method and electronic equipment for data transmission under Wi-Fi direct connection |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6597698B1 (en) * | 1997-12-19 | 2003-07-22 | Telefonaktiebolaget Lm Ericsson (Publ) | Coordinated cell discharge from ATM queue |
CN100401807C (en) * | 2004-11-25 | 2008-07-09 | 华为技术有限公司 | Creation for shared link in digit group system |
WO2018113086A1 (en) * | 2016-12-24 | 2018-06-28 | 华为技术有限公司 | Wireless connection switching method and terminal |
CN111131224B (en) * | 2019-12-20 | 2022-08-09 | 成都华为技术有限公司 | Method for maintaining connection and storage device |
-
2022
- 2022-07-18 CN CN202210841718.8A patent/CN114928899B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102724132A (en) * | 2012-06-29 | 2012-10-10 | 杭州迪普科技有限公司 | Method and device for improving transmission control protocol (TCP) connection multiplexing processing efficiency |
CN103023987A (en) * | 2012-11-27 | 2013-04-03 | 蓝盾信息安全技术股份有限公司 | Multiplexing method based on transmission control protocol (TCP) connection |
CN114679732A (en) * | 2020-12-24 | 2022-06-28 | 华为技术有限公司 | Method and electronic equipment for data transmission under Wi-Fi direct connection |
Also Published As
Publication number | Publication date |
---|---|
CN114928899A (en) | 2022-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113490191B (en) | Bluetooth communication method, medium and electronic device thereof | |
EP4084486B1 (en) | Cross-device content projection method, and electronic device | |
US20230106906A1 (en) | Method for Displaying Bluetooth Device Identifier and Electronic Device | |
US20240069850A1 (en) | Application Sharing Method, Electronic Device, and Storage Medium | |
WO2023061146A9 (en) | Method for monitoring link and terminal device | |
WO2021017894A1 (en) | Method for using remote sim module, and electronic apparatus | |
CN113645608B (en) | Data transmission method and data transmission device | |
CN114554463A (en) | Bluetooth communication method, Bluetooth broadcasting method, Bluetooth device, and storage medium | |
CN114968384B (en) | Function calling method and device | |
WO2022001192A1 (en) | Method for transmitting application data, and terminal and system | |
WO2023035834A1 (en) | Wi-fi direct communication method and apparatus | |
WO2024140122A1 (en) | Connection management method, apparatus, and system for electronic device | |
CN114928899B (en) | Physical link establishment method and electronic equipment | |
CN113840030B (en) | Icon display method, electronic device and readable storage medium | |
EP4191409A1 (en) | Shared library multiplexing method and electronic device | |
CN116033157A (en) | Screen projection method and electronic device | |
CN116033158A (en) | Screen projection method and electronic equipment | |
CN115002842A (en) | Data transmission method, electronic device and readable storage medium | |
CN117479344B (en) | A Bluetooth connection method, electronic device and readable storage medium | |
CN116679895B (en) | Collaborative business scheduling method, electronic equipment and collaborative system | |
CN114916017B (en) | Data transmission method, electronic device and readable storage medium | |
CN117135199B (en) | Session management method and electronic equipment | |
US20250008441A1 (en) | Power consumption reduction method and electronic device | |
WO2023035885A1 (en) | Communication method and electronic device | |
CN119071938A (en) | Method for dynamically connecting devices and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |