A dual P2P communication implementation method, device and system
By creating unoccupied dual P2P links, the problem that existing P2P links cannot simultaneously meet multiple application scenarios is solved, enabling simultaneous communication between different applications on the same device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN THUNDER SOFTWARE TECH CO LTD
- Filing Date
- 2022-10-31
- Publication Date
- 2026-06-02
AI Technical Summary
Existing P2P communication technologies cannot meet the needs of special scenarios when establishing P2P links, such as transferring files when projecting or sharing files over a network. In such cases, it is necessary to disconnect the established P2P link in order to establish a new link.
By identifying unoccupied P2P links and obtaining the corresponding link parameters, dual P2P links can be created to support simultaneous communication, avoid link interference, and meet the needs of various application scenarios.
It enables different applications to communicate simultaneously using a P2P link on the same device, meeting the needs of special scenarios, such as transferring files during screen mirroring and network sharing.
Smart Images

Figure CN115733843B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus and system for implementing dual P2P communication. Background Technology
[0002] A peer-to-peer (P2P) network is a network structure built between multiple STA (Station) devices. The P2P protocol is a transmission protocol at the Media Access Control (MAC) layer, primarily used for scenarios such as screen mirroring, file transfer, and network sharing. In a P2P network environment, all STA devices are divided into two roles: Group Owner (GO) and Group Client (GC). In a P2P network, one STA device acts as the GO, and multiple STA devices act as GCs. The GO and GC can share resources and services by transmitting information. These resources and services typically include: information sharing and exchange, computing resource sharing (such as CPU computing power sharing), storage sharing (such as cache and disk space usage), network sharing, and printer sharing.
[0003] Currently, when establishing a new P2P link, the existing P2P link must be disconnected first. Therefore, it cannot meet the needs of some special scenarios, such as transferring files when casting or sharing files on the network. Existing P2P solutions cannot meet these needs. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a dual P2P communication implementation method, apparatus and system that overcomes or at least partially solves the above problems.
[0005] This invention provides a method for implementing dual P2P communication, including:
[0006] In response to the application's P2P link invocation request, determine the unoccupied link in the first P2P link and the second P2P link;
[0007] Obtain the link parameters corresponding to the unoccupied links in the first and second P2P links;
[0008] A P2P link for this communication is created based on the link parameters.
[0009] In some optional embodiments, the response to the application's P2P link invocation request includes:
[0010] After the application starts, the WiFiP2P management interface is invoked to use the P2P link as the communication link for the application.
[0011] In some optional embodiments, creating the P2P link for this communication based on the link parameters includes:
[0012] The WiFi P2P service implementation class sequentially calls the P2P node creation interface of the current communication P2P link in the application framework layer and the P2P node creation interface in the middle layer, and passes the P2P node creation request to the driver layer. The driver layer creates the P2P node of the current communication P2P link based on the P2P node creation request and the obtained link parameters, and establishes the P2P link between the P2P node and the P2P peer. After the P2P link is successfully created, the identification information and link parameters of the created P2P link are returned to the upper layer application so that the upper layer application can use the created P2P link for communication.
[0013] In some optional embodiments, determining the unoccupied link in the first P2P link and the second P2P link includes:
[0014] Based on the occupancy status of the first P2P node and the second P2P node, determine whether the first P2P link and the second P2P link are occupied, and determine the unoccupied link in the first P2P link and the second P2P link based on the determination result.
[0015] The occupancy status of the first P2P node and the second P2P node is determined based on whether the first P2P node and the second P2P node have been assigned IP addresses.
[0016] In some optional embodiments, before determining the unoccupied link in the first P2P link and the second P2P link, the method further includes:
[0017] The system checks whether the integrated circuit chip supports establishing dual P2P links. If so, it then determines which link in the first and second P2P links is not currently in use.
[0018] In some optional embodiments, after establishing the P2P link for this communication, the process further includes:
[0019] Initiate the P2P peer device discovery process to discover peer devices;
[0020] Use the created P2P link to establish a communication connection with the discovered P2P peer device.
[0021] This invention provides a dual P2P communication implementation device, comprising:
[0022] The response module is used to respond to P2P link invocation requests and determine the unoccupied links in the first and second P2P links.
[0023] The link establishment module is used to obtain the link parameters corresponding to the unoccupied links in the first P2P link and the second P2P link; and to create the P2P link for this communication based on the link parameters.
[0024] This invention provides a dual P2P communication implementation system, including: a communication device and a peer device;
[0025] The communication device is equipped with the aforementioned dual P2P communication implementation device;
[0026] The communication device is used to communicate with the peer device using a first P2P link or a second P2P link after the application is started.
[0027] This invention provides a computer storage medium storing computer-executable instructions, which, when executed by a processor, implement the aforementioned dual P2P communication method.
[0028] This invention provides a communication device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described dual P2P communication method.
[0029] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0030] The method described in this embodiment of the invention determines the P2P link to be created and the link parameters to be obtained based on the occupancy status of the P2P link when an application calls the P2P link. It selects an unoccupied link from the first and second P2P links, obtains the link parameters corresponding to the unoccupied link, and creates the P2P link for this communication based on the obtained link parameters. This method supports the simultaneous existence of two P2P links for communication without interference between them. This allows different applications to use different P2P links for simultaneous communication, avoiding the situation where one application needs to use a P2P link while another application has to disconnect. This can meet the needs of some special scenarios and supports two application scenarios on one device to use P2P connections simultaneously.
[0031] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0032] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0033] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0034] Figure 1 This is a flowchart of the dual P2P communication implementation method in Embodiment 1 of the present invention;
[0035] Figure 2 This is a flowchart of the dual P2P communication implementation method in Embodiment 2 of the present invention;
[0036] Figure 3 This is a schematic diagram of the principle architecture of the device supporting dual P2P links in Embodiment 2 of the present invention;
[0037] Figure 4 This is a flowchart illustrating the scanning and connection of P2P peer devices in Embodiment 2 of the present invention;
[0038] Figure 5 This is a schematic diagram of the dual P2P communication implementation device in an embodiment of the present invention;
[0039] Figure 6 This is a schematic diagram of the dual P2P communication implementation system in an embodiment of the present invention. Detailed Implementation
[0040] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0041] Currently, connecting to a large screen via P2P and transferring files via P2P are basic and common functions of mobile terminals. However, current technology cannot support the simultaneous use of both scenarios. The current situation is that if another P2P link needs to be used during P2P usage, the previously established P2P link must be disconnected first. The dual P2P technology provided in this application aims to solve this problem, namely, to solve the problem of two applications communicating via P2P at the same time. The dual P2P communication implementation method provided in this embodiment of the invention can support the establishment of two P2P links and communication at the same time.
[0042] Example 1
[0043] Embodiment 1 of the present invention provides a method for implementing dual P2P communication, the process of which is as follows: Figure 1 As shown, it includes the following steps:
[0044] Step S101: In response to the application's P2P link call request, determine the unoccupied link in the first P2P link and the second P2P link.
[0045] After the application starts, it calls the WiFiP2P management interface to invoke a P2P link as the communication link for the upper-layer application. In response to the application's P2P link invocation request, the WiFiP2P management interface determines whether a P2P link has already been established and is in use. This determines whether to obtain the first link parameters of the first P2P link as input to establish the P2P link, or obtain the second link parameters of the second P2P link as input. After determining whether to establish the first or second P2P link, the WiFiP2P service implementation class calls the corresponding interface at the lower layer to complete the establishment of the P2P link.
[0046] In this step, the occupancy status of the first P2P node and the second P2P node can be used to determine whether the first P2P link and the second P2P link are occupied. Based on the determination result, the unoccupied link in the first P2P link and the second P2P link can be identified. The occupancy status of the first P2P node and the second P2P node is determined based on whether the first P2P node and the second P2P node have been assigned IP addresses.
[0047] Step S102: Obtain the link parameters corresponding to the unoccupied links in the first P2P link and the second P2P link.
[0048] If the first P2P link is not occupied, obtain the first link parameters and create the first P2P link based on the first link parameters. If the second P2P link is not occupied, obtain the second link parameters and create the second P2P link based on the second link parameters. If both links are not occupied, you can set priority to obtain the first link parameters, priority to obtain the second link parameters, or obtain both link parameters and establish two communication links.
[0049] Step S103: Create the P2P link for this communication based on the obtained link parameters.
[0050] When creating a P2P link for this communication based on the obtained link parameters, a first P2P link can be created based on the first obtained link parameters, or a second P2P link can be created based on the second obtained link parameters.
[0051] The process of creating the P2P link for this communication includes: the wifip2p service implementation class sequentially calls the P2P node creation interface of the P2P link for this communication in the application framework layer and the P2P node creation interface in the middle layer, and passes the P2P node creation request to the driver layer. The driver layer creates the P2P node of the P2P link for this communication based on the P2P node creation request and the obtained link parameters, and establishes the P2P link between the P2P node and the P2P peer. After the P2P link is successfully created, the identification information and link parameters of the created P2P link are returned to the upper-layer application so that the upper-layer application can use the created P2P link for communication.
[0052] When the first P2P link is created, the P2P node of this communication is the first P2P node. That is, if the first P2P link is not occupied, it can be established. The wifip2p service implementation class sequentially calls the first P2P node creation interface in the application framework layer and the first P2P node creation interface in the middle layer to pass the first P2P node creation request to the driver layer. The driver layer creates the first P2P node based on the first P2P node creation request and the first link parameters, and establishes the first P2P link between the first P2P node and the P2P peer. After the first P2P link is successfully created, the identification information and first link parameters of the created first P2P link are returned to the upper layer application so that the upper layer application can use the first P2P link for communication.
[0053] When a second P2P link is created, the P2P node of the current P2P link is the second P2P node. That is, if the second P2P link is not occupied, it can be established. The wifip2p service implementation class (wifip2pserviceimpl) sequentially calls the second P2P node creation interface in the application framework layer and the second P2P node creation interface in the middle layer, and passes the second P2P node creation request to the driver layer. The driver layer creates the second P2P node based on the second P2P node creation request and the second link parameters, and establishes the second P2P link between the second P2P node and the P2P peer. After the second P2P link is successfully created, the identification information and second link parameters of the created second P2P link are returned to the upper-layer application so that the upper-layer application can use the second P2P link for communication.
[0054] Optionally, before determining the unoccupied link in the first P2P link and the second P2P link, the above method further includes: detecting whether the integrated circuit chip supports the establishment of dual P2P links; if so, then performing the step of determining the unoccupied link in the first P2P link and the second P2P link.
[0055] Optionally, after creating the P2P link for this communication, the above method further includes: initiating a P2P peer device discovery process to discover peer devices; and establishing a communication connection with the discovered P2P peer device using the created P2P link.
[0056] The method described in this embodiment determines the P2P link to be created and the link parameters to be obtained based on the occupancy status of the P2P link when the application calls the P2P link. It selects an unoccupied link from the first and second P2P links, obtains the link parameters corresponding to the unoccupied link, and creates the P2P link for this communication based on the obtained link parameters. This method supports the simultaneous existence of two P2P links for communication without interference between them. This allows different applications to use different P2P links to communicate simultaneously, thus avoiding the situation where one application needs to use a P2P link and another application has to disconnect the link. This can meet the usage requirements of some special scenarios and support two application scenarios on one device to use P2P connection together.
[0057] Example 2
[0058] Embodiment 2 of the present invention provides a specific implementation process of a dual P2P communication method. This method can be implemented on a mobile terminal to support two applications to simultaneously create and use P2P links, i.e., support dual P2P links. The process is as follows: Figure 2 As shown, it includes the following steps:
[0059] Step S201: In response to the application's P2P link call request.
[0060] like Figure 3 The diagram illustrates the principle of supporting dual P2P links in a mobile terminal. The first application can be a screen mirroring application, and the second application can be a file transfer application. Assuming that when the first application and / or the second application requests to call the P2P link, the subsequent link creation operation is performed in response to its P2P link call request.
[0061] Step S202: Detect whether the integrated circuit chip supports establishing a dual P2P link.
[0062] This step is optional. Before establishing a dual P2P link, the system will first check whether the chip itself supports dual P2P features. If it does, the subsequent process will proceed. Alternatively, it can be assumed to be supported without any further checks.
[0063] Step S203: Determine whether the first P2P link is occupied. If yes, proceed to step S205; otherwise, proceed to step S204.
[0064] Based on the occupancy status of the first P2P node, determine whether the first P2P link is occupied. This process includes: obtaining the assigned IP address of the first P2P node; if an assigned IP address is obtained, determine that the first P2P link is occupied; if an assigned IP address is not obtained, determine that the first P2P link is not occupied.
[0065] A P2P node refers to a node that uses a P2P link. Taking the first P2P link as P2P0 and the second P2P link as P2P1 as an example, to determine whether the first P2P link is occupied, we can determine whether the P2P0 node using the P2P0 link has been assigned an IP address. If the node has been assigned an IP address, it means that the P2P0 link has been occupied. At the same time, the identifier of the link bound to the P2P0 node will be fed back to the upper-layer application using the link, informing the upper-layer application that the P2P0 link and node are being used. In subsequent operations, the application can perform operations on this link based on the identifier.
[0066] Step S204: Obtain the first link parameters and create the first P2P link based on the first link parameters.
[0067] If the first P2P link is not occupied, the first link will be created first. Of course, this can be configured to prioritize the creation of the second link.
[0068] The framework modifies the relevant Application Programming Interface (API) of wifip2pserviceimpl to add an input parameter option, namely the channel identifier (iface). The iface serves as an identifier for the channel type, used to identify the P2P link channel. For example, the channel identifier is used to distinguish between P2P0 and P2P1 links. When the upper-layer application makes a call, wifip2pserviceimpl can check whether the P2P0 link is occupied to determine whether to use the P2P0 or P2P1 link. At the same time, it returns the corresponding node name or identifier to the upper-layer application, which can then operate on the P2P link it is using.
[0069] The process of creating a P2P link includes: Wifip2pserviceimpl first listens for the Wi-Fi switch broadcast. When Wi-Fi is turned on, Wifip2pserviceimpl calls the interface for creating a P2P link (wifip2pnative.setupInterface). The framework layer begins creating the P2P link, and then continues to call the interface for creating P2P nodes (SupplicantP2pIfaceHal.setupIface) to create the P2P link. This is then passed to the driver layer, which performs the creation operation. After the P2P link is created, the information of the created P2P link is returned to the upper-layer application, such as the identifier of the created P2P link, the identifier of the P2P node, the IP address of the P2P node, etc. The upper-layer application scans and connects to the P2P peer device and communicates with it.
[0070] Step S205: Obtain the second link parameters and create a second P2P link based on the second link parameters.
[0071] If the first P2P link is already in use, a second link is created. The process of creating the second link is similar to that of creating the first link, except that the parameters of the second link are used as input parameters for link creation. When establishing a P2P link connection, the P2P0 link is created first using WifiP2pServiceImpl. If the P2P0 link is found to have already been created and is in use, the P2P1 link parameters will be obtained, and the P2P1 link can be created using the input parameter P2P1.
[0072] like Figure 3 The diagram illustrates the principle of dual P2P links in a mobile terminal. The first application can be a screen mirroring application, and the second application can be a file transfer application. Assuming the first application requests a P2P link first, it communicates through the first P2P link (P2P0 in the diagram). Then, when the second application requests a P2P link, it communicates through the second P2P link (P2P1 in the diagram). See also... Figure 3 As shown, the first application establishes a P2P0 link with the hardware chip through Wifip2pManager and Wifip2pServiceImpl, and the second application establishes a P2P1 link with the hardware chip through Wifip2pManager and Wifip2pServiceImpl.
[0073] Step S206: Initiate the P2P peer device discovery process to discover peer devices.
[0074] After a P2P link is successfully created, applications on the mobile terminal can use the created P2P link to communicate. At this time, the P2P peer device discovery process can be started to discover peer devices. Depending on whether the created link is the first or second P2P link, the corresponding link can be used to discover peer devices and establish communication connections.
[0075] Step S207: Establish a communication connection with the discovered P2P peer device using the first P2P link or the second P2P link.
[0076] The above step S206 detects the process of the peer device as follows: Figure 4 As shown, it includes:
[0077] 1) WifiP2P Settings: Search for nearby devices.
[0078] Users initiate the search for peer devices through an application (APP), and the mobile terminal calls the WifiP2P settings to start searching for peer devices.
[0079] 2) WifiP2pSettings initiates the process of discovering peer devices and calls the WifiP2PManager (WifiP2P management) interface.
[0080] 3) WifiP2PManager sends a message to the Wifip2pserviceimpl interface.
[0081] WifiP2PManager sends messages to the underlying layer, passing on the message to initiate the process of discovering peer devices, and calls the interface layer by layer to start searching for and discovering peer devices.
[0082] 4) Wifip2pserviceimpl changes the P2P enable state (P2P EnableState) and continues to pass messages down to the next layer, calling P2P discovery (P2PFind) to enable P2P.
[0083] 5) Wiifip2pserviceimpl sends information about the process of initiating the discovery of peer devices to WifiNative (local Wifi).
[0084] 6) WifiNative continues to pass messages to the lower-level WAPS and sends messages to the driver so that WAPS can start the process of discovering peer devices.
[0085] 7) After WAPS discovers the peer device, it reports to the upper layer and sends a message to WifiMonitor (Wifi Listener) to inform the upper layer that the peer device has been discovered.
[0086] 8) WifiMonitor handles discovery events for discovered peer devices.
[0087] 9) WifiMonitor will continue to report the message that the peer device has been discovered to the upper layer Wiifip2pserviceimpl.
[0088] 10) Wiifip2pserviceimpl continues to report to the upper-layer WifiP2pSettings that the peer device has been discovered.
[0089] The `Wifip2pserviceimpl` class sends a peer change broadcast message (`sendPeerChangedBroadcast`) to the upper-layer `WifiP2pSettings` to report the discovery of a peer device. There are two types of messages reported: one is the `Wifi_P2P_PEERS_CHANGED_ACTION` message, which reports changes to the Wifip2p peer device. This message is reported after the device has been discovered and connected, and includes information about the device changes. The other type is the `Wifi_P2P_DiSCOVERY_CHANGED_ACTION` message, used when reporting the discovery of a peer device. This message is used during the device discovery phase and includes information about the discovered device.
[0090] 11) WifiP2pSettings handles these messages.
[0091] 12) WifiP2pSettings updates the UI display of the upper layer.
[0092] The above describes the process of discovering a P2P peer device. After discovering the peer device, a communication connection can be established with it to conduct communication.
[0093] In this embodiment, the above Figure 3The application scenario shown has a screen mirroring application as the first application and a file transfer application as the second application. When screen mirroring and file transfer begin, the upper-layer application triggers the P2P scanning process by calling `wifip2pmanagerdiscover`. Internally, `wifip2pmanager` first checks if P2P0 is already in use and then selects either P2P0 or P2P1 as the specific input parameter when calling the `wifip2pserviceimpl` implementation. This input parameter can be returned to the upper-layer application. The application can then use this return value to perform specific operations on the corresponding link when requesting matching or other operations. After the P2P0 and P2P1 links are successfully created, the screen mirroring application can use the P2P0 link, and the file transfer application can use the P2P1 link to start the process of discovering the peer device. After discovering the peer device, the screen mirroring application establishes a communication connection with the peer device through the P2P0 link, and the file transfer application establishes a communication connection with the peer device through the P2P1 link. This can meet the needs of special scenarios, such as transferring files during screen mirroring or file transfer during network sharing.
[0094] Based on the same inventive concept, embodiments of the present invention also provide a dual P2P communication implementation system, the structure of which is as follows: Figure 5 As shown, it includes: communication device 1 and peer device 2.
[0095] Communication device 1 is equipped with a dual P2P communication implementation device.
[0096] Communication device 1 is used to communicate with peer device 2 using a first P2P link and / or a second P2P link after the application is started.
[0097] When communication device 1 requests to invoke a P2P link based on the current application, it determines whether to establish the first P2P link or the second P2P link to decide which P2P link to use for communication.
[0098] The aforementioned dual P2P communication implementation device can be installed in the device that needs to perform P2P communication, which can be a GC device or a GO device. The structure of the device is as follows: Figure 6 As shown, it includes:
[0099] Response module 11 is used to respond to P2P link call requests and determine the unoccupied link in the first P2P link and the second P2P link.
[0100] The link establishment module 12 is used to obtain the link parameters corresponding to the unoccupied links in the first P2P link and the second P2P link; and to create the P2P link for this communication based on the link parameters.
[0101] In some optional embodiments, the response module 11 is specifically used to determine whether the first P2P link and the second P2P link are occupied based on the occupancy status of the first P2P node and the second P2P node, and to determine the unoccupied link among the first P2P link and the second P2P link based on the determination result; wherein, the determination is based on whether the first P2P node and the second P2P node have been assigned IP addresses based on the occupancy status of the first P2P node and the second P2P node.
[0102] In some optional embodiments, the above-mentioned device further includes: a detection module 13, used to detect whether the integrated circuit chip supports the establishment of dual P2P links, and if so, to perform the step of determining the unoccupied link in the first P2P link and the second P2P link.
[0103] In some optional embodiments, the above apparatus further includes: a connection module 14, used to initiate a P2P peer device discovery process to discover peer devices after creating the P2P link for this communication; and to establish a communication connection with the discovered P2P peer devices using the created connection.
[0104] This invention also provides a computer storage medium storing computer-executable instructions, which, when executed by a processor, implement the aforementioned dual P2P communication method.
[0105] This invention also provides a communication device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described dual P2P communication method.
[0106] Regarding the apparatus and system in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0107] The methods and apparatus described in the embodiments of the present invention can support dual P2P technology and establish dual P2P links when the WIFI chip supports dual P2P features, thus meeting the usage requirements of special scenarios such as transferring files during screen mirroring and transferring files during network sharing.
[0108] Unless otherwise specifically stated, terms such as processing, calculation, operation, determination, display, etc., may refer to the actions and / or processes of one or more processing or computing systems or similar devices that represent the manipulation and conversion of data representing physical (e.g., electronic) quantities within the registers or memory of the processing system into other data similarly representing physical quantities within the memory, registers, or other such information storage, transmission, or display devices of the processing system. Information and signals can be represented using any of a variety of different techniques and methods. For example, data, instructions, commands, information, signals, bits, symbols, and chips mentioned throughout the above description can be represented by voltage, current, electromagnetic waves, magnetic fields or particles, light fields or particles, or any combination thereof.
[0109] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process may be rearranged without departing from the scope of this disclosure. The appended method claims provide elements of various steps in an exemplary order and are not intended to limit the scope to the specific order or hierarchy described.
[0110] In the detailed description above, various features are combined together in a single embodiment to simplify this disclosure. This approach to disclosure should not be construed as reflecting an intention that embodiments of the claimed subject matter require more features than are explicitly stated in each claim. Rather, as reflected in the appended claims, the invention is presented with fewer features than all of the features in a single disclosed embodiment. Therefore, the appended claims are hereby explicitly incorporated into the detailed description, with each claim representing a separate preferred embodiment of the invention.
[0111] Those skilled in the art will also understand that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments herein can be implemented as electronic hardware, computer software, or a combination thereof. To clearly illustrate the interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps described above are generally described in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art can implement the described functionality in alternative ways for each specific application; however, such implementation decisions should not be construed as departing from the scope of this disclosure.
[0112] The steps of the methods or algorithms described in conjunction with the embodiments herein can be directly embodied in hardware, software modules executed by a processor, or a combination thereof. The software modules can reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. The ASIC can reside in a user terminal. Alternatively, the processor and storage medium can exist as discrete components in the user terminal.
[0113] For software implementation, the techniques described in this application can be implemented using modules (e.g., procedures, functions, etc.) that perform the functions described in this application. This software code can be stored in memory units and executed by a processor. The memory units can be implemented within the processor or outside the processor; in the latter case, they are communicatively coupled to the processor via various means, as is well known in the art.
[0114] The foregoing description includes examples of one or more embodiments. It is certainly impossible to describe all possible combinations of components or methods in order to describe the above embodiments, but those skilled in the art will recognize that further combinations and arrangements of the various embodiments are possible. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims. Furthermore, the term "comprising" as used in the specification or claims is interpreted in a manner similar to the term "including," as interpreted when used as a conjunction in the claims. Additionally, the use of any term "or" in the specification of the claims is intended to mean "non-exclusive or."
Claims
1. A method for implementing dual P2P communication, characterized in that, include: After the application starts, the WiFiP2P management interface is called to call the P2P link as the communication link between the application and the hardware chip. It is detected whether the integrated circuit chip supports the establishment of dual P2P links. If so, the unused link in the first P2P link and the second P2P link is determined. Obtain the link parameters corresponding to the unoccupied links in the first and second P2P links; The WiFi P2P service implementation class sequentially calls the P2P node creation interface of the current communication P2P link in the application framework layer and the P2P node creation interface in the middle layer, and passes the P2P node creation request to the driver layer. The driver layer creates the P2P node of the current communication P2P link based on the P2P node creation request and the obtained link parameters, and establishes the P2P link between the P2P node and the P2P peer. After the P2P link is successfully created, the identification information and link parameters of the created P2P link are returned to the upper layer application so that the upper layer application can use the created P2P link to communicate with the hardware chip.
2. The method as described in claim 1, characterized in that, The process of determining the unoccupied links in the first and second P2P links includes: Based on the occupancy status of the first P2P node and the second P2P node, determine whether the first P2P link and the second P2P link are occupied, and determine the unoccupied link in the first P2P link and the second P2P link based on the determination result. The occupancy status of the first P2P node and the second P2P node is determined based on whether the first P2P node and the second P2P node have been assigned IP addresses.
3. The method according to any one of claims 1-2, characterized in that, After establishing the P2P link for this communication, the process also includes: Initiate the P2P peer device discovery process to discover peer devices; Use the created P2P link to establish a communication connection with the discovered P2P peer device.
4. A dual P2P communication implementation device, characterized in that, include: The response module is used to call the WiFiP2P management interface after the application starts to call the P2P link as the communication link between the application and the hardware chip, detect whether the integrated circuit chip supports the establishment of dual P2P links, and if so, determine the unused link in the first P2P link and the second P2P link. The link establishment module is used to obtain the link parameters corresponding to the unoccupied links in the first P2P link and the second P2P link. The WiFi P2P service implementation class sequentially calls the P2P node creation interface of the P2P link for this communication in the application framework layer and the P2P node creation interface in the middle layer to pass a P2P node creation request to the driver layer. The driver layer creates the P2P node for this communication based on the P2P node creation request and the obtained link parameters, and establishes the P2P link between the P2P node and the P2P peer. After the P2P link is successfully created, it returns the identification information and link parameters of the created P2P link to the upper-layer application so that the upper-layer application can use the created P2P link to communicate with the hardware chip.
5. A dual P2P communication implementation system, characterized in that, include: Communication equipment and peer equipment; The communication device is equipped with the dual P2P communication implementation device as described in claim 4; The communication device is used to communicate with the peer device using a first P2P link and / or a second P2P link after the application is started.
6. A computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, which, when executed by a processor, implement the dual P2P communication implementation method according to any one of claims 1-3.
7. A communication device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the dual P2P communication implementation method according to any one of claims 1-3.