WO2023035834A1 - Wi-fi direct communication method and apparatus - Google Patents

Wi-fi direct communication method and apparatus Download PDF

Info

Publication number
WO2023035834A1
WO2023035834A1 PCT/CN2022/111118 CN2022111118W WO2023035834A1 WO 2023035834 A1 WO2023035834 A1 WO 2023035834A1 CN 2022111118 W CN2022111118 W CN 2022111118W WO 2023035834 A1 WO2023035834 A1 WO 2023035834A1
Authority
WO
WIPO (PCT)
Prior art keywords
group
terminal device
connection
merging
negotiation
Prior art date
Application number
PCT/CN2022/111118
Other languages
French (fr)
Chinese (zh)
Inventor
周志伟
陶华涛
王元发
吴正
姜印清
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023035834A1 publication Critical patent/WO2023035834A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Definitions

  • the embodiments of the present application relate to the field of communication technologies, and in particular, to a Wi-Fi Direct communication method and device.
  • Wi-Fi Direct also called “Wi-Fi P2P”
  • Wi-Fi P2P wireless-fidelity P2P
  • Wi-Fi Direct can connect terminal devices to each other without an intermediary wireless access point (access point, AP).
  • the embodiment of the present application provides a Wi-Fi direct communication method and device to solve the problem that existing Wi-Fi direct technology cannot establish Wi-Fi P2P between terminal devices that belong to different P2P groups. The problem.
  • an embodiment of the present application provides a Wi-Fi direct communication method, the method comprising: the second terminal device receives a request for establishing a Wi-Fi P2P connection initiated by the first terminal device, or the second terminal device The device initiates a Wi-Fi P2P connection establishment request to the first terminal device, the second terminal device belongs to the second point-to-point P2P group, the first terminal device belongs to the first P2P group; the second terminal device Negotiating with the first terminal device on P2P group merging, and obtaining a negotiation result, the negotiation result is used to indicate that the second P2P group and the first P2P group are merged into a third P2P group; The second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group.
  • the method further includes: the second terminal device sending the negotiation result to at least one other terminal device in the second P2P group, so that each of the other terminal devices After disconnecting the link in the second P2P group, establish a Wi-Fi P2P connection with the third GO respectively.
  • the preset merging rules include one or more of the following rules: the P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices; the service priority is low P2P groups with high service priority are merged into P2P groups with high service priority; P2P groups with small channel bandwidth are merged into P2P groups with large channel bandwidth; P2P groups with low traffic volume are merged into P2P groups with large traffic volume; The P2P group is merged into the P2P group with strong GO performance; the P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
  • the second terminal device if the negotiation result is the merging of the second P2P group into the first P2P group, the second terminal device, based on the service state of the second P2P group, Save the second P2P group service information; the second terminal device and the second GO perform P2P group disassembly, and the P2P group disassembly is used to disconnect the Wi-Fi connection between the second terminal device and the second GO -Fi P2P connection; the second terminal device initiates a Wi-Fi P2P connection establishment request to the third GO; and the second GO initiates a Wi-Fi P2P connection establishment request to the third GO; the second GO initiates a Wi-Fi P2P connection establishment request; The second terminal device receives a confirmation message from the third GO, the confirmation message is used to indicate that the third GO agrees that the second terminal device joins the third P2P group; and the second GO receives the confirmation message from A confirmation message of the third GO, where the confirmation message is used to
  • the embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable medium stores a computer program (also referred to as code, or instruction) which, when run on a computer, causes the computer to perform the above-mentioned first A method in any one of the possible implementations of the aspect.
  • the embodiment of the present application provides a computer program product
  • the computer program product includes: a computer program (also referred to as code, or instruction), when the computer program is executed, it causes the computer to perform any of the above-mentioned first aspects.
  • a computer program also referred to as code, or instruction
  • the embodiment of the present application also provides a graphical user interface on a terminal device, the terminal device has a display screen, one or more memories, and one or more processors, and the one or more processors are used to Executing one or more computer programs stored in the one or more memories, the graphical user interface includes a graphical user interface displayed when the terminal device executes any possible implementation manner of the first aspect of the embodiments of the present application, Or a graphical user interface displayed when any possible implementation manner of the second aspect of the embodiment of the present application is executed.
  • the embodiment of the present application provides a Wi-Fi direct connection communication method.
  • two different P2P groups are combined into one
  • the design idea of a new P2P group includes one GO and multiple GCs in the new P2P group, and then realizes the Wi-Fi P2P connection between GO and each GC, and the MAC layer between GC and GC through GO Relay and Wi-Fi P2P connections on the application layer.
  • the terminal device in the embodiment of the present application may be a mobile phone, a tablet computer, a wearable device (for example, a watch, a bracelet, a helmet, a headset, etc.), a vehicle device, an augmented reality (augmented reality, AR)/virtual Reality (virtual reality, VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices (e.g., smart TVs, smart screens) , smart speakers, smart cameras, etc.), printers, etc.
  • augmented reality augmented reality, AR
  • VR virtual Reality
  • laptops ultra-mobile personal computers
  • PDAs personal digital assistants
  • smart home devices e.g., smart TVs, smart screens
  • Fig. 5 shows a schematic diagram of a hardware structure of a possible terminal device.
  • the terminal device 200 includes: a radio frequency (radio frequency, RF) circuit 210, a power supply 220, a processor 230, a memory 240, an input unit 250, a display unit 260, an audio circuit 270, a communication interface 280, and a wireless fidelity ( wireless-fidelity, Wi-Fi) module 290 and other components.
  • RF radio frequency
  • the terminal device 200 shown in FIG. 5 does not constitute a limitation on the terminal device 200, and the terminal device 200 provided in the embodiment of the present application may include more or less components than those shown in the illustration , two or more components may be combined, or may have different component configurations.
  • the various components shown in Figure 5 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • the input unit 250 can be used to receive editing operations of various types of data objects such as numbers or character information input by the user, and generate key signal input related to user settings and function control of the terminal device 200 .
  • the input unit 250 may include a touch panel 251 and other input devices 252 .
  • FIG. 6 is a block diagram of a software structure of a terminal device provided by an embodiment of the present application.
  • the software structure of the terminal device may be a layered architecture, for example, the software may be divided into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the operating system is divided into five layers, which are application program layer, application program framework layer (framework, FWK), runtime and system library, kernel layer, and hardware layer from top to bottom.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is issued, the terminal device vibrates, and the indicator light flashes, etc.
  • the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
  • 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 kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
  • a plurality referred to in the embodiment of the present application means greater than or equal to two.
  • the design concept of the method provided in this application is to perform group merging on multiple different P2P groups when there is a scenario where a Wi-Fi P2P connection needs to be established between the first terminal device and the second terminal device belonging to different P2P groups , realizing building the first terminal device and the second terminal device into a new P2P group.
  • the mobile phone 1 can also directly refresh the display interface as (3) in Figure 11 according to the click operation 1.
  • the subsequent processing process is similar to the above-mentioned introduction. This will not be repeated here.
  • the first terminal device or the second terminal device when it recognizes that the data transmission status is degraded or even abnormal at the business level, it can switch to the Wi-Fi P2P-based transmission mode, thereby improving data transmission efficiency.
  • mobile phone 1 can initiate a request to mobile phone 2 to establish a Wi-Fi P2P connection through Huawei sharing.
  • both mobile phone 1 and mobile phone 2 have turned on Bluetooth, then mobile phone 1 can also initiate a request to establish a Wi-Fi P2P connection via Bluetooth to mobile phone 2.
  • the first terminal device establishes an information transmission channel with the second terminal device.
  • the first terminal device and the second terminal device may establish a trustworthy information transmission channel by means of bluetooth or wireless local area network (wireless local area network, WLAN).
  • WLAN wireless local area network
  • P2P groups with low service priority are merged into P2P groups with high service priority.
  • the business priorities in P2P group 1 belong to the normal level, and the business priorities processed in P2P group 2 include emergency level, then connect the GO and at least one GC contained in P2P group 1 to P2P group 2 as GC in order to minimize the impact on the emergency-level services in P2P group 2.
  • the first terminal device determines whether the number of terminals included in P2P group 2 and P2P group 1 is equal. If they are equal, the first terminal device executes S1502b; otherwise, executes S1502a.
  • the first terminal device determines whether the GO performances of the P2P group 2 and the P2P group 1 are equal. If they are equal, the first terminal device executes S1506b; otherwise, executes S1506a.
  • the implementation process of the second terminal device may include the following S1006a to S1010a.
  • the connection between the second terminal device and the first terminal device is through the Wi-Fi P2P connection relayed by GO in P2P group 1.
  • the second terminal device and the first terminal device are both GCs of the same GO (smart screen) at this time, and can Realize the transfer of service data packets through GO at the MAC layer and realize P2P service processing at the application layer.
  • the tablet computer and the second terminal device perform P2P assembly and disassembly.
  • the tablet computer (GO) initiates a Wi-Fi P2P disconnection request (such as a P2P disconnect command) to the second terminal device (GC), and after receiving a confirmation message from the second terminal device, the tablet computer performs P2P disconnection deal with.
  • the tablet computer receives the Wi-Fi P2P unlinking request initiated by the second terminal device, suspends the ongoing P2P business in the P2P group 2 where it is currently located, and after saving the P2P group 2 business information, for the second terminal device Wi-Fi P2P connection performs P2P disconnection processing.
  • the tablet computer restores the original service processing according to the P2P group 2 service information.
  • the tablet computer receives the P2P service request re-initiated by the second terminal device, and receives or sends the transmission data of the original P2P service according to the P2P group 2 service information.
  • Each functional unit in each embodiment of the embodiment of the present application may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

Abstract

The present application relates to the field of communications, discloses a Wi-Fi direct communication method and apparatus, and provides a technical solution for establishing Wi-Fi P2P between terminal devices respectively belonging to different P2P groups. The method comprises: a second terminal device receiving a Wi-Fi P2P connection establishment request that is initiated by a first terminal device, or the second terminal device initiating the Wi-Fi P2P connection establishment request for the first terminal device, wherein the second terminal device belongs to a second peer-to-peer (P2P) group, and the first terminal device belongs to a first P2P group; the second terminal device performing a P2P group combination negotiation with the first terminal device, so as to obtain a negotiation result, wherein the negotiation result is used for instructing same to combine the second P2P group and the first P2P group into a third P2P group; and the second terminal device establishing, in the third P2P group, a Wi-Fi P2P connection with the first terminal device.

Description

