Link establishment method, terminal and storage medium
By introducing a secondary chip into the terminal and using the preset API to communicate with the application layer, the problem that Microsoft's operating system does not support the GC role is solved, and the P2P link between the terminals is successfully established, ensuring the normal progress of related services.
Patent Information
- Application Number
- CN202310753846.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2024-12-27
AI Technical Summary
In some scenarios, the terminal cannot establish a P2P link with both terminals at the same time, because the protocol stack of the Microsoft operating system does not support the group member (GC) role, resulting in link establishment failure.
By introducing secondary chips in the terminal, using preset APIs to communicate with the application layer, avoiding working with Microsoft OS, we can assume the role of GC, and select the main chip or secondary chip when necessary to establish a P2P link to ensure the link Build successfully.
The P2P link between terminals is successfully established, avoiding the problem of link joining the entire scenario networking failure, so that related services can proceed normally.
Smart Images

Figure CN119212117A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a link establishment method, a terminal and a storage medium. Background Art
[0002] Currently, when two terminals form a peer-to-peer (P2P) link, they need to negotiate the role of each terminal in the network, that is, one terminal assumes the role of group owner (GO) and the other terminal assumes the role of group client (GC).
[0003] In some scenarios, a terminal needs to establish a P2P link with two terminals at the same time. For example, a mobile phone and a tablet computer (PAD) establish a P2P connection to share the network between the mobile phone and the PAD, where the mobile phone plays the GO role and the PAD plays the GC role. If the PAD shares the network with the mobile phone and also needs to cast the screen to a personal computer (PC), the PC needs to play the GC role because the PAD does not support dual GC mode.
[0004] However, the chip of the PC is controlled by the Microsoft operating system (OS), and the protocol stack of the Microsoft OS does not support the GC mode, so the PC cannot assume the GC role, resulting in failure to establish a P2P link between the PC and the PAD in this case. Summary of the invention
[0005] The embodiment of the present application provides a link establishment method, a terminal and a storage medium to avoid failure in establishing a P2P link between terminals. The specific technical solution is as follows:
[0006] In the first aspect, the embodiment of the present application provides a link establishment method, which is applied to a first terminal, wherein the first terminal includes a secondary chip, and the secondary chip communicates with the application layer through a preset API; the method includes: receiving a first group administrator GO negotiation request message sent by a second terminal, wherein the first GO negotiation request message includes a designated role flag; if the designated role flag is used to indicate that the first terminal assumes the group member GC role, a GO negotiation response message is sent to the second terminal. If a GO write confirmation message sent by the second terminal is received, a first P2P link is established with the second terminal using the secondary chip.
[0007] With this method, since the secondary chip in the first terminal communicates with the application layer through a preset API, that is, the secondary chip does not need to work with the Microsoft OS, the secondary chip can assume the GC role. On the basis that the second terminal has established a P2P link with other terminals as a GC, the second terminal can still establish a first P2P link with the first terminal as a GO, which can avoid the problem of the first terminal failing to join the existing full-scenario networking, so that related services can be carried out between the first terminal and the second terminal.
[0008] In a possible implementation, the first terminal also includes a main chip; before receiving the first group administrator GO negotiation request message sent by the second terminal, the method also includes: obtaining a connection state of the second terminal and a pending service identifier of the service requested by the second terminal to be executed, the connection state being used to indicate that the second terminal has not established a P2P link with other terminals, or being used to indicate that the second terminal has established a second P2P link with a third terminal, and the second terminal assumes a GO role in the second P2P link; selecting a target chip for establishing a P2P link with the second terminal from the main chip and the secondary chip based on the pending service identifier;
[0009] After receiving the first group administrator GO negotiation request message sent by the second terminal, the method further includes: if the designated role flag does not indicate that the first terminal assumes the GC role, using the target chip to establish a third P2P link with the second terminal in the GO role.
[0010] In one possible implementation, a target chip for establishing a P2P link with a second terminal is selected from a main chip and a secondary chip based on the identifier of the service to be executed, including: determining a target chip identifier corresponding to the identifier of the service to be executed based on a preset correspondence between each service identifier and a chip identifier; if the target chip identifier is used to identify the main chip, the main chip is used as the target chip; if the target chip identifier is used to identify the secondary chip, the secondary chip is used as the target chip.
[0011] In a possible implementation, the first terminal also includes a main chip; before receiving the first group administrator GO negotiation request message sent by the second terminal, the method also includes: receiving a second GO negotiation request message sent by the second terminal, the second GO negotiation request message is used to request the first terminal to assume the GO role; if the negotiation is successful, using the main chip to establish a fourth P2P link with the second terminal in the GO role; if the negotiation fails, executing the step of receiving the first group administrator GO negotiation request message sent by the second terminal.
[0012] In a second aspect, an embodiment of the present application provides a link establishment method, which is applied to a second terminal, and the method includes:
[0013] Send a first group administrator GO negotiation request message to the first terminal, the first GO negotiation request message includes a designated role flag; receive a GO negotiation response message sent by the first terminal, the GO negotiation response message is sent when the first terminal recognizes that the designated role flag is used to indicate that the first terminal assumes the group member GC role. Send a GO negotiation confirmation message to the first terminal, and then establish a first P2P link with the secondary chip of the first terminal in the GO role.
[0014] In a possible implementation, before sending the first group administrator GO negotiation request message to the first terminal, the method further includes: sending its own connection state and a pending service identifier of the service requested to be executed to the first terminal, where the connection state is used to indicate that the second terminal has not established a P2P link with other terminals, or is used to indicate that the second terminal has established a second P2P link with the third terminal, and the second terminal assumes the GO role in the second P2P link;
[0015] After sending the first group administrator GO negotiation request message to the first terminal, the method also includes: when the designated role flag does not indicate that the first terminal assumes the GC role, if the negotiation is successful, establishing a third P2P link with the target chip of the first terminal in the GC role, the target chip being the chip among the main chip and the secondary chip of the first terminal that matches the identifier of the service to be executed.
[0016] In one possible implementation, after sending a first group administrator GO negotiation request message to the first terminal, the method further includes: sending a second GO negotiation request message to the first terminal, the second GO negotiation request message being used to request the first terminal to assume the GO role; if the negotiation is successful, establishing a fourth P2P link with the main chip of the first terminal in the GC role; if the negotiation fails, executing the step of sending the first group administrator GO negotiation request message to the first terminal.
[0017] In a third aspect, an embodiment of the present application provides a terminal, including: a processor, a memory, a main chip and a secondary chip;
[0018] Memory stores computer-executable instructions;
[0019] The processor executes the computer-executable instructions stored in the memory, so that the terminal executes the method of the first aspect mentioned above.
[0020] In a fourth aspect, an embodiment of the present application provides a terminal, comprising a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the terminal executes the method of the above-mentioned second aspect.
[0021] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method of the first aspect or the second aspect mentioned above.
[0022] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes the method of the first aspect or the second aspect mentioned above.
[0023] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0025] Figure 1 is a schematic diagram of the hardware structure of a terminal provided in an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of the software structure of a terminal provided in an embodiment of the present application;
[0027] Figure 3 This is an exemplary schematic diagram of a full-scenario networking provided in an embodiment of the present application;
[0028] Figure 4 is a schematic diagram of a method for establishing a P2P link between a PAD and a PC provided in an embodiment of the present application;
[0029] Figure 5 is an exemplary schematic diagram of an application scenario provided by an embodiment of the present application;
[0030] Figure 6 is an exemplary schematic diagram of another application scenario provided by an embodiment of the present application;
[0031] Figure 7 is a flow chart of a link establishment method provided by an embodiment of the present application;
[0032] Figure 8 This is an exemplary schematic diagram of another full-scenario networking provided in an embodiment of the present application;
[0033] Fig. 9A flowchart of another link establishment method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0035] The link establishment method provided in the embodiment of the present application can be applied to a terminal. For example, the terminal can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a smart watch, a wearable device, etc. The embodiment of the present application does not limit the type of the terminal.
[0036] Figure 1 A schematic diagram of a terminal provided in an embodiment of the present application, such as Figure 1 As shown, the terminal 100 may include a processor 110, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a button 190, a motor 191, an indicator 192, cameras 1-N 193, a display screen 194, and subscriber identification module (SIM) card interfaces 1-N 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0037] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0038] For example, when the terminal 100 is a PC, the terminal 100 may not include the antenna 1, the mobile communication module 150, and the SIM card interface 1-N195.
[0039] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0040] The controller may be the nerve center and command center of the terminal 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0041] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0042] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, etc.
[0043] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0044] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0045] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the terminal 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0046] In the application embodiment, the mobile communication module may also be referred to as a cellular module, and the two may be described interchangeably.
[0047] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker, a receiver, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0048] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (WIFI) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In some embodiments, at least some functional modules of the wireless communication module 160 can be set in the processor 110.
[0049] In some embodiments of the present application, the terminal 100 can establish a wireless connection with other terminals through the wireless communication module 160 (such as a Bluetooth module and a WLAN module) and the antenna 2 to achieve data transmission between the terminal 100 and the other terminals.
[0050] In some embodiments, the antenna 1 of the terminal 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TDSCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0051] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0052] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also provide power to the terminal 100 through the power management module 141 .
[0053] The terminal 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0054] The display screen 194 is used to display images, videos, etc. In some embodiments, the terminal 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
[0055] The terminal 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
[0056] The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture static images or videos. In some embodiments, the terminal 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0057] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0058] The terminal 100 can implement audio functions such as music playing and recording through the audio module 170, speakers, receivers, microphones, headphone interfaces, and application processors.
[0059] The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100 .
[0060] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a screen projection function, a network sharing function, etc.), etc. The data storage area can store data (such as video data, etc.) created during the use of the terminal 100, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0061] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal 100 may receive key input and generate key signal input related to user settings and function control of the terminal 100.
[0062] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0063] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the terminal 100 by inserting into or removing from the SIM card interface 195. The terminal 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
[0064] In some embodiments, when two terminals are performing services such as network sharing, video projection, device cloning, data migration, or file sharing, a WIFI connection can be established between the terminals, and data can be transmitted based on the WIFI connection.
[0065] The two terminals establishing the WIFI connection may be terminals of different types, for example, one of the terminals is a mobile phone and the other terminal is a tablet computer, or one of the terminals is a mobile phone and the other terminal is a laptop computer.
[0066] The software system of the terminal can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. This embodiment of the application takes the Microsoft Windows system with a layered architecture as an example to illustrate the software system of the terminal installed with the Microsoft system. Figure 2 As shown, the layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Microsoft system is divided into three layers, from top to bottom, namely, the application layer, the application framework layer, and the hardware abstraction layer (HAL).
[0067] The application layer includes a series of application packages, such as PC Manager, Bluetooth, WLAN and other applications. It can also include applications such as gallery, mail and music. Figure 2 Not all are shown.
[0068] Among them, PC Manager is used to manage the main chip through the Microsoft operating system, and to manage the small chip through the preset API.
[0069] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0070] like Figure 2 As shown, the application framework layer may include the OS and the newly added MiniChip Application API in the implementation of the present disclosure. The OS is used to implement the communication between the application layer and the main chip, specifically to implement the functions of the Microsoft operating system, and the PC manager can call the main chip through the OS.
[0071] MiniChip Application API is used to implement communication between the application layer and the chiplet. For example, PC Manager can call the chiplet through MiniChip Application API.
[0072] The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms.
[0073] In an embodiment of the present application, the hardware abstraction layer may include a WIFI module, a Bluetooth (BT) module, a hardware abstraction layer module (HAL) and firmware (Firmware, FW) in the main chip, etc. The firmware may specifically be Intel FW, and also includes a WIFI module, a Bluetooth module, a hardware abstraction layer module (HAL) and a mini-chip firmware (MiniChip Firmware, MiniChip FW) in the mini-chip.
[0074] Among them, the WIFI module in the main chip may include a WIFI micro-interface driver (WIFI MiniPort Driver). The Bluetooth module in the main chip may include a Bluetooth micro-interface driver (BT MiniPort Driver), etc. In the embodiment of the present application, the main chip may also include other modules for realizing the functions of the main chip, such as a WIFI protocol stack and a Bluetooth protocol stack, etc., which are not limited in the embodiment of the present application.
[0075] The WIFI module in the chiplet may include a chiplet LAN driver (MiniChip LAN Driver) and a chiplet WIFI protocol stack (MiniChip WIFI Stack), etc. The Bluetooth module in the chiplet may include a chiplet Bluetooth driver (MiniChip BT Driver) and a chiplet Bluetooth protocol stack (MiniChip BT Stack), etc. The chiplet may also include other modules for implementing the functions of the chiplet, which is not limited in the embodiments of the present application. In the embodiments of the present application, the driver and protocol stack required by the chiplet can be offloaded to the chiplet in advance, so that the chiplet can carry full-scenario services in the GO role or GC role.
[0076] For the convenience of description, in the subsequent embodiments, the chip in the terminal that works with the Microsoft OS system is called the main chip, and the newly added small chip is called the secondary chip.
[0077] To facilitate understanding, the application scenarios of the embodiments of the present application are first introduced.
[0078] As an example, the embodiments of the present application can be applied to a scenario where a PC joins an existing full-scenario network, for example, Figure 3 As shown in FIG. 1 , the existing full-scenario networking can be the networking between the PAD and the mobile phone, a P2P link has been established between the PAD and the mobile phone, and the PAD and the mobile phone share the network through the P2P link, wherein the mobile phone plays the role of GO and the PAD plays the role of GC.
[0079] After that, when the PAD and PC need to perform screen projection services, the PC needs to join the full-scenario network as a new device. When establishing a P2P link between the PAD and the PC, since the PC can only assume the GO role, the PAD can only assume the GC role, but the PAD does not support the dual GC function, so the P2P link between the PAD and the PC fails to be established, resulting in the inability to perform screen projection services between the PAD and the PC.
[0080] In an embodiment of the present application, in order to solve the above problem, a secondary chip can be added to the first terminal, and the secondary chip communicates with the application layer through a preset API. The first terminal can receive a first GO negotiation request message sent by the second terminal, and the first GO negotiation request message includes a designated role flag. If the designated role flag is used to indicate that the first terminal assumes the GC role, a GO negotiation response message is sent to the second terminal. If a GO negotiation confirmation message sent by the second terminal is received, the secondary chip is used to establish a first P2P link with the second terminal.
[0081] In this way, since the secondary chip in the first terminal communicates with the application layer through a preset API, the secondary chip does not need to work with the Microsoft OS, so the secondary chip can assume the GC role. On the basis that the second terminal has established a P2P link with other terminals as a GC, the second terminal can still establish the first P2P link with the first terminal as a GO, which can avoid the problem of the first terminal failing to join the existing full-scenario networking, so that related services can be carried out between the first terminal and the second terminal.
[0082] In the embodiment of the present application, the first terminal may be a terminal such as a PC installed with a Microsoft OS, and the second terminal may be a terminal such as a mobile phone or a PAD that can assume both a GO role and a GC role.
[0083] The above briefly summarizes the technical solutions of the embodiments of the present application. The following is a detailed introduction to the technical solutions provided by the embodiments of the present application.
[0084] Taking the first terminal as a PC and the second terminal as a PAD as an example, when a full-scenario service is required between the PAD and the PC, a P2P link needs to be established between the PAD and the PC. As an example, the full-scenario service can be a screen projection service, a sharing service, a collaborative service, etc., which is not limited in the embodiments of the present application.
[0085] like Figure 4 The process of establishing a P2P link between the PAD and the PC shown in the figure includes four stages: scanning and discovery process, pairing process, GO negotiation process and P2P link establishment process.
[0086] During the scanning and discovery process, the PAD sends a probe request message to the PC, and the PC sends a probe response message to the PAD when receiving the probe request message sent by the PAD. Alternatively, the PC sends a probe request message to the PAD, and the PAD sends a probe response message to the PC when receiving the probe request message sent by the PC. Both the probe request message and the probe response message can be Bluetooth Low Energy (BLE) signals.
[0087] During the pairing process, when the PAD receives a probe response message, it sends a provision discovery request message to the PC. When the PC receives a provision discovery request message, it sends a provision discovery respond message to the PAD. Alternatively, when the PC receives a probe response message, it sends a provision discovery request message to the PAD. When the PAD receives a provision discovery request message, it sends a provision discovery respond message to the PC. Both the discovery request message and the discovery response message can be BLE signals.
[0088] During the GO negotiation process, the PAD sends a GO Negotiation request message to the PC. Upon receiving the GO Negotiation request message, the PC sends a GO Negotiation respond message to the PAD. After receiving the GO Negotiation respond message, the PAD sends a GO Negotiation confirm message to the PC.
[0089] During the P2P link establishment process, the PAD and PC make two WIFI connections, the first WIFI connection and the second WIFI connection. After completing the two WIFI connections, the PAD and PC can perform full-scenario services, such as the PAD can project the screen to the PC.
[0090] In some scenarios, the Bluetooth function is enabled on both the PAD and the PC, and the PAD and the PC are configured with self-discovery services. If the distance between the PAD and the PC is less than the preset distance, the process of establishing a P2P link between the PAD and the PC can be triggered. The preset distance is the maximum distance over which Bluetooth communication can be performed between the PAD and the PC. The self-discovery service is a service that can automatically establish a communication connection and execute between devices when the distance between the devices is less than the preset distance.
[0091] In other scenarios, when the PAD requests a screen projection service with the PC, it may trigger a process for the PAD and the PC to establish a P2P link.
[0092] For example, Figure 5 As shown, Figure 5 This is an exemplary schematic diagram of the display interface of the PAD. The user can select a screen projection device on the PAD. Figure 5 The selectable screen projection devices displayed in the display interface of the PAD include the PC and the TV in the living room. If the user selects the PC, the PAD can trigger the process of establishing a P2P link with the PC in response to the user's selection operation.
[0093] For example, Figure 6 As shown, Figure 6 The left side is the display interface of the PAD, and the right side is the display interface of the PC. The user can use the PAD to scan the QR code on the display interface of the PC, and the PAD can respond to the user's scanning operation and trigger the process of establishing a P2P link with the PC.
[0094] The embodiment of the present application mainly improves the above GO negotiation process. The embodiment of the present application provides a link establishment method, by which a P2P link between a first terminal and a second terminal can be established, wherein the first terminal includes a secondary chip, and the secondary chip communicates with the application layer through a preset API. The preset API can be Figure 2 As an example, the first terminal may be a PC and the second terminal may be a PAD.
[0095] like Figure 7 As shown, the method includes:
[0096] S701. A second terminal sends a first group administrator GO negotiation request message to a first terminal. Correspondingly, the first terminal receives the first GO negotiation request message sent by the second terminal.
[0097] Among them, the first group administrator GO negotiation request message includes a designated role flag. That is, the second terminal adds a designated role flag in the first group administrator GO negotiation request message. When the value of the designated role flag is a first value, it means that the designated role flag is used to indicate that the first terminal assumes the GC role; when the value of the designated role flag is a second value, it means that the designated role flag does not indicate that the first terminal assumes the GC role.
[0098] As an example, the designated role flag may be a "GC ONLY" flag. When the value of the "GC ONLY" flag is 1, it represents that the "GC ONLY" flag indicates that the first terminal can only assume the GC role; when the value of the "GC ONLY" flag is 0, it represents that the "GC ONLY" flag does not indicate that the first terminal can only assume the GC role, that is, the second terminal and the first terminal can use the normal GO negotiation process to negotiate their respective roles.
[0099] S702: If the designated role flag is used to indicate that the first terminal assumes the GC role, a GO negotiation response message is sent to the second terminal. Accordingly, the second terminal receives the GO negotiation response message sent by the first terminal.
[0100] like Figure 8 As shown, Figure 8 Taking the scenario as an example, if network sharing is being performed between the PAD and the mobile phone, in the P2P link between the PAD and the mobile phone, the mobile phone assumes the GO role and the PAD assumes the GC role. The PAD needs to establish a P2P link with the PC. The PAD can send a first GO negotiation request message to the PC, and the specified role flag in the first GO negotiation request message is used to instruct the PC to assume the GC role, so that the PC joins the full-scenario networking as a newly added device.
[0101] In this scenario, if the PC determines that its main chip cannot assume the GC role, but its secondary chip can assume the GC role, it can reply a GO negotiation response message to the PAD. The GO negotiation response message is used to indicate that the PAD can assume the GC role.
[0102] S703: The second terminal sends a GO negotiation confirmation message to the first terminal. Correspondingly, the first terminal receives the GO negotiation confirmation message sent by the second terminal.
[0103] If the first terminal receives the GO negotiation confirmation message, it can be determined that the GO negotiation between the first terminal and the second terminal is successful, and then the P2P link establishment process is performed.
[0104] S704: The first terminal establishes a first P2P link with the second terminal using the slave chip.
[0105] Among them, after the GO negotiation is successful, the first terminal can use the secondary chip to perform the P2P link establishment process with the second terminal, that is, perform the first WIFI connection and the second WIFI connection. After completing the P2P link establishment process, the first terminal can act as a GO and the second terminal can act as a GC, thereby realizing full-scenario services between the first terminal and the second terminal.
[0106] During the full-scenario service between the first terminal and the second terminal, after the secondary chip of the first terminal receives the service data through the first P2P link, it can transmit the service data to the application layer of the first terminal through the newly added data transmission channel between the secondary chip and the application layer.
[0107] With this method, since the secondary chip in the first terminal communicates with the application layer through a preset API, the secondary chip does not need to work with the Microsoft operating system, that is, it can bypass the protocol stack of the Microsoft operating system through the preset API, avoiding the problem that the Microsoft operating system does not support the GC mode, so that the secondary chip can assume the GC role. On the basis that the second terminal has established a P2P link with other terminals as a GC, the second terminal can still establish a first P2P link with the first terminal in the role of GO. During the GO negotiation process, the secondary chip is not controlled by the Microsoft operating system, which can avoid the problem of the first terminal failing to join the existing full-scenario networking, so that full-scenario services can be carried out between the first terminal and the second terminal.
[0108] It is understandable that if the designated role flag does not indicate that the first terminal assumes the GC role, the first terminal may proceed according to the normal process. Fig. 9 As shown, the processing process of the first terminal during the link establishment process in the embodiment of the present application is described:
[0109] S901. A first terminal receives a GO negotiation request message sent by a second terminal.
[0110] S902: Determine whether the second terminal requires the first terminal to assume the GC role.
[0111] If yes, execute S903; if no, execute S904.
[0112] It is understandable that if the value of the "GC ONLY" flag included in the GO negotiation request message is 1, it means that the second terminal requires the first terminal to assume the GC role; if the value of the "GC ONLY" flag is 0, it means that the second terminal does not require the first terminal to assume the GC role.
[0113] It is understandable that if the second terminal requires the first terminal to assume the GC role, S903 may be executed when the second terminal and the first terminal GO negotiate successfully. Fig. 9 The GO negotiation process is omitted.
[0114] S903: The first terminal uses the slave chip to establish a P2P link with the second terminal.
[0115] After executing S903, the process ends.
[0116] It is understandable that if the second terminal does not require the first terminal to assume the GC role, then 904 may be executed if the second terminal and the first terminal GO negotiate successfully. Fig. 9 The GO negotiation process is omitted.
[0117] S904: The first terminal uses the main chip to establish a P2P link with the second terminal.
[0118] After executing S904, the process ends.
[0119] In this way, the first terminal can select the slave chip or the master chip according to actual conditions, so that the first terminal can assume the GO role or the GC role, which can improve the success rate of establishing the P2P link.
[0120] In some embodiments of the present application, when executing Figure 7 Before the process shown in the figure, the second terminal can first try to request the first terminal to assume the GO role. If the GO negotiation fails, Figure 7 The process shown re-negotiates the GO.
[0121] That is, before S701, the second terminal can send a second GO negotiation request message to the first terminal, and the second GO negotiation request message is used to request the first terminal to assume the GO role. If the negotiation is successful, the first terminal uses the main chip to establish a fourth P2P link with the second terminal in the GO role; if the negotiation fails, S701 is executed.
[0122] After receiving the second GO negotiation request message, the first terminal may determine that it can use the main chip to assume the GO role, and then reply a GO negotiation response message to the second terminal, where the GO negotiation response message is used to instruct the second terminal to assume the GC role.
[0123] If the second terminal can assume the GC role at this time, the negotiation can be successful; if the second terminal cannot assume the GC role at this time, the negotiation fails.
[0124] When the second terminal can assume the GC role, the second terminal can send a GO negotiation confirmation message to the first terminal, and then the main chip of the first terminal can assume the GO role, and the first terminal can use the main chip to establish a P2P link with the second terminal.
[0125] by Figure 8 For example, the first terminal is a PC and the second terminal is a PAD. During the network sharing between the PAD and the mobile phone, if you need to perform screen projection with the PC, you can first try to request the PC to assume the GO role. After receiving the GO negotiation response from the PC, if the P2P link between the PAD and the mobile phone has been disconnected, the PAD can now assume the GC role, and the PAD and PC can negotiate successfully. If the P2P link between the PAD and the mobile phone still exists, the PAD cannot assume the GC role at this time, and the negotiation between the PAD and GC fails.
[0126] With this method, since the service support capability of the main chip is stronger, the first terminal can use the main chip as much as possible to establish a P2P link with the second terminal to ensure service quality.
[0127] In some embodiments of the present application, the main chip of the first terminal in the embodiment of the present application can assume the GO role, and the secondary chip can assume the GO role or the GC role. When the first terminal needs to assume the GO role, the first terminal can select the main chip or the small chip according to the service currently to be executed. Based on this, before S701, the method further includes the following steps:
[0128] Step 1: The second terminal sends its own connection status and the pending service identifier of the service requested to be executed to the first terminal. Accordingly, the first terminal obtains the connection status of the second terminal and the pending service identifier of the service requested to be executed by the second terminal.
[0129] The connection state is used to indicate that the second terminal has not established a P2P link with other terminals, or is used to indicate that the second terminal has established a second P2P link with a third terminal, and the second terminal assumes a GO role in the second P2P link.
[0130] The second terminal may send the connection status and the identifier of the service to be executed to the first terminal via Bluetooth after completing the pairing process with the first terminal and before performing the GO negotiation.
[0131] After the first terminal obtains the above connection status, it can be determined that when a P2P link is established between the second terminal and the first terminal, the second terminal can assume the GC role, and the first terminal can assume the GO role accordingly. Since both the main chip and the secondary chip in the first terminal can assume the GO role, the first terminal can continue to perform step 2, thereby selecting a target chip for the service to be executed.
[0132] Step 2: The first terminal selects a target chip for establishing a P2P link with the second terminal from the primary chip and the secondary chip based on the identifier of the service to be executed.
[0133] In one implementation, the first terminal may determine the target chip identifier corresponding to the to-be-executed service identifier based on a preset correspondence between each service identifier and the chip identifier.
[0134] If the target chip identifier is used to identify the main chip, the main chip is used as the target chip;
[0135] If the target chip identifier is used to identify the slave chip, the slave chip is used as the target chip.
[0136] It is understandable that the above preset correspondence is pre-configured in the first terminal. Since the service support capability of the main chip is relatively strong, the service identifier of the service with a large amount of transmission data can be pre-configured to correspond to the chip identifier of the main chip, such as the machine replacement cloning service. Since the service support capability of the secondary chip is relatively weaker than that of the main chip, if the service identifier of the service with a small amount of transmission data can be pre-configured to correspond to the chip identifier of the secondary chip, such as the screen projection service and the collaborative service.
[0137] Among them, the business support capabilities of the main chip and the slave chip can be measured by the data transmission bandwidth, and the embodiments of the present application do not make specific limitations on this.
[0138] It should be noted that the business support capabilities of the main chip and the slave chip may change, and accordingly, the above preset corresponding relationship may also be adjusted accordingly.
[0139] On the basis of step 1 and step 2, after the first terminal receives the first group administrator GO negotiation request message sent by the second terminal, the method further includes:
[0140] If the designated role flag does not indicate that the first terminal assumes the GC role, a third P2P link is established with the second terminal in the GO role using the target chip.
[0141] If the target chip is the main chip, the first terminal can use the main chip to complete the GO negotiation process with the second terminal. After the GO negotiation is successful, the main chip of the first terminal assumes the GO role and then uses the main chip to establish a third P2P link with the second terminal.
[0142] If the target chip is a slave chip, the first terminal can use the slave chip to complete the GO negotiation process with the second terminal. After the GO negotiation succeeds, the slave chip of the first terminal assumes the GO role and then uses the slave chip to establish a third P2P link with the second terminal.
[0143] By adopting this method, when the first terminal needs to assume the GO role, the first terminal can select a chip suitable for the service to be executed based on the identifier of the service to be executed, thereby ensuring the quality of the service. In addition, the service that the service support capability of the small chip is sufficient to carry can be carried by the small chip, which can save the processing overhead of the main chip and make the first terminal run more smoothly.
[0144] In a specific implementation, the present application also provides a computer storage medium, wherein the computer storage medium may store a program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to perform some or all of the steps in the above embodiment. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0145] In a specific implementation, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes some or all of the steps in the above method embodiment.
[0146] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.
[0147] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0148] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0149] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or by other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, compact disc read-only memories (Compact Disc Read Only Memory, CD-ROMs), magneto-optical disks, read-only memories (Read Only Memory, ROM), random access memories (RAM), erasable programmable read-only memories (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-only memories (Electrically Erasable Programmable Read Only Memory, EEPROM), magnetic cards or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Accordingly, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
[0150] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings of the specification. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0151] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0152] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0153] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
Claims
1. A link establishment method, characterized in that: Applied to a first terminal, the first terminal includes a slave chip, and the slave chip communicates with an application program layer through a preset API; the method includes: receiving a first group administrator GO negotiation request message sent by the second terminal, wherein the first GO negotiation request message includes a designated role flag; If the designated role flag is used to indicate that the first terminal assumes the group member GC role, sending a GO negotiation response message to the second terminal; If a GO negotiation confirmation message sent by the second terminal is received, a first P2P link is established with the second terminal using the secondary chip.
2. The method according to claim 1, characterized in that The first terminal also includes a main chip; before receiving the first group administrator GO negotiation request message sent by the second terminal, the method also includes: Acquire a connection state of the second terminal and a pending service identifier of a service requested by the second terminal to be executed, wherein the connection state is used to indicate that the second terminal has not established a P2P link with other terminals, or is used to indicate that the second terminal has established a second P2P link with a third terminal, and the second terminal assumes a GO role in the second P2P link; Selecting a target chip for establishing a P2P link with the second terminal from the main chip and the slave chip based on the identifier of the service to be executed; After receiving the first group administrator GO negotiation request message sent by the second terminal, the method further includes: If the designated role flag does not indicate that the first terminal assumes the GC role, a third P2P link is established with the second terminal in the GO role by using the target chip.
3. The method according to claim 2, characterized in that The selecting, from the main chip and the slave chip based on the to-be-executed service identifier, a target chip for establishing a P2P link with the second terminal comprises: Based on the preset correspondence between each service identifier and the chip identifier, determining the target chip identifier corresponding to the service identifier to be executed; If the target chip identifier is used to identify the main chip, the main chip is used as the target chip; If the target chip identifier is used to identify the slave chip, the slave chip is used as the target chip.
4. The method according to claim 1, characterized in that: The first terminal also includes a main chip; before receiving the first group administrator GO negotiation request message sent by the second terminal, the method also includes: receiving a second GO negotiation request message sent by the second terminal, where the second GO negotiation request message is used to request the first terminal to assume a GO role; If the negotiation is successful, using the master chip to establish a fourth P2P link with the second terminal in the GO role; If the negotiation fails, the step of receiving the first group administrator GO negotiation request message sent by the second terminal is performed.
5. A link establishment method, characterized in that: Applied to the second terminal, the method includes: Sending a first group administrator GO negotiation request message to the first terminal, wherein the first GO negotiation request message includes a designated role flag; receiving a GO negotiation response message sent by the first terminal, where the GO negotiation response message is sent when the first terminal recognizes that the designated role flag is used to indicate that the first terminal assumes a group member GC role; Sending a GO negotiation confirmation message to the first terminal; A first P2P link is established with the slave chip of the first terminal in the role of a GO, wherein the slave chip communicates with the application program layer through a preset API.
6. The method according to claim 5, characterized in that Before sending the first group administrator GO negotiation request message to the first terminal, the method further includes: Sending its own connection state and a pending service identifier of the service requested to be executed to the first terminal, wherein the connection state is used to indicate that the second terminal has not established a P2P link with other terminals, or is used to indicate that the second terminal has established a second P2P link with a third terminal, and the second terminal assumes a GO role in the second P2P link; After sending the first group administrator GO negotiation request message to the first terminal, the method further includes: When the designated role flag does not indicate that the first terminal assumes the GC role, if the negotiation is successful, a third P2P link is established with the target chip of the first terminal in the GC role, and the target chip is the chip among the main chip and the secondary chip of the first terminal that matches the identifier of the service to be executed.
7. The method according to claim 5, characterized in that After sending the first group administrator GO negotiation request message to the first terminal, the method further includes: Sending a second GO negotiation request message to the first terminal, where the second GO negotiation request message is used to request the first terminal to assume a GO role; If the negotiation is successful, a fourth P2P link is established with the main chip of the first terminal in the GC role; If the negotiation fails, the step of sending a first group administrator GO negotiation request message to the first terminal is executed.
8. A terminal, characterized in that: include: Processor, memory, main chip and sub-chip; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal executes the method according to any one of claims 1 to 4.
9. A terminal, characterized in that: including a processor and a memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal executes the method according to any one of claims 5 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 4 or 5 to 7.
11. A computer program product, characterized in that The computer program product comprises executable instructions, and when the executable instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 4 or 5 to 7.