一种Wi-Fi直连通信方法及装置A Wi-Fi direct connection communication method and device
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年09月10日提交中华人民共和国知识产权局、申请号为202111063130.6、申请名称为“一种Wi-Fi直连通信方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the Intellectual Property Office of the People's Republic of China on September 10, 2021, with the application number 202111063130.6 and the application title "A Wi-Fi Direct Communication Method and Device", the entire content of which Incorporated in this application by reference.
技术领域technical field
本申请实施例涉及通信技术领域,尤其涉及一种Wi-Fi直连通信方法及装置。The embodiments of the present application relate to the field of communication technologies, and in particular, to a Wi-Fi Direct communication method and device.
背景技术Background technique
无线保真(wireless-fidelity,Wi-Fi)直连(direct)(又可称为“Wi-Fi P2P”)技术属于Wi-Fi协议簇中的一个典型技术。Wi-Fi直连可以实现终端设备之间连接彼此,而无需一个中介性质的无线接入点(access point,AP)。A wireless-fidelity (Wi-Fi) direct (also called "Wi-Fi P2P") technology is a typical technology in the Wi-Fi protocol cluster. Wi-Fi Direct can connect terminal devices to each other without an intermediary wireless access point (access point, AP).
目前,在Wi-Fi直连技术标准协议中,存在由一个点对点(peer-to-peer,P2P)组拥有者(group owner,GO)和至少一个P2P组内客户端(group client,GC)构成的一个P2P组,GO在该P2P组中可以与每个GC实现数据互传。然而,现有的Wi-Fi直连技术中存在分别属于不同的P2P组中的终端设备之间,无法建立Wi-Fi P2P的问题。Currently, in the Wi-Fi Direct technical standard protocol, there is a peer-to-peer (P2P) group owner (group owner, GO) and at least one P2P group client (group client, GC). A P2P group, GO can realize data exchange with each GC in this P2P group. However, in the existing Wi-Fi direct technology, there is a problem that Wi-Fi P2P cannot be established between terminal devices belonging to different P2P groups.
发明内容Contents of the invention
本申请实施例提供一种Wi-Fi直连通信方法及装置,用以解决现有的Wi-Fi直连技术中存在分别属于不同的P2P组中的终端设备之间,无法建立Wi-Fi P2P的问题。The embodiment of the present application provides a Wi-Fi direct communication method and device to solve the problem that existing Wi-Fi direct technology cannot establish Wi-Fi P2P between terminal devices that belong to different P2P groups. The problem.
第一方面,本申请实施例提供了一种Wi-Fi直连通信方法,所述方法包括:第二终端设备接收第一终端设备发起的建立Wi-Fi P2P连接请求,或者所述第二终端设备向所述第一终端设备发起建立Wi-Fi P2P连接请求,所述第二终端设备归属于第二点对点P2P组,所述第一终端设备归属于第一P2P组;所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,得到协商结果,所述协商结果用于指示将所述第二P2P组和所述第一P2P组合并为第三P2P组;所述第二终端设备在所述第三P2P组中建立与所述第一终端设备的Wi-Fi P2P连接。In the first aspect, an embodiment of the present application provides a Wi-Fi direct communication method, the method comprising: the second terminal device receives a request for establishing a Wi-Fi P2P connection initiated by the first terminal device, or the second terminal device The device initiates a Wi-Fi P2P connection establishment request to the first terminal device, the second terminal device belongs to the second point-to-point P2P group, the first terminal device belongs to the first P2P group; the second terminal device Negotiating with the first terminal device on P2P group merging, and obtaining a negotiation result, the negotiation result is used to indicate that the second P2P group and the first P2P group are merged into a third P2P group; The second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group.
通过该方法,当存在归属于不同P2P组的第一终端设备与第二终端设备之间需要建立Wi-Fi P2P连接的场景时,采用对多个不同的P2P组进行群组合并的实现方式,具体可以实施为通过第一终端设备与第二终端设备群组合并的协商处理,对其中一个P2P组进行拆链处理之后,作为另一P2P组的GC连接到该另一P2P组的GO上,从而得到包含原多个不同P2P组的终端设备的新P2P组,进而通过该新P2P组可以建立对原多个不同P2P组之间的终端设备之间的Wi-Fi直连通信。Through this method, when there is a scenario where a Wi-Fi P2P connection needs to be established between the first terminal device and the second terminal device belonging to different P2P groups, the implementation method of group merging of multiple different P2P groups is adopted, Specifically, it can be implemented as a negotiation process of group merging of the first terminal device and the second terminal device. After one of the P2P groups is disconnected, the GC of another P2P group is connected to the GO of the other P2P group. Thus, a new P2P group including terminal devices of multiple original different P2P groups is obtained, and then Wi-Fi direct communication between terminal devices among the original multiple different P2P groups can be established through the new P2P group.
在一种可能的设计中,所述第二终端设备与所述第一终端设备进行P2P群组合并的协商之前,所述方法还包括:所述第二终端设备向所述第一终端设备发送第二P2P状态信息,所述第二P2P状态信息用于指示所述第二P2P组;以及所述第二终端设备接收所述第一终 端设备发送的第一P2P状态信息,所述第一P2P状态信息用于指示所述第一P2P组。所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,包括:所述第二终端设备基于所述第二P2P状态信息和所述第一P2P状态信息,与所述第一终端设备进行P2P群组合并的协商。In a possible design, before the second terminal device negotiates with the first terminal device on P2P group merging, the method further includes: the second terminal device sends to the first terminal device Second P2P state information, the second P2P state information is used to indicate the second P2P group; and the second terminal device receives the first P2P state information sent by the first terminal device, the first P2P The status information is used to indicate the first P2P group. The negotiation of P2P group merging between the second terminal device and the first terminal device includes: the second terminal device, based on the second P2P status information and the first P2P status information, negotiates with the first P2P status information A terminal device performs negotiation on P2P group merging.
该设计中,第二终端设备与第一终端设备共享指示P2P组的P2P状态信息,可以实现第二终端设备与第一终端设备基于第二P2P状态信息和第一P2P状态信息实现群组合并的协商。因此,在合并之后的P2P群组中,可以实现第一终端设备与第二终端设备之间的P2P通信。In this design, the second terminal device and the first terminal device share the P2P state information indicating the P2P group, which can realize the combination of the second terminal device and the first terminal device based on the second P2P state information and the first P2P state information. negotiate. Therefore, in the merged P2P group, P2P communication between the first terminal device and the second terminal device can be realized.
在一种可能的设计中,所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,包括:所述第二终端设备确定第二P2P组中的第二组拥有者GO角色和第一P2P组中的第一GO角色;所述第二终端设备基于预设的合并规则,确定所述第二GO或所述第一GO为所述第三P2P组中的第三GO;所述第二终端设备根据所述第三GO输出协商结果;其中,若确定所述第二GO为所述第三GO,则所述协商结果为将所述第一P2P组合并到所述第二P2P组中;若确定所述第一GO为所述第三GO,则所述协商结果为将所述第二P2P组合并到所述第一P2P组中。In a possible design, the negotiation between the second terminal device and the first terminal device on P2P group merging includes: determining, by the second terminal device, the second group owner GO in the second P2P group role and the role of the first GO in the first P2P group; the second terminal device determines that the second GO or the first GO is the third GO in the third P2P group based on a preset merging rule ; The second terminal device outputs a negotiation result according to the third GO; wherein, if it is determined that the second GO is the third GO, the negotiation result is to merge the first P2P group into the In the second P2P group; if it is determined that the first GO is the third GO, the negotiation result is to merge the second P2P group into the first P2P group.
该设计中,通过第二终端设备与第一终端设备基于第一P2P组的第一GO角色和第二P2P组的第二GO角色,首先确定合并之后的第三P2P组的GO角色,从而可以实现对第一终端设备和第二终端设备分别归属的P2P组进行合并,得到合并的P2P组。In this design, the second terminal device and the first terminal device first determine the merged GO role of the third P2P group based on the first GO role of the first P2P group and the second GO role of the second P2P group, so that Merging the P2P groups to which the first terminal device and the second terminal device respectively belong is implemented to obtain a merged P2P group.
在一种可能的设计中,若所述协商结果为所述将所述第二P2P组合并到所述第一P2P组中,所述方法还包括:所述第二终端设备基于所述第二P2P组的业务状态,保存第二P2P组业务信息;所述第二终端设备与所述第二GO进行P2P组拆链,所述P2P组拆链用于断开所述第二终端设备与所述第二GO的Wi-Fi P2P连接;所述第二终端设备向所述第三GO发起建立Wi-Fi P2P连接请求;所述第二终端设备接收来自所述第三GO的确认消息,所述确认消息用于指示所述第三GO同意所述第二终端设备加入所述第三P2P组中。In a possible design, if the negotiation result is the merging of the second P2P group into the first P2P group, the method further includes: the second terminal device The service state of the P2P group, saving the service information of the second P2P group; the second terminal device and the second GO perform P2P group unlinking, and the P2P group unlinking is used to disconnect the second terminal device from the second GO The Wi-Fi P2P connection of the second GO; the second terminal device initiates a Wi-Fi P2P connection request to the third GO; the second terminal device receives a confirmation message from the third GO, and the The confirmation message is used to indicate that the third GO agrees that the second terminal device joins the third P2P group.
该设计中,在确定群组合并的协商结果之后,根据协商结果确定对其中一个P2P组进行拆链,并将拆链得到的多个终端设备连接到另一个P2P组的GO上,从而可以得到第三P2P组。In this design, after determining the negotiation result of group merging, it is determined to unlink one of the P2P groups according to the negotiation result, and connect multiple terminal devices obtained by the unlinking to the GO of another P2P group, so as to obtain The third P2P group.
在一种可能的设计中,所述方法还包括:所述第二终端设备在所述第三P2P组中根据所述第二P2P组业务信息,恢复所述第二终端设备在所述第二P2P组的业务状态。In a possible design, the method further includes: recovering, by the second terminal device in the third P2P group, according to the service information of the second P2P group, Service status of the P2P group.
该设计中,在解决现有技术中归属于不同P2P群组的第一终端设备与第二终端设备无法实现P2P通信的问题的基础上,还可以保障原有业务的处理,保障终端设备处理的可靠性。In this design, on the basis of solving the problem that the first terminal device and the second terminal device belonging to different P2P groups cannot realize P2P communication in the prior art, it can also guarantee the processing of the original business and the processing efficiency of the terminal device. reliability.
在一种可能的设计中,所述方法还包括:所述第二终端设备将所述协商结果发送给所述第二P2P组中的至少一个其他终端设备,以使各所述其他终端设备从所述第二P2P组中拆链之后,分别与所述第三GO建立Wi-Fi P2P连接。In a possible design, the method further includes: the second terminal device sending the negotiation result to at least one other terminal device in the second P2P group, so that each of the other terminal devices After disconnecting the link in the second P2P group, establish a Wi-Fi P2P connection with the third GO respectively.
通过该设计,通过将第二终端设备所在的第二P2P组合并至第一终端设备所在的第一P2P组,可以实现第二P2P组包含的多个终端设备与第一P2P组包含的多个终端设备合并至相同的第三P2P组中,从而可以解决现有技术中归属于不同P2P群组的第一终端设备与第二终端设备无法实现P2P通信的问题。Through this design, by merging the second P2P group where the second terminal device belongs to the first P2P group where the first terminal device is, it can be realized that the multiple terminal devices contained in the second P2P group and the multiple terminal devices contained in the first P2P group The terminal devices are merged into the same third P2P group, so that the problem in the prior art that the first terminal device and the second terminal device belonging to different P2P groups cannot realize P2P communication can be solved.
在一种可能的设计中,所述预设的合并规则包括以下规则中的一种或多种:包含终端 设备数量少的P2P组合并到包含终端设备数量多的P2P组中;业务优先级低的P2P组合并到业务优先级高的P2P组中;信道带宽小的P2P组合并到信道带宽大的P2P组中;业务量少的P2P组合并到业务量大的P2P组中;GO性能弱的P2P组合并到GO性能强的P2P组中;Wi-Fi P2P连接请求发起方的P2P组合并到被发起方的P2P组中。In a possible design, the preset merging rules include one or more of the following rules: the P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices; the service priority is low P2P groups with high service priority are merged into P2P groups with high service priority; P2P groups with small channel bandwidth are merged into P2P groups with large channel bandwidth; P2P groups with low traffic volume are merged into P2P groups with large traffic volume; The P2P group is merged into the P2P group with strong GO performance; the P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
该设计中,通过预设的合并规则,在可以实现归属于不同P2P群组的第一终端设备与第二终端设备可以实现P2P通信的基础上,还可以减低对合并之前的第一P2P组和第二P2P组的原有业务影响。In this design, through the preset merging rules, on the basis that the first terminal device and the second terminal device belonging to different P2P groups can realize P2P communication, it can also reduce the impact on the first P2P group and the second terminal device before merging. The original service impact of the second P2P group.
在一种可能的设计中,所述第二终端设备在所述第三P2P组中建立与所述第一终端设备的Wi-Fi P2P连接,包括:若所述第二终端设备和所述第一终端设备为所述第三P2P组中的组内客户端GC角色,所述第二终端设备和所述第一终端设备通过所述第三P2P组中的GO角色建立Wi-Fi P2P连接。In a possible design, the second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group, including: if the second terminal device and the first terminal device A terminal device is a client GC role in the third P2P group, and the second terminal device and the first terminal device establish a Wi-Fi P2P connection through the GO role in the third P2P group.
该设计中,通过合并得到的第三P2P组中包含的GO角色,可以实现该P2P组中属于GC角色的第一终端设备和第二终端设备之间的Wi-Fi P2P通信。In this design, by merging the GO roles included in the third P2P group, the Wi-Fi P2P communication between the first terminal device and the second terminal device belonging to the GC role in the P2P group can be realized.
第二方面,本申请实施例提供一种Wi-Fi直连通信系统,包括第一P2P组和第二P2P组,所述第一P2P组包括第一GO和第一终端设备,所述第二P2P组包括第二GO和第二终端设备,所述第一终端设备为所述第一P2P组的第一组内客户端GC,所述第二终端设备为所述第二P2P组的第二GC;其中,所述第一终端设备向所述第二终端设备发起建立Wi-Fi P2P连接请求,或者所述第二终端设备向所述第一终端设备发起建立Wi-Fi P2P连接请求;所述第一终端设备与所述第二终端设备进行P2P群组合并的协商,得到协商结果,所述协商结果用于指示将所述第二P2P组和所述第一P2P组合并为第三P2P组;基于所述协商结果,所述第一P2P组和所述第二P2P组成所述第三P2P组;所述第一终端设备和所述第二终端设备在所述第三P2P组中建立Wi-Fi P2P连接。In the second aspect, the embodiment of the present application provides a Wi-Fi direct communication system, including a first P2P group and a second P2P group, the first P2P group includes a first GO and a first terminal device, and the second The P2P group includes a second GO and a second terminal device, the first terminal device is the client GC in the first group of the first P2P group, and the second terminal device is the second terminal device of the second P2P group GC; wherein, the first terminal device initiates a Wi-Fi P2P connection establishment request to the second terminal device, or the second terminal device initiates a Wi-Fi P2P connection establishment request to the first terminal device; The first terminal device and the second terminal device perform a negotiation on P2P group merging, and obtain a negotiation result, and the negotiation result is used to indicate that the second P2P group and the first P2P group are merged into a third P2P group group; based on the negotiation result, the first P2P group and the second P2P form the third P2P group; the first terminal device and the second terminal device are established in the third P2P group Wi-Fi P2P connection.
在一种可能的设计中,所述第一终端设备与所述第二终端设备进行P2P群组合并的协商之前,所述第一终端设备向所述第二终端设备发送第一P2P状态信息,或者所述第二终端设备向所述第一终端设备发送第二P2P状态信息;所述第一P2P状态信息用于指示所述第一P2P组,所述第二P2P状态信息用于指示所述第二P2P组;所述第一终端设备与所述第二终端设备进行P2P群组合并的协商,包括:基于所述第二P2P状态信息和所述第一P2P状态信息,确定协商结果。In a possible design, before the first terminal device negotiates with the second terminal device on P2P group merging, the first terminal device sends first P2P status information to the second terminal device, Or the second terminal device sends second P2P status information to the first terminal device; the first P2P status information is used to indicate the first P2P group, and the second P2P status information is used to indicate the The second P2P group: the negotiation between the first terminal device and the second terminal device on P2P group merging includes: determining a negotiation result based on the second P2P state information and the first P2P state information.
在一种可能的设计中,所述第一终端设备与所述第二终端设备进行P2P群组合并的协商,包括:基于预设的合并规则,确定所述第二GO或所述第一GO为所述第三P2P组中的第三GO;根据所述第三GO输出协商结果;其中,若确定所述第二GO为所述第三GO,则所述协商结果为将所述第一P2P组合并到所述第二P2P组中;若确定所述第一GO为所述第三GO,则所述协商结果为将所述第二P2P组合并到所述第一P2P组中。In a possible design, the negotiation between the first terminal device and the second terminal device on P2P group merging includes: determining whether the second GO or the first GO is based on a preset merging rule be the third GO in the third P2P group; output a negotiation result according to the third GO; wherein, if it is determined that the second GO is the third GO, the negotiation result is that the first The P2P group is merged into the second P2P group; if it is determined that the first GO is the third GO, the negotiation result is to merge the second P2P group into the first P2P group.
在一种可能的设计中,若所述协商结果为所述将所述第二P2P组合并到所述第一P2P组中,所述第二终端设备基于所述第二P2P组的业务状态,保存第二P2P组业务信息;所述第二终端设备与所述第二GO进行P2P组拆链,所述P2P组拆链用于断开所述第二终端设备与所述第二GO的Wi-Fi P2P连接;所述第二终端设备向所述第三GO发起建立Wi-Fi P2P连接请求;及所述第二GO向所述第三GO发起建立Wi-Fi P2P连接请求;所述第二终端设备接收来自所述第三GO的确认消息,所述确认消息用于指示所述第三GO同意所述第二终端设备加入所述第三P2P组中;及所述第二GO接收来自所述第三GO的确认消息, 所述确认消息用于指示所述第三GO同意所述第二GO加入所述第三P2P组中;所述第二GO在所述第三P2P组中为GC角色。In a possible design, if the negotiation result is the merging of the second P2P group into the first P2P group, the second terminal device, based on the service state of the second P2P group, Save the second P2P group service information; the second terminal device and the second GO perform P2P group disassembly, and the P2P group disassembly is used to disconnect the Wi-Fi connection between the second terminal device and the second GO -Fi P2P connection; the second terminal device initiates a Wi-Fi P2P connection establishment request to the third GO; and the second GO initiates a Wi-Fi P2P connection establishment request to the third GO; the second GO initiates a Wi-Fi P2P connection establishment request; The second terminal device receives a confirmation message from the third GO, the confirmation message is used to indicate that the third GO agrees that the second terminal device joins the third P2P group; and the second GO receives the confirmation message from A confirmation message of the third GO, where the confirmation message is used to indicate that the third GO agrees with the second GO to join the third P2P group; the second GO in the third P2P group is GC role.
在一种可能的设计中,所述第二终端设备在所述第三P2P组中根据所述第二P2P组业务信息,恢复所述第二终端设备与所述第二GO在所述第二P2P组的业务状态。In a possible design, the second terminal device restores the connection between the second terminal device and the second GO in the second P2P group according to the service information of the second P2P group. Service status of the P2P group.
在一种可能的设计中,所述第二终端设备将所述协商结果发送给所述第二P2P组中的至少一个其他终端设备;以及,所述第一终端设备将所述协商结果发送给所述第一P2P组中的至少一个其他终端设备。In a possible design, the second terminal device sends the negotiation result to at least one other terminal device in the second P2P group; and the first terminal device sends the negotiation result to At least one other terminal device in the first P2P group.
在一种可能的设计中,所述预设的合并规则包括以下规则中的一种或多种:包含终端设备数量少的P2P组合并到包含终端设备数量多的P2P组中;业务优先级低的P2P组合并到业务优先级高的P2P组中;信道带宽小的P2P组合并到信道带宽大的P2P组中;业务量少的P2P组合并到业务量大的P2P组中;GO性能弱的P2P组合并到GO性能强的P2P组中;Wi-Fi P2P连接请求发起方的P2P组合并到被发起方的P2P组中。In a possible design, the preset merging rules include one or more of the following rules: the P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices; the service priority is low P2P groups with high service priority are merged into P2P groups with high service priority; P2P groups with small channel bandwidth are merged into P2P groups with large channel bandwidth; P2P groups with low traffic volume are merged into P2P groups with large traffic volume; The P2P group is merged into the P2P group with strong GO performance; the P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
在一种可能的设计中,所述第一终端设备和所述第二终端设备在所述第三P2P组中建立Wi-Fi P2P连接,包括:所述第一终端设备和所述第二终端设备通过所述第三P2P组中的GO角色建立Wi-Fi P2P连接。In a possible design, the first terminal device and the second terminal device establish a Wi-Fi P2P connection in the third P2P group, including: the first terminal device and the second terminal The device establishes a Wi-Fi P2P connection through the GO role in the third P2P group.
第三方面,本申请实施例还提供了一种终端设备,包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器,用于存储一个或多个计算机程序以及数据信息;其中所述一个或多个计算机程序包括指令;当所述指令被所述一个或多个处理器执行时,使得所述终端设备执行如上述第一方面中任一项所述的方法。In the third aspect, the embodiment of the present application also provides a terminal device, including: one or more processors; one or more memories; the one or more memories are used to store one or more computer programs and data Information; wherein the one or more computer programs include instructions; when the instructions are executed by the one or more processors, the terminal device is made to execute the method as described in any one of the above first aspects.
第四方面,本申请实施例提供了一种计算机可读存储介质,计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机上运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。In a fourth aspect, the embodiment of the present application provides a computer-readable storage medium. The computer-readable medium stores a computer program (also referred to as code, or instruction) which, when run on a computer, causes the computer to perform the above-mentioned first A method in any one of the possible implementations of the aspect.
第五方面,本申请实施例提供了一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。In the fifth aspect, the embodiment of the present application provides a computer program product, the computer program product includes: a computer program (also referred to as code, or instruction), when the computer program is executed, it causes the computer to perform any of the above-mentioned first aspects. A method in one possible implementation.
第六方面,本申请实施例还提供一种终端设备上的图形用户界面,该终端设备具有显示屏、一个或多个存储器、以及一个或多个处理器,所述一个或多个处理器用于执行存储在所述一个或多个存储器中的一个或多个计算机程序,所述图形用户界面包括所述终端设备执行本申请实施例第一方面任一可能的实现方式时显示的图形用户界面,或执行本申请实施例第二方面任一可能的实现方式时显示的图形用户界面。In the sixth aspect, the embodiment of the present application also provides a graphical user interface on a terminal device, the terminal device has a display screen, one or more memories, and one or more processors, and the one or more processors are used to Executing one or more computer programs stored in the one or more memories, the graphical user interface includes a graphical user interface displayed when the terminal device executes any possible implementation manner of the first aspect of the embodiments of the present application, Or a graphical user interface displayed when any possible implementation manner of the second aspect of the embodiment of the present application is executed.
上述第二方面至第六方面中任一方面的有益效果请具体参阅上述第一方面中各种可能的设计的有益效果,在此不再赘述。For the beneficial effects of any one of the above-mentioned second aspect to the sixth aspect, please refer to the beneficial effects of various possible designs in the above-mentioned first aspect, which will not be repeated here.
附图说明Description of drawings
图1为一种P2P组的示意图;FIG. 1 is a schematic diagram of a P2P group;
图2为一种P2P组的应用场景图;FIG. 2 is an application scenario diagram of a P2P group;
图3为另一种P2P组的应用场景图;FIG. 3 is an application scenario diagram of another P2P group;
图4为本申请实施例提供的一种Wi-Fi直连通信方法的一种应用场景;FIG. 4 is an application scenario of a Wi-Fi direct communication method provided by an embodiment of the present application;
图5为本申请实施例提供的一种可能的终端设备的硬件结构示意图;FIG. 5 is a schematic diagram of a hardware structure of a possible terminal device provided by an embodiment of the present application;
图6为本申请实施例提供的一种终端设备的软件结构框图;FIG. 6 is a software structural block diagram of a terminal device provided in an embodiment of the present application;
图7为本申请实施例提供的一种Wi-Fi直连通信方法的另一种应用场景;FIG. 7 is another application scenario of a Wi-Fi direct communication method provided by the embodiment of the present application;
图8为本申请实施例提供的一种Wi-Fi直连通信方法的一种应用场景对比图;FIG. 8 is a comparison diagram of an application scenario of a Wi-Fi direct communication method provided in an embodiment of the present application;
图9为本申请实施例提供的一种Wi-Fi直连通信方法的另一种应用场景对比图;FIG. 9 is a comparison diagram of another application scenario of a Wi-Fi direct communication method provided in the embodiment of the present application;
图10为本申请实施例提供的一种Wi-Fi直连通信方法的流程示意图;FIG. 10 is a schematic flowchart of a Wi-Fi direct communication method provided by an embodiment of the present application;
图11为本申请实施例提供的一种Wi-Fi直连通信方法的又一种应用场景;FIG. 11 is another application scenario of a Wi-Fi direct communication method provided in the embodiment of the present application;
图12为本申请实施例提供的一种Wi-Fi直连通信方法的还一种应用场景;Fig. 12 is another application scenario of a Wi-Fi direct communication method provided by the embodiment of the present application;
图13为本申请实施例提供的一种Wi-Fi直连通信方法的合并示意图;FIG. 13 is a combined schematic diagram of a Wi-Fi direct communication method provided by an embodiment of the present application;
图14为本申请实施例提供的一种Wi-Fi直连通信方法的另一合并示意图;FIG. 14 is another combined schematic diagram of a Wi-Fi direct communication method provided by the embodiment of the present application;
图15为本申请实施例提供的一种协商处理的流程示意图;FIG. 15 is a schematic flowchart of a negotiation process provided by an embodiment of the present application;
图16为本申请实施例中提供的一种终端设备的结构示意图。FIG. 16 is a schematic structural diagram of a terminal device provided in an embodiment of the present application.
具体实施方式Detailed ways
随着社会的快速发展,终端设备例如手机越来越普及。终端设备不但具有通信功能、还具有强大的处理能力、存储能力、照相功能等。终端设备通过操作系统执行相应的应用程序,用户可以使用终端设备打电话、发短消息、浏览网页、看视频等。并且,为了方便用户与用户之间进行数据共享,或用户可以在不同的终端设备之间进行文件互传,终端设备与终端设备之间可以通过Wi-Fi直连技术建立P2P组,然后在P2P组中进行业务数据包互传,例如文档互传、照片互传或视频互传等。Wi-Fi直连技术凭借具有传输速度快、效率高以及易用性等特点,目前被广泛应用于各种终端设备之间进行数据共享的场景中。参阅图1,为一种P2P组的示意图。在一个P2P组中,通常可由一个P2P组拥有者(group owner,GO)角色和至少一个P2P组内客户端(group client,GC)角色构成,如图1中的GO、GC 1、……、GC n。每个GC可以分别与GO实现业务数据包互传。With the rapid development of society, terminal devices such as mobile phones are becoming more and more popular. Terminal equipment not only has communication functions, but also has powerful processing capabilities, storage capabilities, and camera functions. The terminal device executes the corresponding application program through the operating system, and the user can use the terminal device to make calls, send short messages, browse the web, watch videos, etc. Moreover, in order to facilitate data sharing between users, or users can transfer files between different terminal devices, a P2P group can be established between terminal devices through Wi-Fi direct connection technology, and then P2P In the group, business data packets are exchanged, such as documents, photos, or videos. Due to its fast transmission speed, high efficiency, and ease of use, Wi-Fi direct technology is currently widely used in data sharing scenarios between various terminal devices. Referring to FIG. 1 , it is a schematic diagram of a P2P group. A P2P group usually consists of a P2P group owner (group owner, GO) role and at least one P2P group client (group client, GC) role, as shown in Figure 1 GO, GC 1, ..., GC n. Each GC can communicate with the GO to implement business data packets.
其中,Wi-Fi直连技术是一种点对点的连接技术,表示可以在两个终端设备之间直接建立传输控制协议/网际协议(transmission control protocol/internet protocol,TCP/IP)连接,无需传统意义上的AP参与。通过Wi-Fi直连(也可以称为Wi-Fi P2P,以下实施例中可能替换使用)技术建立的P2P组中,存在一个终端设备可以起到传统意义上的AP作用,即GO;而P2P组中的其他终端设备即为GC,GC可以像传统意义上的站点(station,STA)连接到AP一样连接到GO上。需要说明的是,在每个P2P组中,可以存在一个GO和一个或多个GC,也可以理解为GO和GC可为一对一或一对多关系。Among them, Wi-Fi Direct technology is a point-to-point connection technology, which means that a transmission control protocol/internet protocol (TCP/IP) connection can be directly established between two terminal devices without the traditional meaning Participate in AP. In the P2P group established by Wi-Fi direct connection (also called Wi-Fi P2P, which may be used instead in the following embodiments) technology, there is a terminal device that can play the role of AP in the traditional sense, that is, GO; and P2P The other terminal devices in the group are GCs, and the GCs can be connected to the GO in the same way that a traditional station (station, STA) is connected to an AP. It should be noted that in each P2P group, there may be one GO and one or more GCs, and it can also be understood that GOs and GCs may have a one-to-one or one-to-many relationship.
示例性的,在P2P组中进行的P2P业务可以包括:投屏、多屏协同、分布式图片、无线打印等。Exemplarily, the P2P services performed in the P2P group may include: screen projection, multi-screen collaboration, distributed pictures, wireless printing, and the like.
目前Wi-Fi直连技术标准中,当终端设备通过Wi-Fi直连技术在进行P2P业务处理时,若此时发起新的P2P业务,需要与其他终端设备连接时,会出现通道占用的问题。示例性的,如图2所示,在P2P组1中,GO和GC1在进行P2P业务处理,如果用户具有通过GC 1向其他终端设备发起建立新的P2P业务的需求,由于GC 1已经存在于P2P组1中,因此GC 1与P2P组1外面的其他终端设备的Wi-Fi P2P就无法实现。In the current Wi-Fi Direct technology standard, when a terminal device is processing P2P services through Wi-Fi Direct technology, if a new P2P service is initiated at this time and needs to be connected with other terminal devices, there will be a problem of channel occupation. . Exemplarily, as shown in Figure 2, in P2P group 1, GO and GC1 are performing P2P service processing, if the user has a demand to initiate a new P2P service to other terminal equipment through GC 1, since GC 1 already exists in In P2P group 1, Wi-Fi P2P between GC 1 and other terminal devices outside of P2P group 1 cannot be realized.
并且,即使在相同的P2P组中,GC与GC之间也无法建立Wi-Fi P2P。现有技术中,存在可以通过P2P组中GO的中转处理,来实现该P2P组中GC与GC之间的P2P业务处理。如图3所示,在P2P组1中,假设GC 1需要向GC 2发起建立Wi-Fi P2P的协商,如果GC 1确定与GC 2同属于P2P组1中,则GC 1可以采用复用GC 1到GO的传输通道, 然后通过GO中转的方式,来实现与GC 2实现业务数据包互传。实施时,GC 1与GC 2之间待传输的业务数据包在MAC层通过GO中转来实现传输,达到在应用层可以完成GC与GC之间的Wi-Fi P2P的目的。Moreover, even in the same P2P group, Wi-Fi P2P cannot be established between GCs. In the prior art, it is possible to implement the P2P service processing between GCs in the P2P group through the transfer processing of the GO in the P2P group. As shown in Figure 3, in P2P group 1, assuming that GC 1 needs to initiate a Wi-Fi P2P negotiation with GC 2, if GC 1 determines that GC 2 belongs to P2P group 1, then GC 1 can use multiplexing GC 1 to the transmission channel of GO, and then realize the mutual transmission of business data packets with GC 2 through GO transit. During implementation, the service data packets to be transmitted between GC 1 and GC 2 are transferred through GO at the MAC layer to achieve the purpose of completing Wi-Fi P2P between GC and GC at the application layer.
然而,结合背景技术中的描述,由于进行P2P业务处理的终端设备,已经占用通道进行P2P业务处理,因此不属于相同的P2P组的两个终端设备则无法建立Wi-Fi P2P。示例性的,如图4所示,假设存在P2P组1和P2P组2,P2P组1中的GO或者GC无法与P2P组2中的GO或GC进行Wi-Fi P2P,P2P组2中的GO或者GC也无法与P2P组1中的GO或GC进行Wi-Fi P2P。However, in combination with the description in the background technology, since the terminal equipment performing P2P service processing has already occupied the channel for P2P service processing, two terminal equipments that do not belong to the same P2P group cannot establish Wi-Fi P2P. Exemplarily, as shown in Figure 4, assuming that there are P2P group 1 and P2P group 2, the GO or GC in P2P group 1 cannot perform Wi-Fi P2P with the GO or GC in P2P group 2, and the GO in P2P group 2 Or GC cannot perform Wi-Fi P2P with GO or GC in P2P group 1.
在目前的Wi-Fi技术标准协议中,能够被Wi-Fi信号所采用的Wi-Fi信道主要集中在2.4G频段和5G频段。不同的P2P组,使用的Wi-Fi信道可能不同,或物理传输通道的工作频点不同,或者即使采用的Wi-Fi信道和物理传输通道的工作频点相同,由于组与组之间没有建立GO与GC的连接关系,因此无法建立Wi-Fi P2P。In the current Wi-Fi technical standard protocol, the Wi-Fi channels that can be used by Wi-Fi signals are mainly concentrated in the 2.4G frequency band and the 5G frequency band. Different P2P groups may use different Wi-Fi channels, or the operating frequencies of the physical transmission channels may be different, or even if the Wi-Fi channels used and the physical transmission channels have the same operating frequency, since there is no established The connection between GO and GC, so Wi-Fi P2P cannot be established.
有鉴于此,本申请实施例提供一种Wi-Fi直连通信方法,针对不属于相同的P2P组的两个终端设备无法建立Wi-Fi P2P的问题,采用将两个不同的P2P组合并为一个新的P2P组的设计思想,在新的P2P组中包含一个GO和多个GC,进而实现GO与每个GC之间的Wi-Fi P2P连接、以及GC与GC之间在MAC层通过GO中转且在应用层上的Wi-Fi P2P连接。In view of this, the embodiment of the present application provides a Wi-Fi direct connection communication method. For the problem that two terminal devices that do not belong to the same P2P group cannot establish Wi-Fi P2P, two different P2P groups are combined into one The design idea of a new P2P group includes one GO and multiple GCs in the new P2P group, and then realizes the Wi-Fi P2P connection between GO and each GC, and the MAC layer between GC and GC through GO Relay and Wi-Fi P2P connections on the application layer.
下面将结合附图,对本申请实施例进行详细描述。Embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
可以理解的是,本申请实施例的终端设备可以是诸如手机、平板电脑、可穿戴设备(例如,手表、手环、头盔、耳机等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、智能家居设备(例如,智能电视,智慧屏,智能音箱,智能摄像头等)、打印机等。可以理解的是,本申请实施例对终端设备的具体类型不作任何限制。It can be understood that the terminal device in the embodiment of the present application may be a mobile phone, a tablet computer, a wearable device (for example, a watch, a bracelet, a helmet, a headset, etc.), a vehicle device, an augmented reality (augmented reality, AR)/virtual Reality (virtual reality, VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices (e.g., smart TVs, smart screens) , smart speakers, smart cameras, etc.), printers, etc. It can be understood that, the embodiment of the present application does not impose any limitation on the specific type of the terminal device.
本申请实施例可以应用到的终端设备,示例性实施例包括但不限于搭载
Figure PCTCN2022111118-appb-000001
Figure PCTCN2022111118-appb-000002
或者其它操作系统的便携式终端设备。上述便携式终端设备也可以是其它便携式终端设备,诸如具有触敏表面(例如触控面板)的膝上型计算机(Laptop)等。
The terminal equipment that the embodiment of the present application can be applied to, the exemplary embodiment includes but not limited to carry
Figure PCTCN2022111118-appb-000001
Figure PCTCN2022111118-appb-000002
Or portable terminal equipment with other operating systems. The above-mentioned portable terminal device may also be other portable terminal devices, such as a laptop computer (Laptop) with a touch-sensitive surface (for example, a touch panel).
图5示出了一种可能的终端设备的硬件结构示意图。其中,所述终端设备200包括:射频(radio frequency,RF)电路210、电源220、处理器230、存储器240、输入单元250、显示单元260、音频电路270、通信接口280、以及无线保真(wireless-fidelity,Wi-Fi)模块290等部件。本领域技术人员可以理解,图5中示出的终端设备200的硬件结构并不构成对终端设备200的限定,本申请实施例提供的终端设备200可以包括比图示更多或更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图5中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。Fig. 5 shows a schematic diagram of a hardware structure of a possible terminal device. Wherein, the terminal device 200 includes: a radio frequency (radio frequency, RF) circuit 210, a power supply 220, a processor 230, a memory 240, an input unit 250, a display unit 260, an audio circuit 270, a communication interface 280, and a wireless fidelity ( wireless-fidelity, Wi-Fi) module 290 and other components. Those skilled in the art can understand that the hardware structure of the terminal device 200 shown in FIG. 5 does not constitute a limitation on the terminal device 200, and the terminal device 200 provided in the embodiment of the present application may include more or less components than those shown in the illustration , two or more components may be combined, or may have different component configurations. The various components shown in Figure 5 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
下面结合图5对所述终端设备200的各个构成部件进行具体的介绍:The components of the terminal device 200 are specifically introduced below in conjunction with FIG. 5 :
所述RF电路210可用于通信或通话过程中,数据的接收和发送。特别地,所述RF电路210在接收到基站的下行数据后,发送给所述处理器230处理;另外,将待发送的上行数据发送给基站。通常,所述RF电路210包括但不限于天线、至少一个放大器、收发 信机、耦合器、低噪声放大器(low noise amplifier,LNA)、双工器等。The RF circuit 210 can be used for receiving and sending data during communication or calling. Specifically, after receiving the downlink data from the base station, the RF circuit 210 sends it to the processor 230 for processing; in addition, sends the uplink data to be sent to the base station. Generally, the RF circuit 210 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (low noise amplifier, LNA), a duplexer, and the like.
此外,RF电路210还可以通过无线通信与网络和其他设备进行通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(global system of mobile communication,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、长期演进(long term evolution,LTE)、电子邮件、短消息服务(short messaging service,SMS)等。In addition, the RF circuit 210 can also communicate with networks and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to global system of mobile communication (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), e-mail, short message service (short messaging service, SMS), etc.
Wi-Fi技术属于短距离无线传输技术,所述终端设备200通过Wi-Fi模块290可以连接访问接入点(access point,AP),从而实现数据网络的访问。所述Wi-Fi模块290可用于通信过程中,数据的接收和发送。在本申请实施例中,所述终端设备200还可以通过Wi-Fi模块290与建立Wi-Fi P2P连接的其他终端设备进行业务数据包互传。The Wi-Fi technology belongs to the short-distance wireless transmission technology, and the terminal device 200 can connect to an access point (access point, AP) through the Wi-Fi module 290, so as to realize data network access. The Wi-Fi module 290 can be used for receiving and sending data during communication. In the embodiment of the present application, the terminal device 200 can also perform service data packet mutual transmission with other terminal devices establishing a Wi-Fi P2P connection through the Wi-Fi module 290.
所述终端设备200可以通过所述通信接口280与其他设备实现物理连接。可选的,所述通信接口280与所述其他设备的通信接口通过电缆连接,实现所述终端设备200和其他设备之间的数据传输。The terminal device 200 can be physically connected to other devices through the communication interface 280 . Optionally, the communication interface 280 is connected to the communication interface of the other device through a cable, so as to implement data transmission between the terminal device 200 and other devices.
由于在本申请实施例中,所述终端设备200能够实现通信业务,与其他终端设备实现交互,因此所述终端设备200需要具有数据传输功能,即所述终端设备200内部需要包含通信模块。虽然图5示出了所述RF电路210、所述Wi-Fi模块290、和所述通信接口280等通信模块,但是可以理解的是,所述终端设备200中存在上述部件中的至少一个或者其他用于实现通信的通信模块(如蓝牙模块),以进行数据传输。Since in the embodiment of the present application, the terminal device 200 can implement communication services and interact with other terminal devices, the terminal device 200 needs to have a data transmission function, that is, the terminal device 200 needs to include a communication module inside. Although FIG. 5 shows communication modules such as the RF circuit 210, the Wi-Fi module 290, and the communication interface 280, it can be understood that at least one of the above-mentioned components exists in the terminal device 200 or Other communication modules (such as bluetooth module) for realizing communication, in order to carry out data transmission.
例如,当所述终端设备200为手机时,所述终端设备200可以包含所述RF电路210,还可以包含所述Wi-Fi模块290,或可以包含蓝牙模块(图5中未示出);当所述终端设备200为计算机时,所述终端设备200可以包含所述通信接口280,还可以包含所述Wi-Fi模块290,或可以包含蓝牙模块(图5中未示出);当所述终端设备200为平板电脑时,所述终端设备200可以包含所述Wi-Fi模块,或可以包含蓝牙模块(图5中未示出)。For example, when the terminal device 200 is a mobile phone, the terminal device 200 may include the RF circuit 210, may also include the Wi-Fi module 290, or may include a Bluetooth module (not shown in FIG. 5 ); When the terminal device 200 is a computer, the terminal device 200 may include the communication interface 280, may also include the Wi-Fi module 290, or may include a Bluetooth module (not shown in FIG. 5 ); When the terminal device 200 is a tablet computer, the terminal device 200 may include the Wi-Fi module, or may include a Bluetooth module (not shown in FIG. 5 ).
所述存储器240可用于存储软件程序以及模块。所述处理器230通过运行存储在所述存储器240的软件程序以及模块,从而执行所述终端设备200的各种功能应用以及数据处理。可选的,所述存储器240可以主要包括存储程序区和存储数据区。其中,存储程序区可存储操作系统(主要包括内核层、系统层、应用程序框架层和应用程序层等各自对应的软件程序或模块)。应用程序层可以包含各种应用,其中可以进行推荐的应用中通过采用本申请实施例提供的方法,可以实现基于用户兴趣的内容推荐。The memory 240 can be used to store software programs and modules. The processor 230 executes various functional applications and data processing of the terminal device 200 by running software programs and modules stored in the memory 240 . Optionally, the memory 240 may mainly include an area for storing programs and an area for storing data. Wherein, the storage program area can store the operating system (mainly including the corresponding software programs or modules such as the kernel layer, the system layer, the application program framework layer, and the application program layer). The application program layer may include various applications, among which, the method provided by the embodiment of the present application can be used in the recommended application, and the content recommendation based on the user's interest can be realized.
此外,所述存储器240可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。In addition, the memory 240 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
所述输入单元250可用于接收用户输入的数字或字符信息等多种不同类型的数据对象的编辑操作,以及产生与所述终端设备200的用户设置以及功能控制有关的键信号输入。可选的,输入单元250可包括触控面板251以及其他输入设备252。The input unit 250 can be used to receive editing operations of various types of data objects such as numbers or character information input by the user, and generate key signal input related to user settings and function control of the terminal device 200 . Optionally, the input unit 250 may include a touch panel 251 and other input devices 252 .
其中,所述触控面板251,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在所述触控面板251上或在所述触控面板251附近的操作),并根据预先设定的程序驱动相应的连接装置。Wherein, the touch panel 251, also referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch panel 251 or on the operation near the touch panel 251), and drive the corresponding connection device according to the preset program.
可选的,所述其他输入设备252可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Optionally, the other input devices 252 may include but not limited to one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
所述显示单元260可用于显示由用户输入的信息或提供给用户的信息以及所述终端设备200的各种菜单。所述显示单元260即为所述终端设备200的显示系统,用于呈现界面,实现人机交互。所述显示单元260可以包括显示面板261。可选的,所述显示面板261可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)等形式来配置。本申请实施例中,例如可以通过显示单元260显示终端设备200通过Wi-Fi模块290接收到的其他终端设备通过Wi-Fi P2P传输来的业务数据包,比如当所述终端设备200为智慧屏时,可以接收来自手机通过Wi-Fi P2P连接传输的待投屏内容,从而可以将传输来的待投屏内容通过显示面板261进行显示。The display unit 260 can be used to display information input by the user or information provided to the user and various menus of the terminal device 200 . The display unit 260 is the display system of the terminal device 200, and is used to present an interface and realize human-computer interaction. The display unit 260 may include a display panel 261 . Optionally, the display panel 261 may be configured in the form of a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED), or the like. In the embodiment of the present application, for example, the display unit 260 can display the service data packets received by the terminal device 200 through the Wi-Fi module 290 and transmitted by other terminal devices through Wi-Fi P2P, for example, when the terminal device 200 is a smart screen At this time, the content to be projected can be received from the mobile phone through the Wi-Fi P2P connection, so that the transmitted content to be projected can be displayed on the display panel 261.
所述处理器230是所述终端设备200的控制中心,利用各种接口和线路连接各个部件,通过运行或执行存储在所述存储器240内的软件程序和/或模块,以及调用存储在所述存储器240内的数据,执行所述终端设备200的各种功能和处理数据,从而实现基于所述终端设备200的多种业务。本申请实施例中,处理器230用来实现本申请实施例提供的方法控制流程,进而提供一种可以解决现有技术中存在的不同P2P组中的终端设备无法实现Wi-Fi直连的技术方案。The processor 230 is the control center of the terminal device 200, and uses various interfaces and lines to connect various components, by running or executing software programs and/or modules stored in the memory 240, and calling the stored in the The data in the memory 240 executes various functions of the terminal device 200 and processes data, so as to realize various services based on the terminal device 200 . In the embodiment of the present application, the processor 230 is used to implement the method control process provided in the embodiment of the present application, and further provide a technology that can solve the problem in the prior art that terminal devices in different P2P groups cannot realize Wi-Fi direct connection plan.
所述终端设备200还包括用于给各个部件供电的电源220(比如电池)。可选的,所述电源220可以通过电源管理系统与所述处理器230逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。The terminal device 200 also includes a power source 220 (such as a battery) for supplying power to various components. Optionally, the power supply 220 may be logically connected to the processor 230 through a power management system, so that functions such as charging, discharging, and power consumption can be managed through the power management system.
如图5所示,终端设备200还包括音频电路270、麦克风271和扬声器272,可提供用户与终端设备200之间的音频接口。音频电路270可用于将音频数据转换为扬声器272能够识别的信号,并将信号传输到扬声器272,由扬声器272转换为声音信号输出。麦克风271用于收集外部的声音信号(如人说话的声音、或者其它声音等),并将收集的外部的声音信号转换为音频电路270能够识别的信号,发送给音频电路270。音频电路270还可用于将麦克风271发送的信号转换为音频数据,再将音频数据输出至RF电路220以发送给比如另一终端设备,或者将音频数据输出至存储器240以便后续进一步处理。As shown in FIG. 5 , the terminal device 200 further includes an audio circuit 270 , a microphone 271 and a speaker 272 , which can provide an audio interface between the user and the terminal device 200 . The audio circuit 270 can be used to convert the audio data into a signal that the speaker 272 can recognize, and transmit the signal to the speaker 272, and the speaker 272 converts the signal into a sound signal for output. The microphone 271 is used to collect external sound signals (such as the voice of people speaking, or other sounds, etc.), and convert the collected external sound signals into signals that the audio circuit 270 can recognize, and send them to the audio circuit 270 . The audio circuit 270 can also be used to convert the signal sent by the microphone 271 into audio data, and then output the audio data to the RF circuit 220 for sending to another terminal device, or output the audio data to the memory 240 for subsequent further processing.
尽管未示出,所述终端设备200还可以包括至少一种传感器、摄像头等,在此不再赘述。至少一种传感器可以包含但不限于压力传感器、气压传感器、加速度传感器、距离传感器、指纹传感器、触摸传感器、温度传感器等。Although not shown, the terminal device 200 may also include at least one sensor, camera, etc., which will not be repeated here. The at least one sensor may include, but is not limited to, a pressure sensor, an air pressure sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a touch sensor, a temperature sensor, and the like.
本申请实施例涉及的操作系统(operating system,OS),是运行在终端设备200上的最基本的系统软件。以智能手机为例,操作系统可以是鸿蒙系统(harmonyos)或安卓(android)系统或IOS系统。终端设备200的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以采用分层架构的操作系统为例,示例性说明终端设备200的软件结构。The operating system (operating system, OS) involved in the embodiment of the present application is the most basic system software running on the terminal device 200. Taking a smart phone as an example, the operating system can be a harmony OS, an Android system or an IOS system. The software system of the terminal device 200 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In this embodiment of the present application, an operating system adopting a layered architecture is taken as an example to illustrate the software structure of the terminal device 200 .
图6为本申请实施例提供的一种终端设备的软件结构框图。如图6所示,终端设备的软件结构可以是分层架构,例如可以将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将操作系统分为五层,从上至下分别为应用程序层,应用程序框架层(framework,FWK),运行时和系统库,内核层,以及硬件层。FIG. 6 is a block diagram of a software structure of a terminal device provided by an embodiment of the present application. As shown in FIG. 6, the software structure of the terminal device may be a layered architecture, for example, the software may be divided into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the operating system is divided into five layers, which are application program layer, application program framework layer (framework, FWK), runtime and system library, kernel layer, and hardware layer from top to bottom.
应用程序层可以包括一系列应用程序包。如图6所示,应用程序层可以包括相机、设置、皮肤模块、用户界面(user interface,UI)、三方应用程序等。其中,三方应用程序可以包括图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等。The application layer can consist of a series of application packages. As shown in FIG. 6, the application program layer may include camera, settings, skin module, user interface (user interface, UI), three-party application program and so on. Among them, the three-party application may include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and so on.
在本申请一些实施例中,应用程序层可以用于实现编辑界面的呈现,上述编辑界面可以用于用户进行操作。例如,用户可以在视频对应呈现的编辑界面上进行投屏的用户操作。In some embodiments of the present application, the application layer may be used to implement the presentation of an editing interface, and the above editing interface may be used for user operations. For example, the user may perform a screencasting user operation on an editing interface corresponding to the presentation of the video.
一种可能的实现方式中,应用程序可以使用java语言开发,通过调用应用程序框架层所提供的应用程序编程接口(application programming interface,API)来完成,开发者可以通过应用程序框架层来与操作系统的底层(例如硬件层、内核层等)进行交互,开发自己的应用程序。该应用程序框架层主要是操作系统的一系列的服务和管理系统。In a possible implementation mode, the application program can be developed using the Java language and completed by calling the application programming interface (application programming interface, API) provided by the application program framework layer, and the developer can communicate with the application program framework layer. The bottom layer of the system (such as hardware layer, kernel layer, etc.) interacts and develops its own application program. The application framework layer is mainly a series of services and management systems of the operating system.
应用程序框架层为应用程序层的应用程序提供应用编程接口和编程框架。应用程序框架层包括一些预定义函数。如图6所示,应用程序框架层可以包括快捷图标管理模块,窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。The application framework layer provides application programming interfaces and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 6, the application framework layer may include a shortcut icon management module, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
快捷图标管理模块用于对终端设备上显示的快捷图标进行管理,例如创建快捷图标、移除快捷图标、监控快捷图标是否满足显示条件等。The shortcut icon management module is used to manage the shortcut icons displayed on the terminal device, such as creating shortcut icons, removing shortcut icons, monitoring whether the shortcut icons meet the display conditions, and so on.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。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, capture the screen, etc. Content providers are used to store and retrieve data and make it accessible to applications. Said data may include video, 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. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供终端设备的通信功能。例如通话状态的管理(包括接通,挂断等)。The telephony manager is used to provide the communication function of the terminal equipment. For example, the management of call status (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is issued, the terminal device vibrates, and the indicator light flashes, etc.
在本申请一些实施例中,该应用程序框架层主要负责调用与硬件层之间通信的服务接口,以将用户进行操作的操作请求传递到硬件层,所述操作请求可以包含用户打开某一APP的操作请求、或可以包含用户在某一APP进行的多屏协同的操作请求等。In some embodiments of the present application, the application framework layer is mainly responsible for invoking the service interface communicated with the hardware layer, so as to transfer the user's operation request to the hardware layer, and the operation request may include the user opening a certain APP The operation request, or may include the multi-screen collaborative operation request performed by the user in an APP, etc.
运行时包括核心库和虚拟机。运行时负责操作系统的调度和管理。The runtime includes the core library and virtual machine. The runtime is responsible for the scheduling and management of the operating system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是操作系统的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of the operating system. The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple function 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 the 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 various commonly used audio and video formats, as well as still image files, etc. 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, etc.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
在一些实施例中,三维图形处理库可以用于绘制三维的运动轨迹图像,2D图形引擎可以用于绘制二维的运动轨迹图像。In some embodiments, a 3D graphics processing library can be used to draw a 3D motion track image, and a 2D graphics engine can be used to draw a 2D motion track image.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
硬件层可以包括各类传感器,例如加速度传感器、陀螺仪传感器、触摸传感器等。The hardware layer may include various types of sensors, such as acceleration sensors, gyroscope sensors, touch sensors, and the like.
通常终端设备200可以同时运行多个应用程序。较为简单的,一个应用程序可以对应一个进程,较为复杂的,一个应用程序可以对应多个进程。每个进程具备一个进程号(进程ID)。Usually, the terminal device 200 can run multiple application programs at the same time. Simpler, one application can correspond to one process, and more complex, one application can correspond to multiple processes. Each process has a process number (process ID).
结合上述图5中对终端设备的硬件结构的介绍,以及图6中对终端设备的软件框架的介绍,下面针对不同P2P组中的终端设备需要建立Wi-Fi P2P连接的场景,示例性说明终端设备执行本申请实施例中提出的一种Wi-Fi直连通信方法的软件以及硬件的工作原理。Combined with the introduction of the hardware structure of the terminal device in Figure 5 above, and the introduction of the software framework of the terminal device in Figure 6, the following illustrates the scenario where the terminal devices in different P2P groups need to establish a Wi-Fi P2P connection. The working principle of the software and hardware of the device implementing a Wi-Fi Direct communication method proposed in the embodiment of the present application.
应理解,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a、b和c,其中a、b、c可以是单个,也可以是多个。It should be understood that "at least one" in the embodiments of the present application refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural item(s). For example, at least one item (unit) of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b, c Can be single or multiple.
本申请实施例涉及的多个,是指大于或等于两个。A plurality referred to in the embodiment of the present application means greater than or equal to two.
另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or imply order.
此外,本申请实施例中,“终端设备”、“设备”、“手机”等可以混用,即指可以用于实现本申请实施例的各种设备;本申请实施例中的“应用”和“应用程序”也可以混用,均指具有一定业务提供能力的程序或客户端等,也就是说应用和客户端也可混用,比如视频客户端、游戏客户端也可以称之为视频应用或游戏应用等。In addition, in the embodiments of this application, "terminal device", "equipment", "mobile phone" and so on can be used interchangeably, that is, various devices that can be used to implement the embodiments of this application; the terms "application" and "mobile phone" in the embodiments of this application "Applications" can also be used in combination, and both refer to programs or clients with certain service-providing capabilities, that is to say, applications and clients can also be used in combination. For example, video clients and game clients can also be called video applications or game applications. wait.
应理解,终端设备的硬件结构可以如图5所示,软件架构可以如图6所示,其中,终端设备中的软件架构对应的软件程序和/或模块可以存储在存储器240中,处理器230可以运行存储器240中存储的软件程序和应用以执行本申请实施例提供的一种Wi-Fi直连通信方法的流程。It should be understood that the hardware structure of the terminal device may be as shown in FIG. 5, and the software architecture may be as shown in FIG. The software programs and applications stored in the memory 240 may be executed to execute the procedure of a Wi-Fi direct communication method provided in the embodiment of the present application.
为了便于理解本申请提供的一种Wi-Fi直连通信方法,以下结合图7至图15中所示的内容,对采用本申请提供的方法的实现过程进行介绍。In order to facilitate the understanding of a Wi-Fi direct communication method provided in this application, the implementation process of the method provided in this application will be introduced below in combination with the contents shown in FIG. 7 to FIG. 15 .
本申请提供方法的设计思想为,当存在归属于不同P2P组的第一终端设备与第二终端设备之间需要建立Wi-Fi P2P连接的场景时,对多个不同的P2P组进行群组合并,实现将第一终端设备和第二终端设备构建在一个新的P2P组中。这样,在新的P2P组中,GO分别可以与每个GC通过Wi-Fi P2P连接进行业务数据包互传,或者GC与GC之间通过在MAC层GO中转且在应用层通过Wi-Fi P2P连接进行业务数据包互传,从而可以满足更多场景下的终端设备与终端设备之间的Wi-Fi P2P传输,便于提升业务数据包传输的效率和满足用户多种场景需求,从而可以提升用户体验。The design concept of the method provided in this application is to perform group merging on multiple different P2P groups when there is a scenario where a Wi-Fi P2P connection needs to be established between the first terminal device and the second terminal device belonging to different P2P groups , realizing building the first terminal device and the second terminal device into a new P2P group. In this way, in the new P2P group, GO can exchange business data packets with each GC through Wi-Fi P2P connection, or between GC and GC through GO transfer at the MAC layer and Wi-Fi P2P at the application layer Connect for mutual transmission of business data packets, so as to meet the Wi-Fi P2P transmission between terminal devices and terminal devices in more scenarios, which is convenient to improve the efficiency of business data packet transmission and meet the needs of users in various scenarios, so as to improve user experience.
示例性的,结合前述介绍到的图4所示的内容,现有技术中存在归属于P2P组1的第一终端设备无法与归属于P2P组2的第二终端设备之间,由于通道占用无法建立新的Wi-Fi直连的问题。图7为通过本申请提供的方法进行处理之后的示意图。本申请提供的方法通过对P2P组1和P2P组2进行群组合并,构建得到新的P2P组1’,从而可以在P2P组1’中实现第一终端设备与第二终端设备的Wi-Fi直连。基于Wi-Fi直连技术标准协议,通常由一个GO和多个GC构成一个P2P组,假设采用将P2P组2合并到P2P组1的方式,则可将P2P组2中的GO和GC作为GC连接P2P组1中的GO上,如图7中P2P组1’中包含GO、GC 1、GC 2和GC 3。在图7示出的P2P组1’中,GO与GC 1、GC 2和GC 3分别建立了Wi-Fi P2P,因此可以通过Wi-Fi P2P连接处理P2P业务。GC 1、GC 2和GC 3中每两个终端设备之间,可以通过在MAC层GO中转且在应用层通过Wi-Fi P2P连接处理P2P业务。其中,P2P组1’中的GO可以根据预设的合并规则确定,具体的合并规则结合以下多个实施例进行说明,在此暂不详述。Exemplarily, in combination with the content shown in Figure 4 introduced above, in the prior art, the first terminal device belonging to the P2P group 1 cannot communicate with the second terminal device belonging to the P2P group 2. Problems establishing new Wi-Fi Direct connections. Fig. 7 is a schematic diagram after being processed by the method provided in this application. The method provided by this application constructs a new P2P group 1' by group merging P2P group 1 and P2P group 2, so that the Wi-Fi connection between the first terminal device and the second terminal device can be realized in the P2P group 1'. direct connection. Based on the Wi-Fi Direct technical standard protocol, a P2P group is usually composed of one GO and multiple GCs. Assuming that the method of merging P2P group 2 into P2P group 1 is adopted, the GO and GC in P2P group 2 can be used as GCs Connect to GO in P2P group 1, as shown in Figure 7, P2P group 1' includes GO, GC 1, GC 2 and GC 3. In the P2P group 1' shown in Figure 7, GO has established Wi-Fi P2P with GC 1, GC 2 and GC 3 respectively, so the P2P business can be processed through the Wi-Fi P2P connection. Between every two terminal devices in GC 1, GC 2 and GC 3, P2P services can be processed through GO transfer at the MAC layer and Wi-Fi P2P connection at the application layer. Wherein, the GO in the P2P group 1' can be determined according to a preset merging rule, and the specific merging rule will be described in conjunction with the following multiple embodiments, and will not be described in detail here.
需要说明的是,本申请实施例中以两个不同的P2P组进行群组合并作为示例,在归属于不同P2P组的更多个终端设备之间,存在多种需要建立Wi-Fi P2P传输的场景时,可以参照本申请介绍的实施例方式,将多个不同的P2P组重新构建在一个新的P2P组中。一种可选的示例为,多个不同的P2P组可以采用逐步群组合并的方式,例如若存在P2P组1、P2P组2和P2P组3,其中P2P组1中的第一终端设备需要与P2P组2中的第二终端设备建立新的Wi-Fi直连,以及P2P组2中的第三终端设备需要与P2P组3中的第三终端设备建立新的Wi-Fi直连,则可以先将P2P组1和P2P组2合并为新的P2P组1’,再将P2P组1’和P2P组3合并为新的P2P组3’。另一种可选的示例为,多个不同P2P组的终端设备进行共同协商确定群组合并之后的新P2P组的GO的方式,沿用前一示例的举例,也可以第一终端设备、第二终端设备和第三终端设备进行共同协商,比如得到的协商结果可以为将P2P组1和P2P组3合并到P2P组2,得到新的P2P组2’的方式。It should be noted that, in the embodiment of the present application, two different P2P groups are used as an example for group merging. There are various ways to establish Wi-Fi P2P transmission between more terminal devices belonging to different P2P groups. In the scenario, multiple different P2P groups can be reconstructed into a new P2P group by referring to the embodiments described in this application. An optional example is that a plurality of different P2P groups can adopt a group merging method step by step, for example, if there are P2P group 1, P2P group 2 and P2P group 3, wherein the first terminal device in P2P group 1 needs to be connected with The second terminal device in P2P group 2 establishes a new Wi-Fi direct connection, and the third terminal device in P2P group 2 needs to establish a new Wi-Fi direct connection with the third terminal device in P2P group 3, then you can First, P2P group 1 and P2P group 2 are merged into a new P2P group 1', and then P2P group 1' and P2P group 3 are merged into a new P2P group 3'. Another optional example is that multiple terminal devices in different P2P groups negotiate to determine the GO of the new P2P group after group merging. Following the example of the previous example, the first terminal device and the second The terminal device and the third terminal device perform joint negotiation. For example, the obtained negotiation result may be a manner of merging P2P group 1 and P2P group 3 into P2P group 2 to obtain a new P2P group 2'.
为了更好地理解本申请,以下结合几种可能的应用场景进行介绍。In order to better understand the present application, several possible application scenarios are introduced below.
场景1,图8为本申请实施例提供的一种Wi-Fi直连通信方法的应用场景对比图。如图8中(a)示出的,假设存在第一终端设备(手机1)正在与智慧屏在P2P组1中进行投屏,手机1在P2P组1中作为GC 1、智慧屏在P2P组1中作为GO 1;以及,假设存在第二终端设备(手机2)正在与平板电脑在P2P组2中进行多屏协同,手机2在P2P组2中作为GC 2、平板电脑在P2P组2中作为GO 2。此时,若用户通过手机1采用面对面传文件方式触发向手机2进行图片分享的用户操作,现有技术中由于手机1和手机2为归属于不同的P2P组的GC,存在P2P通道被占用问题,因此会导致无法建立Wi-Fi直连,进而使得图片分享失败。其中,面对面传文件方式例如“华为分享”和“面对面快传”等基于Wi-Fi P2P连接进行文件传输的方式。 Scenario 1, FIG. 8 is a comparison diagram of application scenarios of a Wi-Fi direct communication method provided by the embodiment of the present application. As shown in (a) of Figure 8, it is assumed that there is a first terminal device (mobile phone 1) that is projecting screens with the smart screen in P2P group 1, mobile phone 1 acts as GC 1 in P2P group 1, and the smart screen is in the P2P group 1 as GO 1; and, assuming that there is a second terminal device (mobile phone 2) that is performing multi-screen collaboration with tablet computer in P2P group 2, mobile phone 2 is in P2P group 2 as GC 2, and tablet computer is in P2P group 2 As GO 2. At this time, if the user uses the method of face-to-face file transfer through mobile phone 1 to trigger the user operation of sharing pictures with mobile phone 2, in the prior art, since mobile phone 1 and mobile phone 2 are GCs belonging to different P2P groups, there is a problem of P2P channel being occupied , so it will fail to establish a Wi-Fi direct connection, and then the picture sharing will fail. Among them, the face-to-face file transfer methods such as "Huawei Share" and "Face-to-Face Quick Transfer" are based on Wi-Fi P2P connection for file transfer.
通过本申请提供的方法,若用户通过手机1采用面对面传文件方式触发向手机2进行图片分享的用户操作,手机1和手机2可以进行群组合并的协商,实现将P2P组1和P2P组2合并为P2P组1’,如图8中(b)示出的内容。在P2P组1’中,可以将智慧屏作为该P2P组1’中的GO 1’,以及可将手机1、手机2和平板电脑作为该P2P组1’中的各个GC,这样手机1与手机2可以在P2P组1’中建立Wi-Fi直连,从而可以采用面对面传文件方式进行图片分享的用户操作。其中,在P2P组1’中,手机1和手机2作为GC,可以通过GO对业务数据包进行中转实现Wi-Fi P2P连接,例如:可以在MAC层上由GO对 业务数据包进行中转,进而可以实现手机1和手机2在应用层建立Wi-Fi P2P连接。Through the method provided by this application, if the user triggers the user operation of sharing pictures to the mobile phone 2 through the method of face-to-face file transfer through the mobile phone 1, the mobile phone 1 and the mobile phone 2 can carry out the negotiation of group merging, and realize the integration of P2P group 1 and P2P group 2 Merge into a P2P group 1', as shown in (b) in FIG. 8 . In the P2P group 1', the smart screen can be used as the GO 1' in the P2P group 1', and the mobile phone 1, the mobile phone 2 and the tablet computer can be used as each GC in the P2P group 1', so that the mobile phone 1 and the mobile phone 2. A Wi-Fi direct connection can be established in the P2P group 1', so that the user operation of picture sharing can be carried out by means of face-to-face file transfer. Among them, in the P2P group 1', mobile phone 1 and mobile phone 2 are used as GCs, and can implement Wi-Fi P2P connection by transferring service data packets through GO. For example, GO can transfer service data packets on the MAC layer, and then It can realize the establishment of Wi-Fi P2P connection between mobile phone 1 and mobile phone 2 at the application layer.
场景2,图9为本申请实施例提供的一种Wi-Fi直连通信方法的另一种应用场景对比图。沿用图8介绍的示例,用户还可以通过智慧屏采用面对面传文件方式触发向平板电脑进行图片分享的用户操作,现有技术中,由于智慧屏(GO1)和平板电脑(GO2)分别为归属于不同P2P组的GO,同样存在P2P通道被占用问题,因此也会导致分享失败,如图9中(a)示出的内容。通过本申请提供的方法,同样在P2P组1和P2P组2合并得到的P2P组1’中,可以实现智慧屏(GO1)与平板电脑(GO2)建立Wi-Fi P2P连接,如图9中(b)所示内容。 Scenario 2, FIG. 9 is a comparison diagram of another application scenario of a Wi-Fi direct communication method provided by the embodiment of the present application. Following the example shown in Figure 8, the user can also use the face-to-face file transfer method through the smart screen to trigger the user operation of sharing pictures to the tablet computer. In the prior art, since the smart screen (GO1) and the tablet computer (GO2) belong to the GOs of different P2P groups also have the problem of P2P channels being occupied, so sharing will also fail, as shown in (a) in Figure 9 . Through the method provided by this application, also in the P2P group 1' obtained by merging P2P group 1 and P2P group 2, it is possible to establish a Wi-Fi P2P connection between the smart screen (GO1) and the tablet computer (GO2), as shown in Figure 9 ( b) Content shown.
此外,实际场景中还可能存在例如智慧屏(GO1)与手机2(GC2)进行多屏协同需求,本申请对其他可能的应用场景不再一一示出。可以理解,现有技术中若第一终端设备已经在P2P组1中建立Wi-Fi P2P,此时若需要与归属于P2P组2的第二终端设备建立Wi-Fi P2P连接,由于P2P通道占用会导致建立连接失败,而本申请通过对P2P组1和P2P组2进行群组合并,可以实现第一终端设备和第二终端之间建立Wi-Fi P2P连接。In addition, in actual scenarios, for example, there may be a need for multi-screen collaboration between the smart screen (GO1) and the mobile phone 2 (GC2), and this application will not show other possible application scenarios one by one. It can be understood that in the prior art, if the first terminal device has established Wi-Fi P2P in P2P group 1, if it is necessary to establish a Wi-Fi P2P connection with the second terminal device belonging to P2P group 2 at this time, due to the occupation of the P2P channel It will lead to failure to establish a connection, but this application can realize the establishment of a Wi-Fi P2P connection between the first terminal device and the second terminal by performing group merging on the P2P group 1 and the P2P group 2.
基于图8和图9示出的应用场景,以下结合图10对本申请提供方法的具体实现过程进行详细介绍。为了便于理解,图10中沿用图8中介绍的示例,即存在第一终端设备(手机1)正在与智慧屏在P2P组1中进行投屏,存在第二终端设备(手机2)正在与平板电脑在P2P组2中进行多屏协同,此时若用户通过手机1采用面对面快传方式触发向手机2进行图片分享的用户操作,在这个情况下介绍不同P2P组中包含的多个终端设备的具体处理过程。需要说明的是,图10中以图8介绍的示例进行介绍,但本申请并不限定该示例场景。可以理解,本申请实施例提供的方法适用于多种可能的当存在归属于不同P2P组的第一终端设备与第二终端设备之间需要建立Wi-Fi P2P连接的场景。Based on the application scenarios shown in FIG. 8 and FIG. 9 , the specific implementation process of the method provided by the present application will be introduced in detail below with reference to FIG. 10 . For ease of understanding, the example introduced in Figure 8 is used in Figure 10, that is, there is a first terminal device (mobile phone 1) that is projecting screens with the smart screen in P2P group 1, and there is a second terminal device (mobile phone 2) that is communicating with the tablet The computer performs multi-screen collaboration in P2P group 2. At this time, if the user triggers the user operation of sharing pictures to the mobile phone 2 through the face-to-face fast transmission method through the mobile phone 1, in this case, the introduction of multiple terminal devices included in different P2P groups Specific process. It should be noted that the example shown in FIG. 8 is used in FIG. 10 for introduction, but this application does not limit the example scenario. It can be understood that the method provided in the embodiment of the present application is applicable to various possible scenarios where a Wi-Fi P2P connection needs to be established between the first terminal device and the second terminal device belonging to different P2P groups.
此外,以下介绍到的实施例中,以第一终端设备和第二终端设备为智能手机为例,但本申请并不限定于智能手机,可以建立Wi-Fi P2P连接的任一终端设备均可作为本申请中的第一终端设备或第二终端设备,例如,第一终端设备或第二终端设备还可以为笔记本电脑、车载电脑等。In addition, in the embodiments described below, the first terminal device and the second terminal device are smart phones as an example, but this application is not limited to smart phones, and any terminal device that can establish a Wi-Fi P2P connection can be used. As the first terminal device or the second terminal device in this application, for example, the first terminal device or the second terminal device may also be a notebook computer, a vehicle-mounted computer, or the like.
参阅图10,为本申请实施例提供的一种Wi-Fi直连通信方法的流程示意图。具体可以包括以下步骤:Referring to FIG. 10 , it is a schematic flowchart of a Wi-Fi Direct communication method provided by an embodiment of the present application. Specifically, the following steps may be included:
S1001:第一终端设备向第二终端设备发起建立Wi-Fi P2P连接请求。示例性的,可以存在多种第一终端设备向第二终端设备发起建立Wi-Fi P2P连接请求的应用场景,例如,第一终端设备需要向第二终端设备发起建立面对面传文件请求,或者第一终端设备向第二终端设备发起投屏请求等。应理解,本申请实施例的“第一终端设备”和“第二终端设备”仅是用作区分描述。S1001: The first terminal device initiates a Wi-Fi P2P connection establishment request to the second terminal device. Exemplarily, there may be various application scenarios where the first terminal device initiates a request to establish a Wi-Fi P2P connection to the second terminal device. For example, the first terminal device needs to initiate a request to establish a face-to-face file transfer to the second terminal device, or A terminal device initiates a screen projection request and the like to the second terminal device. It should be understood that the "first terminal device" and "second terminal device" in this embodiment of the present application are only used for distinguishing descriptions.
一种可能的场景中,以第一终端设备向第二终端设备发起建立华为分享请求的应用场景为例进行介绍。参阅图11,在手机1(GC1)正在与智慧屏(GO1)在P2P组1中进行投屏,手机2(GC2)正在与平板电脑(GO2)在P2P组2中进行多屏协同的场景下,用户1在使用手机1的过程中,还可能存在对图库中的一张图片进行分享的场景。具体场景可以为,用户1在展示待分享图片的显示界面上,对该显示界面上的“分享”控件进行点击操作1,如图11中的(1)所示出的用户操作。然后,若在此之前手机1中的“华为分享”功能未开启,则用户1可以在图11中的(2)示出的显示界面中,进行开启手机1(GC1) 的华为分享功能的点击操作2;根据点击操作2,在手机1通过对其他开启华为分享功能的Wi-Fi P2P搜索可以刷新显示界面为图11中的(3),示出通过Wi-Fi P2P搜索可以发现的多个其他终端设备的标识;最后用户1可以对显示为用户2的手机2(GC2)的控件进行点击操作3,手机1可以根据点击操作3,向手机2发起建立Wi-Fi P2P连接请求。或者,若在此之前手机1中的“华为分享”功能已经开启,则手机1根据点击操作1也可以直接刷新显示界面为图11中的(3),后续处理过程与前述介绍内容类似,在此不再赘述。In a possible scenario, an application scenario in which a first terminal device initiates a Huawei sharing request to a second terminal device is used as an example for introduction. Refer to Figure 11, in the scenario where mobile phone 1 (GC1) is projecting screen with smart screen (GO1) in P2P group 1, and mobile phone 2 (GC2) is performing multi-screen collaboration with tablet computer (GO2) in P2P group 2 , in the process of using the mobile phone 1, the user 1 may also share a picture in the gallery. A specific scenario may be that the user 1 performs a click operation 1 on the "share" control on the display interface displaying the picture to be shared, as shown in (1) in FIG. 11 . Then, if the "Huawei Sharing" function in mobile phone 1 is not enabled before this, user 1 can click to enable the Huawei sharing function of mobile phone 1 (GC1) in the display interface shown in (2) in Figure 11 Operation 2: According to click operation 2, the display interface can be refreshed as (3) in Figure 11 by searching for other Wi-Fi P2P with the Huawei sharing function enabled on mobile phone 1, showing that multiple Wi-Fi P2P searches can be found Identification of other terminal devices; finally, user 1 can perform click operation 3 on the control displayed as user 2's mobile phone 2 (GC2), and mobile phone 1 can initiate a Wi-Fi P2P connection request to mobile phone 2 according to the click operation 3. Or, if the "Huawei Share" function in the mobile phone 1 has been turned on before this, the mobile phone 1 can also directly refresh the display interface as (3) in Figure 11 according to the click operation 1. The subsequent processing process is similar to the above-mentioned introduction. This will not be repeated here.
另一种可能的场景中,第一终端设备向第二终端设备发起建立Wi-Fi P2P连接请求还可能是从基于Wi-Fi热点的局域网传输方式进行切换触发的。参阅图12,在手机1(GC1)正在与智慧屏(GO1)在P2P组1中进行投屏,手机2(GC2)正在与平板电脑(GO2)在P2P组2中进行多屏协同的场景下,还可能存在手机1与手机2基于Wi-Fi热点的局域网传输方式进行照片分享,但基于Wi-Fi热点建立的局域网可能存在传输不稳定导致的卡顿问题。本申请实施时,当第一终端设备或第二终端设备在业务层面上识别到数据传输状态变差甚至异常的情况下,可以切换至基于Wi-Fi P2P的传输方式,从而可以提升数据的传输效率。可选的,若手机1和手机2均开启了华为分享功能,则手机1可以向手机2发起通过华为分享建立Wi-Fi P2P连接请求。另一可选的,若手机1和手机2均开启了蓝牙,则手机1还可以向手机2发起通过蓝牙建立Wi-Fi P2P连接请求。In another possible scenario, the request initiated by the first terminal device to establish a Wi-Fi P2P connection to the second terminal device may also be triggered by switching from a Wi-Fi hotspot-based LAN transmission mode. Refer to Figure 12, in the scenario where mobile phone 1 (GC1) is projecting screen with smart screen (GO1) in P2P group 1, and mobile phone 2 (GC2) is performing multi-screen collaboration with tablet computer (GO2) in P2P group 2 , there may also be photo sharing between mobile phone 1 and mobile phone 2 based on the Wi-Fi hotspot LAN transmission method, but the local area network established based on the Wi-Fi hotspot may have a lag problem caused by unstable transmission. When this application is implemented, when the first terminal device or the second terminal device recognizes that the data transmission status is degraded or even abnormal at the business level, it can switch to the Wi-Fi P2P-based transmission mode, thereby improving data transmission efficiency. Optionally, if both mobile phone 1 and mobile phone 2 have enabled the Huawei sharing function, mobile phone 1 can initiate a request to mobile phone 2 to establish a Wi-Fi P2P connection through Huawei sharing. Alternatively, if both mobile phone 1 and mobile phone 2 have turned on Bluetooth, then mobile phone 1 can also initiate a request to establish a Wi-Fi P2P connection via Bluetooth to mobile phone 2.
S1002:第一终端设备与第二终端设备建立信息传输通道。示例性的,第一终端设备和第二终端设备可以采用蓝牙或者无线局域网(wireless local area network,WLAN)等方式建立一个可以信任的信息传输通道。这样,通过该信息传输通道,第一终端设备与第二终端设备之间可以进行P2P状态信息的信息交互,从而可以进行群组合并的协商。S1002: The first terminal device establishes an information transmission channel with the second terminal device. Exemplarily, the first terminal device and the second terminal device may establish a trustworthy information transmission channel by means of bluetooth or wireless local area network (wireless local area network, WLAN). In this way, through the information transmission channel, information exchange of P2P status information can be performed between the first terminal device and the second terminal device, so that group merger negotiation can be performed.
S1003:第一终端设备与第二终端设备通过所述信息传输通道进行P2P状态信息的信息交互。S1003: The first terminal device and the second terminal device perform information exchange of P2P state information through the information transmission channel.
第一终端设备可以向第二终端设备发送第一P2P状态信息,所述第一P2P状态信息可以包括但不限于以下信息:P2P组1的群组信息、P2P组1的业务信息。The first terminal device may send first P2P state information to the second terminal device, and the first P2P state information may include but not limited to the following information: group information of P2P group 1, service information of P2P group 1.
示例性,P2P组1的群组信息可以包括但不限于:用于区分不同P2P组的服务集标识(service set identifier,SSID)、基本服务集(basic service set,BSS)的名称BSSID、使用的Wi-Fi信道、进行物理传输通道的工作频点、信道带宽、GO角色和GC角色、GO的媒体存取控制(media access control,MAC)地址和互联网协议(internet protocol,IP)地址、每个GC的MAC地址和IP地址等。Exemplarily, the group information of P2P group 1 may include but not limited to: service set identifier (service set identifier, SSID) used to distinguish different P2P groups, name BSSID of basic service set (basic service set, BSS), used Wi-Fi channel, working frequency of physical transmission channel, channel bandwidth, GO role and GC role, GO media access control (media access control, MAC) address and Internet protocol (internet protocol, IP) address, each GC's MAC address and IP address, etc.
P2P组1的业务信息可以包括但不限于:业务类型(如投屏或多屏协同或面对面传文件等)、业务优先级、待传输业务数据量和当前业务传输平均速度等。The business information of P2P group 1 may include but not limited to: business type (such as screen projection or multi-screen collaboration or face-to-face file transfer), business priority, business data volume to be transmitted, and current average speed of business transmission.
第二终端设备可以向第一终端设备发送第二P2P状态信息,所述第二P2P状态信息可以参阅第一P2P状态信息,包含第二终端设备所在的P2P组2的相关信息,对此不再赘述。The second terminal device may send the second P2P state information to the first terminal device, and the second P2P state information may refer to the first P2P state information, including information about the P2P group 2 where the second terminal device is located, and no further repeat.
这样,第一终端设备与第二终端设备之间通过P2P状态信息的共享,可以互相获知对方已经建立的Wi-Fi P2P的状态,从而可以进行群组合并的协商。In this way, through the sharing of P2P state information between the first terminal device and the second terminal device, the state of the Wi-Fi P2P that has been established by the other party can be known to each other, so that the negotiation of group merging can be performed.
S1004:第一终端设备与第二终端设备进行群组合并的协商。S1004: The first terminal device performs group merger negotiation with the second terminal device.
可选的,由第一终端设备(手机1)根据本地存储的第一P2P状态信息和接收到的第二P2P状态信息进行群组合并的协商处理。或者可选的,由第二终端设备(手机2)根据本地存储的第二P2P状态信息和接收到的第一P2P状态信息进行群组合并的协商处理。实施时可以根据终端设备的类型和/或请求发起方等信息确定进行群组合并的协商处理的终 端设备,例如,若手机1的处理器比手机2的处理器具有更强的性能,则可由手机1进行群组合并的协商处理。第一终端设备或第二终端设备还可以对协商处理的协商结果进行共享,可以理解为,若由手机1进行群组合并的协商处理,手机1得到协商结果之后可以通过信息传输通道发送给手机2。Optionally, the first terminal device (mobile phone 1) performs negotiation processing of group merging according to the locally stored first P2P status information and the received second P2P status information. Or optionally, the second terminal device (mobile phone 2 ) performs group merging negotiation processing according to the locally stored second P2P status information and the received first P2P status information. During implementation, the terminal device that performs the negotiation process of group merging can be determined according to the type of the terminal device and/or the information such as the request initiator. For example, if the processor of mobile phone 1 has stronger performance than the processor of mobile phone 2, the Mobile phone 1 performs negotiation processing of group merging. The first terminal device or the second terminal device can also share the negotiation result of the negotiation process. It can be understood that if the mobile phone 1 performs the negotiation process of group merging, the mobile phone 1 can send the negotiation result to the mobile phone through the information transmission channel after obtaining the negotiation result. 2.
示例性的,以第一终端设备进行群组合并的协商处理为例,第一终端设备可根据预设的合并规则进行协商处理。其中,预设的合并规则可以包括但不限于以下示出的规则:Exemplarily, taking the negotiation process of group merging performed by the first terminal device as an example, the first terminal device may perform the negotiation process according to a preset merging rule. Among them, the preset merging rules may include but not limited to the rules shown below:
规则1、包含终端设备数量少的P2P组合并到包含终端设备数量多的P2P组中。示例性的,图13为本申请实施例提供的一种Wi-Fi直连通信方法的合并示意图。假设P2P组1中包含3个终端设备、P2P组2中包含2个终端设备,考虑到包含终端设备数量多的P2P组可能存在更多的业务传输,例如P2P组1中的GO和GC 1之间的业务传输、GO和GC2之间的业务传输以及GC 1和GC 2之间通过GO中转的业务传输,为了降低P2P组1和P2P组2进行群组合并对原有P2P连接的影响,则可以将P2P组2合并到P2P组1中,可以理解为,将P2P组2中包含的GO和GC作为GC连接到P2P组1中的GO上,得到新的P2P组1’。Rule 1: The P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices. Exemplarily, FIG. 13 is a combined schematic diagram of a Wi-Fi Direct communication method provided by an embodiment of the present application. Assuming that P2P group 1 contains 3 terminal devices and P2P group 2 contains 2 terminal devices, considering that there may be more service transmission in P2P groups containing a large number of terminal devices, for example, between GO and GC 1 in P2P group 1 The service transmission between GO and GC2, and the service transmission between GC 1 and GC 2 via GO, in order to reduce the impact of P2P group 1 and P2P group 2 on the original P2P connection, then The P2P group 2 can be merged into the P2P group 1. It can be understood that the GO and GC contained in the P2P group 2 are connected as GCs to the GO in the P2P group 1 to obtain a new P2P group 1'.
规则2、业务优先级低的P2P组合并到业务优先级高的P2P组中。示例性的,若P2P组1中的业务优先级均属于普通级别,P2P组2中处理的业务优先级包含紧急级别,则将P2P组1包含的GO和至少一个GC作为GC连接到P2P组2中的GO上,以尽量降低对P2P组2中紧急级别业务的影响。Rule 2: P2P groups with low service priority are merged into P2P groups with high service priority. Exemplarily, if the business priorities in P2P group 1 belong to the normal level, and the business priorities processed in P2P group 2 include emergency level, then connect the GO and at least one GC contained in P2P group 1 to P2P group 2 as GC in order to minimize the impact on the emergency-level services in P2P group 2.
规则3、信道带宽小的P2P组合并到信道带宽大的P2P组中。示例性的,图14为本申请实施例提供的一种Wi-Fi直连通信方法的另一合并示意图。假设P2P组1工作在信道1,假设信道1的物理传输通道的工作频点为5180Khz且带宽为80M,P2P组21工作在信道6,假设信道6的物理传输通道的工作频点为2437Khz且带宽为20M,考虑到具有更大信道带宽的信道对业务数据包的传输效率更高,则可以将P2P组2合并到P2P组1中,可以理解为,将P2P组2中包含的GO和GC作为GC连接到P2P组1中的GO上,得到新的P2P组1’。其中P2P组1’的工作信道复用P2P组1的工作信道,即为信道1。Rule 3: The P2P group with small channel bandwidth is merged into the P2P group with large channel bandwidth. Exemplarily, FIG. 14 is another combined schematic diagram of a Wi-Fi Direct communication method provided by the embodiment of the present application. Assume P2P group 1 works on channel 1, assume that the working frequency of the physical transmission channel of channel 1 is 5180Khz and the bandwidth is 80M, and P2P group 21 works on channel 6, assuming that the working frequency of the physical transmission channel of channel 6 is 2437Khz and the bandwidth is 80M is 20M, considering that channels with larger channel bandwidths have higher transmission efficiency for service data packets, then P2P group 2 can be merged into P2P group 1, which can be understood as using GO and GC contained in P2P group 2 as GC is connected to GO in P2P group 1 to get a new P2P group 1'. Wherein, the working channel of P2P group 1' reuses the working channel of P2P group 1, which is channel 1.
规则4、业务量少的P2P组合并到业务量大的P2P组中。这样,可以降低对业务量大的P2P组的原有P2P连接的影响。Rule 4: The P2P group with a small business volume is merged into the P2P group with a large business volume. In this way, the impact on the original P2P connection of the P2P group with heavy traffic can be reduced.
规则5、GO性能弱的P2P组合并到GO性能强的P2P组中。示例性的,设备的性能可以为处理性能,若P2P组1中的GO为手机,P2P组2中的GO为平板电脑,通常平板电脑具有更强的处理性能,则将P2P组1包含的GO和至少一个GC作为GC连接到P2P组2中的GO上。另一示例性的,设备的性能还可以是功耗性能,若P2P组1中的GO相比于P2P组2中的GO具有更大电池容量或电池剩余电量等,则可将P2P组2合并到P2P组1上。其他示例性的,设备的性能还可以是射频性能或多种性能的组合,本申请对此不再一一示出。这样,可以保障合并之后得到的新的P2P组中GO对多个连接的GC的性能,从而可以保障的P2P组中的业务传输能力和业务传输稳定性。Rule 5. P2P groups with weak GO performance are merged into P2P groups with strong GO performance. Exemplarily, the performance of the device can be processing performance. If the GO in P2P group 1 is a mobile phone, and the GO in P2P group 2 is a tablet computer, usually the tablet computer has stronger processing performance, then the GO included in P2P group 1 and at least one GC connected to the GO in P2P group 2 as GC. Another example, the performance of the device can also be the power consumption performance, if the GO in the P2P group 1 has a larger battery capacity or remaining battery power, etc. than the GO in the P2P group 2, then the P2P group 2 can be merged Go to P2P group 1. In other examples, the performance of the device may also be a radio frequency performance or a combination of multiple performances, which are not shown in this application one by one. In this way, the performance of the GO to multiple connected GCs in the new P2P group obtained after the combination can be guaranteed, thereby guaranteeing the service transmission capability and service transmission stability in the P2P group.
规则6、Wi-Fi P2P连接请求发起方的P2P组合并到被发起方的P2P组中。Rule 6. The P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
一种可能的合并场景中,图15为本申请实施例提供的一种协商处理的流程示意图。需要说明的是,图15示出的为一种可能的合并场景,本申请实施时可以采用更多或更少的规则,以及对多个不同规则的判断顺序可以进行变更等,本申请对此不进行限定。处于P2P组1中的第一终端设备可以根据以下处理流程进行群组合并的协商处理,包括:In a possible merging scenario, FIG. 15 is a schematic flowchart of a negotiation process provided by an embodiment of the present application. It should be noted that what is shown in Figure 15 is a possible merging scenario, and more or fewer rules may be used during the implementation of this application, and the order of judging multiple different rules may be changed. Not limited. The first terminal device in P2P group 1 may perform group merger negotiation processing according to the following processing flow, including:
S1501、第一终端设备确定P2P组2与P2P组1包含的终端数量是否相等。若相等,则第一终端设备执行S1502b;否则执行S1502a。S1501. The first terminal device determines whether the number of terminals included in P2P group 2 and P2P group 1 is equal. If they are equal, the first terminal device executes S1502b; otherwise, executes S1502a.
S1502a、第一终端设备将包含终端设备数量少的P2P组合并到包含终端设备数量多的P2P组中。S1502a. The first terminal device merges the P2P group containing a small number of terminal devices into the P2P group containing a large number of terminal devices.
S1502b、第一终端设备确定P2P组2与P2P组1的业务优先级是否相等。若相等,则第一终端设备执行S1503b;否则执行S1503a。S1502b. The first terminal device determines whether the service priorities of the P2P group 2 and the P2P group 1 are equal. If they are equal, the first terminal device executes S1503b; otherwise, executes S1503a.
S1503a、第一终端设备将业务优先级低的P2P组合并到业务优先级高的P2P组中。S1503a. The first terminal device merges the P2P group with low service priority into the P2P group with high service priority.
S1503b、第一终端设备确定P2P组2与P2P组1的信道带宽是否相等。若相等,则第一终端设备执行S1504b;否则执行S1504a。S1503b. The first terminal device determines whether the channel bandwidths of the P2P group 2 and the P2P group 1 are equal. If they are equal, the first terminal device executes S1504b; otherwise, executes S1504a.
S1504a、第一终端设备将信道带宽小的P2P组合并到信道带宽大的P2P组中。S1504a. The first terminal device merges the P2P group with small channel bandwidth into the P2P group with large channel bandwidth.
S1504b、第一终端设备确定P2P组2与P2P组1的业务量是否相等。若相等,则第一终端设备执行S1505b;否则执行S1505a。S1504b. The first terminal device determines whether the service volumes of the P2P group 2 and the P2P group 1 are equal. If they are equal, the first terminal device executes S1505b; otherwise, executes S1505a.
S1505a、第一终端设备将业务量少的P2P组合并到业务量大的P2P组中。S1505a. The first terminal device merges the P2P group with a small traffic volume into the P2P group with a large traffic volume.
S1505b、第一终端设备确定P2P组2与P2P组1的GO性能是否相等。若相等,则第一终端设备执行S1506b;否则执行S1506a。S1505b. The first terminal device determines whether the GO performances of the P2P group 2 and the P2P group 1 are equal. If they are equal, the first terminal device executes S1506b; otherwise, executes S1506a.
S1506a、第一终端设备将GO性能弱的P2P组合并到GO性能强的P2P组中。S1506a. The first terminal device merges the P2P group with weak GO performance into the P2P group with strong GO performance.
S1506b、第一终端设备将请求发起方第一终端设备所属于的P2P组1合并到被发起方第二终端设备所属于的P2P组2中。S1506b. The first terminal device merges the P2P group 1 to which the first terminal device as the initiating party belongs to the P2P group 2 to which the second terminal device as the initiating party belongs to.
需要说明的是,若由第二终端设备进行群组合并的协商处理,则处理流程类似,本申请在此不再赘述。It should be noted that if the second terminal device performs the negotiation process of group merging, the process flow is similar, and the present application will not repeat it here.
在前述S1004之后,本申请实施例还可以包括以下步骤:After the foregoing S1004, the embodiment of the present application may further include the following steps:
S1005a:第一终端设备将协商结果发送给P2P组1中包含的至少一个其他终端设备。示例性的,在图10示出的内容中,P2P组1中还包含智慧屏,则第一终端设备(手机1)将协商结果发送给智慧屏。S1005a: The first terminal device sends the negotiation result to at least one other terminal device included in the P2P group 1 . Exemplarily, in the content shown in FIG. 10 , P2P group 1 also includes a smart screen, then the first terminal device (mobile phone 1 ) sends the negotiation result to the smart screen.
其中,协商结果中包含的信息可以包含但不限于合并方式以及目标合并群组的群组信息。例如,合并方式可以为将P2P组1合并到P2P组2中,或者可以为将P2P组2合并到P2P组1中。以及,假设目标合并群组为P2P组1,则目标合并群组的群组信息可以如前述S1003中介绍到的示例,以便于需要进行群组合并的P2P组所涉及到的终端设备可以及时确定P2P组的状态,从而可以保障P2P业务的效率。Wherein, the information contained in the negotiation result may include but not limited to the merging method and the group information of the target merging group. For example, the merging manner may be merging P2P group 1 into P2P group 2, or may be merging P2P group 2 into P2P group 1. And, assuming that the target merging group is P2P group 1, the group information of the target merging group can be the same as the example introduced in S1003 above, so that the terminal devices involved in the P2P group that need to perform group merging can be determined in time The state of the P2P group can ensure the efficiency of the P2P service.
S1005b:第二终端设备将协商结果发送给P2P组2中包含的至少一个其他终端设备。示例性的,在图10示出的内容中,P2P组2中还包含平板电脑,则第二终端设备(手机2)将协商结果发送给平板电脑。S1005b: The second terminal device sends the negotiation result to at least one other terminal device included in the P2P group 2 . Exemplarily, in the content shown in FIG. 10 , P2P group 2 also includes a tablet computer, then the second terminal device (mobile phone 2 ) sends the negotiation result to the tablet computer.
假设S1005a和S1005b发送的协商结果为将P2P组2合并到P2P组1中,则P2P组2中包含的多个终端设备可以进行对原有P2P连接进行拆链处理过程,然后将拆链处理之后得到的P2P组2中包含的多个终端设备作为GC连接到P2P组1的GO上,可以理解为P2P组2中的每个终端设备根据协商结果中包含的P2P组1中的GO角色的MAC地址和IP地址,分别向P2P组1中的GO发起建立Wi-Fi P2P连接请求,以实现分别与P2P组1中的GO连接的目的。Assuming that the negotiation result sent by S1005a and S1005b is to merge P2P group 2 into P2P group 1, then multiple terminal devices included in P2P group 2 can perform link disconnection processing on the original P2P connection, and then unlink the original P2P connection. The obtained multiple terminal devices included in P2P group 2 are connected to the GO of P2P group 1 as GC, which can be understood as the MAC address of each terminal device in P2P group 2 according to the GO role in P2P group 1 contained in the negotiation result address and IP address, respectively initiate a Wi-Fi P2P connection request to the GO in P2P group 1, so as to achieve the purpose of connecting with the GO in P2P group 1 respectively.
其中,本申请实施例并不限定S1005a和S1005b执行的先后顺序。Wherein, the embodiment of the present application does not limit the execution order of S1005a and S1005b.
基于如图10示出的内容包含第二终端设备和平板电脑,以下分别介绍第二终端设备 和平板电脑的拆链处理过程以及拆链处理之后的Wi-Fi P2P重连接过程。Based on the content shown in Figure 10 including the second terminal device and the tablet computer, the following describes the disconnection process of the second terminal device and the tablet computer and the Wi-Fi P2P reconnection process after the disconnection process.
第二终端设备的实现过程可以包括以下S1006a至S1010a。The implementation process of the second terminal device may include the following S1006a to S1010a.
S1006a、第二终端设备基于所述第二P2P组(P2P组2)的业务状态,保存第二P2P组(P2P组2)业务信息。其中,P2P组2业务信息可以包括但不限于:配对关系、业务传输状态等。其中,配对关系表示P2P组2中GO和GC角色的分配关系、以及与所述第二终端设备在所述P2P组2中建立了P2P连接的其他终端设备的MAC地址和IP地址等信息,以便于进行群组合并之后在新的P2P组中进行业务恢复。所述业务传输状态信息表示所述第二终端设备在所述P2P组2中处理的P2P业务的业务类型,业务传输进度、业务调用方包名以及业务平均传输速度等信息,以便于进行群组合并之后在新的P2P组,第二终端设备可以准确地进行业务恢复,可以恢复被拆链的P2P组2在拆链前的业务传输状态,从而可以保障原P2P业务的继续处理。S1006a. The second terminal device saves the service information of the second P2P group (P2P group 2) based on the service state of the second P2P group (P2P group 2). Wherein, the P2P group 2 service information may include but not limited to: pairing relationship, service transmission status, and the like. Wherein, the pairing relationship represents the allocation relationship of GO and GC roles in the P2P group 2, and information such as the MAC address and IP address of other terminal devices that have established a P2P connection with the second terminal device in the P2P group 2, so that Service recovery is performed in the new P2P group after group merging. The service transmission status information indicates the service type of the P2P service processed by the second terminal device in the P2P group 2, service transmission progress, service caller package name and service average transmission speed, etc., so as to facilitate group After the merger, in the new P2P group, the second terminal device can accurately restore the service, and can restore the service transmission status of the disconnected P2P group 2 before the disconnection, thereby ensuring the continuous processing of the original P2P service.
S1007a、第二终端设备与平板电脑进行P2P组拆链。示例性的,第二终端设备(GC)向平板电脑(GO)发起Wi-Fi P2P拆链请求(如P2P disconnect指令),以通知平板电脑对第二终端设备与平板电脑之间建立的Wi-Fi P2P连接进行销毁。S1007a, the second terminal device and the tablet computer perform P2P assembly and disassembly. Exemplarily, the second terminal device (GC) initiates a Wi-Fi P2P disconnection request (such as a P2P disconnect command) to the tablet computer (GO), to notify the tablet computer of the Wi-Fi connection established between the second terminal device and the tablet computer. Fi P2P connections are destroyed.
S1008a、第二终端设备向P2P组1中的GO发起建立Wi-Fi P2P连接请求。S1008a. The second terminal device initiates a Wi-Fi P2P connection establishment request to the GO in the P2P group 1.
S1009a、第二终端设备与第一终端设备之间的连接通过P2P组1中的GO中转的Wi-Fi P2P连接。示例性的,在第二终端设备与P2P组1中的GO建立了Wi-Fi P2P连接之后,则第二终端设备与第一终端设备此时均为同一个GO(智慧屏)的GC,可以实现在MAC层通过GO中转业务数据包且在应用层实现P2P业务处理。S1009a, the connection between the second terminal device and the first terminal device is through the Wi-Fi P2P connection relayed by GO in P2P group 1. Exemplarily, after the second terminal device establishes a Wi-Fi P2P connection with the GO in P2P group 1, the second terminal device and the first terminal device are both GCs of the same GO (smart screen) at this time, and can Realize the transfer of service data packets through GO at the MAC layer and realize P2P service processing at the application layer.
S1010a、第二终端设备根据所述P2P组2业务信息恢复原业务处理。示例性的,第二终端设备与P2P组1中的GO建立了Wi-Fi P2P连接之后,确定平板电脑也与GO建立了Wi-Fi P2P连接之后,根据所述P2P组2业务信息重新发起与平板电脑的P2P业务;例如,从P2P组2业务信息中获取到原P2P业务传输的最后一个字符,则第二终端设备从该最后一个字符的下一个字符重新开始进行发送或接收。S1010a. The second terminal device restores the original service processing according to the P2P group 2 service information. Exemplarily, after the second terminal device establishes a Wi-Fi P2P connection with the GO in P2P group 1, after determining that the tablet computer also establishes a Wi-Fi P2P connection with the GO, it re-initiates the communication with the GO according to the P2P group 2 service information. The P2P service of the tablet computer; for example, if the last character of the original P2P service transmission is obtained from the P2P group 2 service information, the second terminal device restarts sending or receiving from the character next to the last character.
需要说明的是,本申请不限定S1009a和S1010a之间的执行顺序,实施时也可以先执行S1010a再执行S1009a,或者还可以通过多个进程对S1010a和S1009a进行同步执行等。It should be noted that this application does not limit the execution sequence between S1009a and S1010a, and S1010a may be executed first and then S1009a may be executed during implementation, or S1010a and S1009a may be executed synchronously through multiple processes.
平板电脑的实现过程可以包括以下S1006b至S1010b。The implementation process of the tablet computer may include the following steps S1006b to S1010b.
S1006b、平板电脑保存P2P组2业务信息。其中,P2P组2业务信息可以参照前述S1006a中介绍的第二终端设备保存的P2P组2业务信息,在此不再赘述。S1006b. The tablet computer saves the P2P group 2 service information. Wherein, the P2P group 2 service information may refer to the P2P group 2 service information stored by the second terminal device introduced in the foregoing S1006a, which will not be repeated here.
S1007b、平板电脑与第二终端设备进行P2P组拆链。示例性的,平板电脑(GO)向第二终端设备(GC)发起Wi-Fi P2P拆链请求(如P2P disconnect指令),在接收到第二终端设备的确认消息之后,平板电脑执行P2P拆链处理。或者,平板电脑接收到第二终端设备发起的Wi-Fi P2P拆链请求,暂停当前所在P2P组2中正在进行的P2P业务,在保存P2P组2业务信息之后,对于第二终端设备之间的Wi-Fi P2P连接执行P2P拆链处理。S1007b. The tablet computer and the second terminal device perform P2P assembly and disassembly. Exemplarily, the tablet computer (GO) initiates a Wi-Fi P2P disconnection request (such as a P2P disconnect command) to the second terminal device (GC), and after receiving a confirmation message from the second terminal device, the tablet computer performs P2P disconnection deal with. Alternatively, the tablet computer receives the Wi-Fi P2P unlinking request initiated by the second terminal device, suspends the ongoing P2P business in the P2P group 2 where it is currently located, and after saving the P2P group 2 business information, for the second terminal device Wi-Fi P2P connection performs P2P disconnection processing.
S1008b、平板电脑与P2P组1中的GO建立Wi-Fi P2P连接。S1008b, the tablet computer establishes a Wi-Fi P2P connection with the GOs in the P2P group 1.
S1009b、平板电脑与第二终端设备之间的连接通过P2P组1中的GO中转的Wi-Fi P2P连接。S1009b, the connection between the tablet computer and the second terminal device is through the Wi-Fi P2P connection relayed by GO in the P2P group 1.
S1010b、平板电脑根据所述P2P组2业务信息恢复原业务处理。示例性的,平板电脑接收第二终端设备重新发起的P2P业务请求,并根据P2P组2业务信息对原P2P业务的传输数据进行接收或发送。S1010b. The tablet computer restores the original service processing according to the P2P group 2 service information. Exemplarily, the tablet computer receives the P2P service request re-initiated by the second terminal device, and receives or sends the transmission data of the original P2P service according to the P2P group 2 service information.
需要说明的是,本申请不限定S1009b和S1010b之间的执行顺序,实施时也可以先执行S1010b再执行S1009b,或者还可以通过多个进程对S1010b和S1009b进行同步执行等。It should be noted that the present application does not limit the execution sequence between S1009b and S1010b. During implementation, S1010b may be executed first and then S1009b, or S1010b and S1009b may be executed synchronously through multiple processes.
通过本申请提供的Wi-Fi直连通信方法,当存在归属于不同P2P组的第一终端设备与第二终端设备之间需要建立Wi-Fi P2P连接的场景时,采用对多个不同的P2P组进行群组合并的实现方式,具体可以实施为通过第一终端设备与第二终端设备群组合并的协商处理,对其中一个P2P组进行拆链处理之后,作为另一P2P组的GC连接到该另一P2P组的GO上,从而得到包含原多个不同P2P组的终端设备的新P2P组,进而通过该新P2P组可以建立对原多个不同P2P组之间的终端设备之间的Wi-Fi直连通信。Through the Wi-Fi direct communication method provided by this application, when there is a scenario where a Wi-Fi P2P connection needs to be established between the first terminal device and the second terminal device belonging to different P2P groups, multiple different P2P The implementation of group merging of groups can be specifically implemented as the negotiation process of group merging between the first terminal device and the second terminal device. After one of the P2P groups is disconnected, the GC of the other P2P group is connected to the On the GO of this other P2P group, thereby obtain the new P2P group that contains the terminal equipment of original multiple different P2P groups, and then through this new P2P group, can establish Wi-Fi between the original multiple different P2P groups. -Fi direct communication.
基于相同的技术构思,图16所示为本申请实施例提供的一种终端设备1600。该终端设备1600可以为上述方法实施例中的第二终端设备,或第一终端设备。该终端设备1600包括一个或多个处理器1601;一个或多个存储器1602;通信接口1603,以及一个或多个计算机程序1604,上述各器件可以通过一个或多个通信总线1605连接。通信接口1603用于实现与其他设备(比如若终端设备1600为第一终端设备,其他设备可以为第二终端设备)的通信,比如通信接口可以是收发器。其中该一个或多个计算机程序1604被存储在上述存储器1602中并被配置为被该一个或多个处理器1601执行,该一个或多个计算机程序1604包括指令,上述指令可以用于执行如下步骤,包括:Based on the same technical concept, FIG. 16 shows a terminal device 1600 provided in the embodiment of the present application. The terminal device 1600 may be the second terminal device in the foregoing method embodiments, or the first terminal device. The terminal device 1600 includes one or more processors 1601 ; one or more memories 1602 ; a communication interface 1603 , and one or more computer programs 1604 , and the above components can be connected through one or more communication buses 1605 . The communication interface 1603 is used to implement communication with other devices (for example, if the terminal device 1600 is a first terminal device, the other device may be a second terminal device), for example, the communication interface may be a transceiver. Wherein the one or more computer programs 1604 are stored in the memory 1602 and are configured to be executed by the one or more processors 1601, the one or more computer programs 1604 include instructions, and the above instructions can be used to perform the following steps ,include:
第二终端设备接收第一终端设备发起的建立Wi-Fi P2P连接请求,或者所述第二终端设备向所述第一终端设备发起建立Wi-Fi P2P连接请求,所述第二终端设备归属于第二点对点P2P组,所述第一终端设备归属于第一P2P组;所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,得到协商结果,所述协商结果用于指示将所述第二P2P组和所述第一P2P组合并为第三P2P组;所述第二终端设备在所述第三P2P组中建立与所述第一终端设备的Wi-Fi P2P连接。The second terminal device receives a request for establishing a Wi-Fi P2P connection initiated by the first terminal device, or the second terminal device initiates a request for establishing a Wi-Fi P2P connection to the first terminal device, and the second terminal device belongs to In the second point-to-point P2P group, the first terminal device belongs to the first P2P group; the second terminal device negotiates with the first terminal device to combine P2P groups, and obtains a negotiation result, and the negotiation result is used for Instructing to merge the second P2P group and the first P2P group into a third P2P group; the second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group .
在一种可能的设计中,所述第二终端设备与所述第一终端设备进行P2P群组合并的协商之前,所述第二终端设备向所述第一终端设备发送第二P2P状态信息,所述第二P2P状态信息用于指示所述第二P2P组;以及所述第二终端设备接收所述第一终端设备发送的第一P2P状态信息,所述第一P2P状态信息用于指示所述第一P2P组。所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,包括:所述第二终端设备基于所述第二P2P状态信息和所述第一P2P状态信息,与所述第一终端设备进行P2P群组合并的协商。In a possible design, before the second terminal device negotiates with the first terminal device on P2P group merging, the second terminal device sends second P2P status information to the first terminal device, The second P2P state information is used to indicate the second P2P group; and the second terminal device receives the first P2P state information sent by the first terminal device, the first P2P state information is used to indicate the Describe the first P2P group. The negotiation of P2P group merging between the second terminal device and the first terminal device includes: the second terminal device, based on the second P2P status information and the first P2P status information, negotiates with the first P2P status information A terminal device performs negotiation on P2P group merging.
在一种可能的设计中,所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,包括:所述第二终端设备确定第二P2P组中的第二组拥有者GO角色和第一P2P组中的第一GO角色;所述第二终端设备基于预设的合并规则,确定所述第二GO或所述第一GO为所述第三P2P组中的第三GO;所述第二终端设备根据所述第三GO输出协商结果;其中,若确定所述第二GO为所述第三GO,则所述协商结果为将所述第一P2P组合并到所述第二P2P组中;若确定所述第一GO为所述第三GO,则所述协商结果为将所述第二P2P组合并到所述第一P2P组中。In a possible design, the negotiation between the second terminal device and the first terminal device on P2P group merging includes: determining, by the second terminal device, the second group owner GO in the second P2P group role and the role of the first GO in the first P2P group; the second terminal device determines that the second GO or the first GO is the third GO in the third P2P group based on a preset merging rule ; The second terminal device outputs a negotiation result according to the third GO; wherein, if it is determined that the second GO is the third GO, the negotiation result is to merge the first P2P group into the In the second P2P group; if it is determined that the first GO is the third GO, the negotiation result is to merge the second P2P group into the first P2P group.
在一种可能的设计中,若所述协商结果为所述将所述第二P2P组合并到所述第一P2P组中,所述第二终端设备基于所述第二P2P组的业务状态,保存第二P2P组业务信息;所述第二终端设备与所述第二GO进行P2P组拆链,所述P2P组拆链用于断开所述第二终端设备与所述第二GO的Wi-Fi P2P连接;所述第二终端设备向所述第三GO发起建立Wi-Fi P2P连接请求;所述第二终端设备接收来自所述第三GO的确认消息,所述确认消息用于 指示所述第三GO同意所述第二终端设备加入所述第三P2P组中。In a possible design, if the negotiation result is the merging of the second P2P group into the first P2P group, the second terminal device, based on the service state of the second P2P group, Save the second P2P group service information; the second terminal device and the second GO perform P2P group disassembly, and the P2P group disassembly is used to disconnect the Wi-Fi connection between the second terminal device and the second GO -Fi P2P connection; the second terminal device initiates a Wi-Fi P2P connection request to the third GO; the second terminal device receives a confirmation message from the third GO, and the confirmation message is used to indicate The third GO allows the second terminal device to join the third P2P group.
在一种可能的设计中,所述第二终端设备在所述第三P2P组中根据所述第二P2P组业务信息,恢复所述第二终端设备在所述第二P2P组的业务状态。In a possible design, the second terminal device restores the service state of the second terminal device in the second P2P group according to the service information of the second P2P group in the third P2P group.
在一种可能的设计中,所述第二终端设备将所述协商结果发送给所述第二P2P组中的至少一个其他终端设备,以使各所述其他终端设备从所述第二P2P组中拆链之后,分别与所述第三GO建立Wi-Fi P2P连接。In a possible design, the second terminal device sends the negotiation result to at least one other terminal device in the second P2P group, so that each of the other terminal devices from the second P2P group After disconnecting the chain, establish a Wi-Fi P2P connection with the third GO respectively.
在一种可能的设计中,所述预设的合并规则包括以下规则中的一种或多种:包含终端设备数量少的P2P组合并到包含终端设备数量多的P2P组中;业务优先级低的P2P组合并到业务优先级高的P2P组中;信道带宽小的P2P组合并到信道带宽大的P2P组中;业务量少的P2P组合并到业务量大的P2P组中;GO性能弱的P2P组合并到GO性能强的P2P组中;Wi-Fi P2P连接请求发起方的P2P组合并到被发起方的P2P组中。In a possible design, the preset merging rules include one or more of the following rules: the P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices; the service priority is low P2P groups with high service priority are merged into P2P groups with high service priority; P2P groups with small channel bandwidth are merged into P2P groups with large channel bandwidth; P2P groups with low traffic volume are merged into P2P groups with large traffic volume; The P2P group is merged into the P2P group with strong GO performance; the P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
在一种可能的设计中,所述第二终端设备在所述第三P2P组中建立与所述第一终端设备的Wi-Fi P2P连接,包括:若所述第二终端设备和所述第一终端设备为所述第三P2P组中的组内客户端GC角色,所述第二终端设备和所述第一终端设备通过所述第三P2P组中的GO角色建立Wi-Fi P2P连接。In a possible design, the second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group, including: if the second terminal device and the first terminal device A terminal device is a client GC role in the third P2P group, and the second terminal device and the first terminal device establish a Wi-Fi P2P connection through the GO role in the third P2P group.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each embodiment of the embodiment of the present application may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the 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 computer-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 computer software product is stored in a storage The medium includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and other various media capable of storing program codes.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above is only the specific implementation of the embodiment of the application, but the protection scope of the embodiment of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the application shall be covered by this application. Within the scope of protection of the application examples. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.

Claims (19)

  1. 一种无线保真Wi-Fi直连通信方法,其特征在于,所述方法包括:A wireless fidelity Wi-Fi direct communication method, characterized in that the method comprises:
    第二终端设备接收第一终端设备发起的建立Wi-Fi P2P连接请求,或者所述第二终端设备向所述第一终端设备发起建立Wi-Fi P2P连接请求,所述第二终端设备归属于第二点对点P2P组,所述第一终端设备归属于第一P2P组;The second terminal device receives a request for establishing a Wi-Fi P2P connection initiated by the first terminal device, or the second terminal device initiates a request for establishing a Wi-Fi P2P connection to the first terminal device, and the second terminal device belongs to a second point-to-point P2P group, the first terminal device belongs to the first P2P group;
    所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,得到协商结果,所述协商结果用于指示将所述第二P2P组和所述第一P2P组合并为第三P2P组;The second terminal device negotiates with the first terminal device on P2P group merging, and obtains a negotiation result, and the negotiation result is used to indicate that the second P2P group and the first P2P group are merged into a third P2P group. P2P group;
    所述第二终端设备在所述第三P2P组中建立与所述第一终端设备的Wi-Fi P2P连接。The second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group.
  2. 根据权利要求1所述的方法,其特征在于,所述第二终端设备与所述第一终端设备进行P2P群组合并的协商之前,所述方法还包括:The method according to claim 1, characterized in that before the second terminal device and the first terminal device perform the negotiation of P2P group merging, the method further comprises:
    所述第二终端设备向所述第一终端设备发送第二P2P状态信息,所述第二P2P状态信息用于指示所述第二P2P组;以及The second terminal device sends second P2P status information to the first terminal device, where the second P2P status information is used to indicate the second P2P group; and
    所述第二终端设备接收所述第一终端设备发送的第一P2P状态信息,所述第一P2P状态信息用于指示所述第一P2P组;The second terminal device receives first P2P status information sent by the first terminal device, where the first P2P status information is used to indicate the first P2P group;
    所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,包括:The negotiation of P2P group merging between the second terminal device and the first terminal device includes:
    所述第二终端设备基于所述第二P2P状态信息和所述第一P2P状态信息,与所述第一终端设备进行P2P群组合并的协商。The second terminal device performs a P2P group merger negotiation with the first terminal device based on the second P2P state information and the first P2P state information.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第二终端设备与所述第一终端设备进行P2P群组合并的协商,包括:The method according to claim 1 or 2, wherein the negotiation of P2P group merging between the second terminal device and the first terminal device includes:
    所述第二终端设备确定第二P2P组中的第二组拥有者GO角色和第一P2P组中的第一GO角色;The second terminal device determines a second group owner GO role in the second P2P group and a first GO role in the first P2P group;
    所述第二终端设备基于预设的合并规则,确定所述第二GO或所述第一GO为所述第三P2P组中的第三GO;The second terminal device determines that the second GO or the first GO is the third GO in the third P2P group based on a preset merging rule;
    所述第二终端设备根据所述第三GO输出协商结果;其中,若确定所述第二GO为所述第三GO,则所述协商结果为将所述第一P2P组合并到所述第二P2P组中;若确定所述第一GO为所述第三GO,则所述协商结果为将所述第二P2P组合并到所述第一P2P组中。The second terminal device outputs a negotiation result according to the third GO; wherein, if it is determined that the second GO is the third GO, the negotiation result is to merge the first P2P group into the third GO In the second P2P group; if it is determined that the first GO is the third GO, the negotiation result is to merge the second P2P group into the first P2P group.
  4. 根据权利要求3所述的方法,其特征在于,若所述协商结果为所述将所述第二P2P组合并到所述第一P2P组中,所述方法还包括:The method according to claim 3, wherein if the negotiation result is the merging of the second P2P group into the first P2P group, the method further comprises:
    所述第二终端设备基于所述第二P2P组的业务状态,保存第二P2P组业务信息;The second terminal device saves the service information of the second P2P group based on the service state of the second P2P group;
    所述第二终端设备与所述第二GO进行P2P组拆链,所述P2P组拆链用于断开所述第二终端设备与所述第二GO的Wi-Fi P2P连接;The second terminal device and the second GO perform a P2P disassembly chain, and the P2P disassembly chain is used to disconnect the Wi-Fi P2P connection between the second terminal device and the second GO;
    所述第二终端设备向所述第三GO发起建立Wi-Fi P2P连接请求;The second terminal device initiates a Wi-Fi P2P connection request to the third GO;
    所述第二终端设备接收来自所述第三GO的确认消息,所述确认消息用于指示所述第三GO同意所述第二终端设备加入所述第三P2P组中。The second terminal device receives a confirmation message from the third GO, where the confirmation message is used to indicate that the third GO agrees that the second terminal device joins the third P2P group.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, characterized in that the method further comprises:
    所述第二终端设备在所述第三P2P组中根据所述第二P2P组业务信息,恢复所述第二终端设备在所述第二P2P组的业务状态。The second terminal device recovers the service status of the second terminal device in the second P2P group according to the service information of the second P2P group in the third P2P group.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    所述第二终端设备将所述协商结果发送给所述第二P2P组中的至少一个其他终端设备, 以使各所述其他终端设备从所述第二P2P组中拆链之后,分别与所述第三GO建立Wi-FiP2P连接。The second terminal device sends the negotiation result to at least one other terminal device in the second P2P group, so that each of the other terminal devices disconnects from the second P2P group, respectively, with the The third GO establishes a Wi-Fi P2P connection.
  7. 根据权利要求3至6中任一项所述的方法,其特征在于,所述预设的合并规则包括以下规则中的一种或多种:The method according to any one of claims 3 to 6, wherein the preset merging rules include one or more of the following rules:
    包含终端设备数量少的P2P组合并到包含终端设备数量多的P2P组中;The P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices;
    业务优先级低的P2P组合并到业务优先级高的P2P组中;The P2P group with low business priority is merged into the P2P group with high business priority;
    信道带宽小的P2P组合并到信道带宽大的P2P组中;The P2P group with small channel bandwidth is merged into the P2P group with large channel bandwidth;
    业务量少的P2P组合并到业务量大的P2P组中;The P2P group with less business volume is merged into the P2P group with large business volume;
    GO性能弱的P2P组合并到GO性能强的P2P组中;The P2P group with weak GO performance is merged into the P2P group with strong GO performance;
    Wi-Fi P2P连接请求发起方的P2P组合并到被发起方的P2P组中。The P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述第二终端设备在所述第三P2P组中建立与所述第一终端设备的Wi-Fi P2P连接,包括:The method according to any one of claims 1 to 7, wherein the second terminal device establishes a Wi-Fi P2P connection with the first terminal device in the third P2P group, comprising:
    若所述第二终端设备和所述第一终端设备为所述第三P2P组中的组内客户端GC角色,所述第二终端设备和所述第一终端设备通过所述第三P2P组中的GO角色建立Wi-Fi P2P连接。If the second terminal device and the first terminal device are client GC roles in the third P2P group, the second terminal device and the first terminal device pass through the third P2P group The GO role in establishes a Wi-Fi P2P connection.
  9. 一种Wi-Fi直连通信系统,其特征在于,包括第一P2P组和第二P2P组,所述第一P2P组包括第一拥有者GO和第一终端设备,所述第二P2P组包括第二GO和第二终端设备,所述第一终端设备为所述第一P2P组的第一组内客户端GC,所述第二终端设备为所述第二P2P组的第二GC;其中,A Wi-Fi direct communication system, characterized in that it includes a first P2P group and a second P2P group, the first P2P group includes a first owner GO and a first terminal device, and the second P2P group includes A second GO and a second terminal device, the first terminal device is the client GC in the first group of the first P2P group, and the second terminal device is the second GC of the second P2P group; wherein ,
    所述第一终端设备向所述第二终端设备发起建立Wi-Fi P2P连接请求,或者所述第二终端设备向所述第一终端设备发起建立Wi-Fi P2P连接请求;The first terminal device initiates a request to establish a Wi-Fi P2P connection to the second terminal device, or the second terminal device initiates a request to establish a Wi-Fi P2P connection to the first terminal device;
    所述第一终端设备与所述第二终端设备进行P2P群组合并的协商,得到协商结果,所述协商结果用于指示将所述第二P2P组和所述第一P2P组合并为第三P2P组;The first terminal device negotiates with the second terminal device on P2P group merging, and obtains a negotiation result, where the negotiation result is used to indicate that the second P2P group and the first P2P group are merged into a third P2P group. P2P group;
    基于所述协商结果,所述第一P2P组和所述第二P2P组成所述第三P2P组;Based on the negotiation result, the first P2P group and the second P2P form the third P2P group;
    所述第一终端设备和所述第二终端设备在所述第三P2P组中建立Wi-Fi P2P连接。The first terminal device and the second terminal device establish a Wi-Fi P2P connection in the third P2P group.
  10. 根据权利要求9所述的系统,其特征在于,所述第一终端设备与所述第二终端设备进行P2P群组合并的协商之前,The system according to claim 9, wherein, before the first terminal device and the second terminal device perform the negotiation of P2P group merging,
    所述第一终端设备向所述第二终端设备发送第一P2P状态信息,或者所述第二终端设备向所述第一终端设备发送第二P2P状态信息;所述第一P2P状态信息用于指示所述第一P2P组,所述第二P2P状态信息用于指示所述第二P2P组;The first terminal device sends first P2P state information to the second terminal device, or the second terminal device sends second P2P state information to the first terminal device; the first P2P state information is used for Indicate the first P2P group, and the second P2P state information is used to indicate the second P2P group;
    所述第一终端设备与所述第二终端设备进行P2P群组合并的协商,包括:基于所述第二P2P状态信息和所述第一P2P状态信息,确定协商结果。The negotiation of P2P group merging between the first terminal device and the second terminal device includes: determining a negotiation result based on the second P2P state information and the first P2P state information.
  11. 根据权利要求9或10所述的系统,其特征在于,所述第一终端设备与所述第二终端设备进行P2P群组合并的协商,包括:The system according to claim 9 or 10, wherein the negotiation of P2P group merging between the first terminal device and the second terminal device includes:
    基于预设的合并规则,确定所述第二GO或所述第一GO为所述第三P2P组中的第三GO;determining that the second GO or the first GO is a third GO in the third P2P group based on a preset merging rule;
    根据所述第三GO输出协商结果;其中,若确定所述第二GO为所述第三GO,则所述协商结果为将所述第一P2P组合并到所述第二P2P组中;若确定所述第一GO为所述第三GO,则所述协商结果为将所述第二P2P组合并到所述第一P2P组中。Outputting a negotiation result according to the third GO; wherein, if it is determined that the second GO is the third GO, the negotiation result is to merge the first P2P group into the second P2P group; if If it is determined that the first GO is the third GO, then the negotiation result is to merge the second P2P group into the first P2P group.
  12. 根据权利要求11所述的系统,其特征在于,若所述协商结果为所述将所述第二P2P 组合并到所述第一P2P组中,所述第二终端设备基于所述第二P2P组的业务状态,保存第二P2P组业务信息;The system according to claim 11, wherein if the negotiation result is the merging of the second P2P group into the first P2P group, the second terminal device based on the second P2P The business status of the group, saving the business information of the second P2P group;
    所述第二终端设备与所述第二GO进行P2P组拆链,所述P2P组拆链用于断开所述第二终端设备与所述第二GO的Wi-Fi P2P连接;The second terminal device and the second GO perform a P2P disassembly chain, and the P2P disassembly chain is used to disconnect the Wi-Fi P2P connection between the second terminal device and the second GO;
    所述第二终端设备向所述第三GO发起建立Wi-Fi P2P连接请求;及所述第二GO向所述第三GO发起建立Wi-Fi P2P连接请求;The second terminal device initiates a request to establish a Wi-Fi P2P connection to the third GO; and the second GO initiates a request to establish a Wi-Fi P2P connection to the third GO;
    所述第二终端设备接收来自所述第三GO的确认消息,所述确认消息用于指示所述第三GO同意所述第二终端设备加入所述第三P2P组中;及所述第二GO接收来自所述第三GO的确认消息,所述确认消息用于指示所述第三GO同意所述第二GO加入所述第三P2P组中;所述第二GO为所述第三P2P组中的GC。The second terminal device receives a confirmation message from the third GO, where the confirmation message is used to indicate that the third GO agrees that the second terminal device joins the third P2P group; and the second The GO receives a confirmation message from the third GO, the confirmation message is used to indicate that the third GO agrees that the second GO joins the third P2P group; the second GO is the third P2P group GC in the group.
  13. 根据权利要求12所述的系统,其特征在于,所述第二终端设备在所述第三P2P组中根据所述第二P2P组业务信息,恢复所述第二终端设备与所述第二GO在所述第二P2P组的业务状态。The system according to claim 12, wherein the second terminal device restores the connection between the second terminal device and the second GO in the third P2P group according to the service information of the second P2P group. The service status of the second P2P group.
  14. 根据权利要求9至13中任一项所述的系统,其特征在于,所述第二终端设备将所述协商结果发送给所述第二P2P组中的至少一个其他终端设备;以及,The system according to any one of claims 9 to 13, wherein the second terminal device sends the negotiation result to at least one other terminal device in the second P2P group; and,
    所述第一终端设备将所述协商结果发送给所述第一P2P组中的至少一个其他终端设备。The first terminal device sends the negotiation result to at least one other terminal device in the first P2P group.
  15. 根据权利要求11至14中任一项所述的系统,其特征在于,所述预设的合并规则包括以下规则中的一种或多种:The system according to any one of claims 11 to 14, wherein the preset merging rules include one or more of the following rules:
    包含终端设备数量少的P2P组合并到包含终端设备数量多的P2P组中;The P2P group containing a small number of terminal devices is merged into the P2P group containing a large number of terminal devices;
    业务优先级低的P2P组合并到业务优先级高的P2P组中;The P2P group with low business priority is merged into the P2P group with high business priority;
    信道带宽小的P2P组合并到信道带宽大的P2P组中;The P2P group with small channel bandwidth is merged into the P2P group with large channel bandwidth;
    业务量少的P2P组合并到业务量大的P2P组中;The P2P group with less business volume is merged into the P2P group with large business volume;
    GO性能弱的P2P组合并到GO性能强的P2P组中;The P2P group with weak GO performance is merged into the P2P group with strong GO performance;
    Wi-Fi P2P连接请求发起方的P2P组合并到被发起方的P2P组中。The P2P group of the initiator of the Wi-Fi P2P connection request is merged into the P2P group of the initiated party.
  16. 根据权利要求9至15中任一项所述的系统,其特征在于,所述第一终端设备和所述第二终端设备在所述第三P2P组中建立Wi-Fi P2P连接,包括:The system according to any one of claims 9 to 15, wherein the first terminal device and the second terminal device establish a Wi-Fi P2P connection in the third P2P group, comprising:
    所述第一终端设备和所述第二终端设备通过所述第三P2P组中的GO角色建立Wi-FiP2P连接。The first terminal device and the second terminal device establish a Wi-Fi P2P connection through the GO role in the third P2P group.
  17. 一种终端设备,其特征在于,包括:一个或多个处理器;一个或多个存储器;A terminal device, characterized by comprising: one or more processors; one or more memories;
    所述一个或多个存储器,用于存储一个或多个计算机程序以及数据信息;其中所述一个或多个计算机程序包括指令;The one or more memories are used to store one or more computer programs and data information; wherein the one or more computer programs include instructions;
    当所述指令被所述一个或多个处理器执行时,使得所述终端设备执行如权利要求1至8中任一项所述的方法。When the instructions are executed by the one or more processors, the terminal device is made to execute the method according to any one of claims 1-8.
  18. 一种计算机可读存储介质,其特征在于,包括计算机程序或指令,当所述计算机程序或指令在计算机上运行时,使得如权利要求1至8中任一项所述的方法被执行。A computer-readable storage medium, characterized by comprising a computer program or instruction, when the computer program or instruction is run on a computer, the method according to any one of claims 1 to 8 is executed.
  19. 一种计算机程序产品,其特征在于,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如上述权利要求1至8中任一项所述的方法。A computer program product, characterized in that it includes a computer program, and when the computer program is run on a computer, the computer is made to execute the method according to any one of claims 1 to 8.
PCT/CN2022/111118 2021-09-10 2022-08-09 Wi-fi direct communication method and apparatus WO2023035834A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111063130.6 2021-09-10
CN202111063130.6A CN115802516A (en) 2021-09-10 2021-09-10 Wi-Fi direct communication method and device

Publications (1)

Publication Number Publication Date
WO2023035834A1 true WO2023035834A1 (en) 2023-03-16

Family

ID=85417154

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/111118 WO2023035834A1 (en) 2021-09-10 2022-08-09 Wi-fi direct communication method and apparatus

Country Status (2)

Country Link
CN (1) CN115802516A (en)
WO (1) WO2023035834A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114727429B (en) * 2022-03-22 2023-11-14 中国电信股份有限公司 Communication method, communication group, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889722A (en) * 2006-07-20 2007-01-03 华为技术有限公司 PoC group session realizing method and apparatus
CN104429155A (en) * 2012-07-16 2015-03-18 三星电子株式会社 Method and apparatus for handling topology in wireless communication system
US20150264123A1 (en) * 2014-03-14 2015-09-17 Blackberry Limited Changing topology of wireless peer-to-peer group
US20190014172A1 (en) * 2015-09-03 2019-01-10 Nec Corporation Group formation control in multi-group peer-to-peer network
WO2019196253A1 (en) * 2018-04-12 2019-10-17 华为技术有限公司 Networking method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889722A (en) * 2006-07-20 2007-01-03 华为技术有限公司 PoC group session realizing method and apparatus
CN104429155A (en) * 2012-07-16 2015-03-18 三星电子株式会社 Method and apparatus for handling topology in wireless communication system
US20150264123A1 (en) * 2014-03-14 2015-09-17 Blackberry Limited Changing topology of wireless peer-to-peer group
US20190014172A1 (en) * 2015-09-03 2019-01-10 Nec Corporation Group formation control in multi-group peer-to-peer network
WO2019196253A1 (en) * 2018-04-12 2019-10-17 华为技术有限公司 Networking method and device

Also Published As

Publication number Publication date
CN115802516A (en) 2023-03-14

Similar Documents

Publication Publication Date Title
JP5607067B2 (en) Wireless access point that supports control by multiple applications
US11172530B2 (en) Communication establishment method and terminal
CN111049935B (en) System for remotely controlling electronic equipment and electronic equipment thereof
JP2013176045A (en) Method and apparatus for searching for peer-to-peer device in wireless communication network, and device communication method
WO2021121052A1 (en) Multi-screen cooperation method and system, and electronic device
CN108684206B (en) Searching method and device
WO2024016559A1 (en) Multi-device cooperation method, electronic device and related product
CN115396521A (en) Method, device and system for switching communication protocol
CN111294884A (en) Communication terminal supporting dual-card dual-standby single-pass and data service switching method
CN108605373B (en) Method and electronic device for providing network sharing service
WO2023035834A1 (en) Wi-fi direct communication method and apparatus
CN114442969A (en) Inter-device screen cooperation method and device
CN114666864A (en) Multi-network communication method, terminal device, storage medium, and program product
CN114741008B (en) Distributed cross-device cooperation method, electronic device and communication system
KR20160124518A (en) Method and apparatus for supporting communication of electronic device
CN114666395B (en) Dual-system network sharing method and device
KR20210050398A (en) Electronic device for trnasmitting data to external electronic device not connected to the electronic device and method for the same
WO2022218131A1 (en) Data transmission method and system, electronic device, and storage medium
CN115623057A (en) RDMA (remote direct memory Access) -based connection establishing method, device, equipment and storage medium
CN114995732A (en) Screen projection method, electronic equipment and storage medium
CN115883506A (en) Method, device, electronic equipment and storage medium for realizing group management
CN117135767B (en) Method for connecting devices and electronic device
WO2024066992A1 (en) Multi-device networking system and method, and terminal devices
WO2024046173A1 (en) Antenna multiplexing method and related apparatus
WO2024007998A1 (en) Data transmission method, and electronic device and communication system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22866308

Country of ref document: EP

Kind code of ref document: A1