Terminal connection methods, devices, equipment and storage media
By receiving and analyzing the historical connection attributes of WiFi P2P connection request frames, abnormal connection attributes are identified and strategies are generated, thus solving the problem of low WiFi P2P connection failure rate and improving connection success rate and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN TCL DIGITAL TECH CO LTD
- Filing Date
- 2026-04-09
- Publication Date
- 2026-07-31
AI Technical Summary
Existing WiFi P2P communication technology suffers from abnormal events such as parameter anomalies, connection timeouts, and failure to respond to the peer in a timely manner during the device connection process, resulting in a low terminal connection success rate and affecting the user's device connection experience.
By receiving terminal connection requests triggered by peer devices, the system obtains historical connection attributes from the connection request frame, determines abnormal connection attributes, generates terminal connection strategies based on these abnormal connection attributes, and dynamically adjusts connection parameters and channels to establish terminal connections.
It improves the success rate of terminal connections. By identifying and dynamically adjusting connection strategies, it effectively identifies and resolves the causes of past connection failures, thereby enhancing the stability and reliability of connections.
Smart Images

Figure CN122496927A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and specifically to a terminal connection method, apparatus, device, and storage medium. Background Technology
[0002] Currently, WiFi P2P communication technology is a technology that allows multiple devices to communicate directly without relying on intermediary devices or wireless access points. P2P connections are widely used in file sharing, screen mirroring, and smart home device interconnection. However, existing WiFi P2P communication technologies are prone to connection failures during the device connection process due to abnormal events such as abnormal parameters, connection timeouts, and failure to respond promptly to the peer, resulting in a low terminal connection success rate and affecting the user's device connection experience. Summary of the Invention
[0003] This application provides a terminal connection method, apparatus, device, and storage medium, aiming to solve the technical problem of low success rate of point-to-point terminal connections in the prior art.
[0004] On one hand, embodiments of this application provide a terminal connection method, which includes the following steps: Receive a terminal connection request triggered by a peer connection device, obtain a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device; The abnormal connection attributes of the peer connection device are determined based on the historical connection attributes in the connection request frame. Based on the abnormal connection attributes, a terminal connection policy corresponding to the terminal connection request is generated. Based on the terminal connection policy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0005] In one possible implementation of this application, determining the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame includes: Parse the connection request frame to obtain the error description identifier in the connection request frame; If the error description identifier is the first description identifier, then the historical connection attributes in the connection request frame are obtained; The historical connection attributes are parsed to determine the abnormal connection attributes corresponding to the peer connection device.
[0006] In one possible implementation of this application, the step of parsing the historical connection attributes to determine the abnormal connection attributes corresponding to the peer connection device includes: Parse the historical connection attributes to determine the historical connection identifier in the historical connection attributes; If the historical connection identifier is an abnormal connection identifier, then the field description information in the abnormal connection field of the historical connection attribute is read to obtain the abnormal connection attribute. The abnormal connection attribute includes any one or more of the first connection channel attribute, the second connection channel attribute, and error description information.
[0007] In one possible implementation of this application, the step of generating a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attribute, establishing a terminal connection with the peer connection device based on the terminal connection policy, and obtaining a terminal connection result includes: Parse the abnormal connection attribute to obtain the error description information in the abnormal connection attribute; Access the connection optimization database and match the connection optimization measures corresponding to the error description information; Based on the connection optimization measures, a terminal connection strategy corresponding to the terminal connection request is generated. Based on the terminal connection strategy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0008] In one possible implementation of this application, establishing a terminal connection with the peer connection device based on the terminal connection strategy and obtaining the terminal connection result includes: Obtain the reconnection request frame corresponding to the terminal connection policy and send the reconnection request frame to the peer connection device. If a reconnection confirmation frame is received from the peer connection device based on the reconnection request frame, a terminal connection is established with the peer connection device based on the terminal connection strategy, and a terminal connection result is obtained.
[0009] In one possible implementation of this application, establishing a terminal connection with the peer connection device based on the terminal connection strategy and obtaining the terminal connection result includes: If the terminal connection strategy is the first connection strategy, then the target connection parameters are configured based on the error description information corresponding to the first connection strategy. Based on the target connection parameters, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0010] In one possible implementation of this application, establishing a terminal connection with the peer connection device based on the terminal connection strategy and obtaining the terminal connection result includes: If the terminal connection strategy is the second connection strategy, then the current connection channel is adjusted based on the error description information corresponding to the second connection strategy to obtain the target connection channel; And / or, adjust the number of connection retries based on the error description information corresponding to the second connection strategy to obtain the updated number of retries; Based on the target connection channel and / or the updated retry count, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0011] On the other hand, this application provides a terminal connection device, the terminal connection device comprising: The information acquisition module is configured to receive a terminal connection request triggered by a peer connection device, acquire a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device. The attribute parsing module is configured to determine the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame. The terminal connection module is configured to generate a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attributes, establish a terminal connection with the peer connection device based on the terminal connection policy, and obtain a terminal connection result.
[0012] On the other hand, this application also provides a terminal connection device, the terminal connection device comprising: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the terminal connection method.
[0013] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the terminal connection method.
[0014] This application receives a terminal connection request triggered by a peer device, obtains a connection request frame carried in the connection request, and the connection request frame carries historical connection attributes recording the past terminal connection states of the peer device. Based on the historical connection attributes in the connection request frame, it determines the abnormal connection attributes of the peer device. Based on the abnormal connection attributes, it generates a terminal connection policy corresponding to the terminal connection request, establishes a terminal connection with the peer device based on the terminal connection policy, and obtains a terminal connection result. This enables the acquisition of a connection request frame carried in the terminal connection request when establishing a WiFi P2P connection between a terminal and a peer device, determining the abnormal connection attributes that caused the previous terminal connection failure on the peer device based on the historical connection attributes configured in the connection request frame, dynamically configuring the terminal connection policy for the current terminal connection based on the abnormal connection attributes, and performing the terminal connection based on the terminal connection policy. This allows for the effective identification of reasons for past connection failures of the peer device during the terminal connection process, and the dynamic adjustment of the current terminal connection policy based on the reasons for connection failures to improve the terminal connection success rate. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram illustrating a scenario of the terminal connection method according to an embodiment of this application; Figure 2 This is a flowchart illustrating one embodiment of the terminal connection method in this application. Figure 3 A flowchart illustrating an embodiment of the terminal connection method provided in this application for establishing a terminal connection with the peer connection device based on the terminal connection strategy; Figure 4 A flowchart illustrating another embodiment of the terminal connection method provided in this application for establishing a terminal connection with the peer connection device based on the terminal connection strategy; Figure 5 A schematic diagram of the structure of one embodiment of the terminal connection device provided in this application; Figure 6 This is a schematic diagram of the structure of one embodiment of the terminal connection device provided in this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0019] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0020] Currently, WiFi P2P communication technology is a technology that allows multiple devices to communicate directly without relying on intermediary devices or wireless access points. P2P connections are widely used in file sharing, screen mirroring, and smart home device interconnection. However, existing WiFi P2P communication technologies are prone to connection failures during the device connection process due to abnormal events such as abnormal parameters, connection timeouts, and failure to respond promptly to the peer, resulting in a low terminal connection success rate and affecting the user's device connection experience.
[0021] Based on this, this application proposes a terminal connection method, apparatus, device, and computer-readable storage medium to solve the technical problem of low success rate of point-to-point terminal connections in the prior art.
[0022] The terminal connection method in this embodiment of the invention is applied to a terminal connection device, which is disposed in a terminal connection equipment. The terminal connection equipment is provided with one or more processors, a memory, and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the terminal connection method. The terminal connection equipment can be a smart terminal, such as a mobile phone, tablet computer, network device, and smart computer. Optionally, the terminal connection equipment can also be a server or a service cluster composed of multiple servers.
[0023] like Figure 1 As shown, Figure 1 This is a schematic diagram illustrating a terminal connection method according to an embodiment of this application. The terminal connection scenario in this embodiment includes a terminal connection device 100 (which integrates a terminal connection apparatus) and a peer connection device 200. The terminal connection device 100 has a computer-readable storage medium corresponding to the terminal connection method running to execute the steps of the terminal connection method. The peer connection device 200 is a service terminal that performs a point-to-point connection with the terminal connection device 100.
[0024] Understandable Figure 1 The terminal connection device in the terminal connection method scenario shown, or the device included in the terminal connection device, does not constitute a limitation on the embodiments of the present invention. That is, the number or type of terminal connection device included in the terminal connection method scenario, or the number or type of device included in each device, does not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of the present invention.
[0025] In this embodiment of the invention, the terminal connection device 100 is mainly used to: receive a terminal connection request triggered by a peer connection device, obtain a connection request frame carried by the terminal connection request, wherein the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device; The abnormal connection attributes of the peer connection device are determined based on the historical connection attributes in the connection request frame. Based on the abnormal connection attributes, a terminal connection policy corresponding to the terminal connection request is generated. Based on the terminal connection policy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0026] The terminal connection device 100 in this embodiment of the invention can be an independent terminal connection device, such as a mobile phone, tablet computer, network device, server, and smart computer.
[0027] This application provides a terminal connection method, apparatus, device, and computer-readable storage medium, which will be described in detail below.
[0028] It will be understood by those skilled in the art that Figure 1 The application environment shown is only one application scenario related to the solution of this application and does not constitute a limitation on the application scenario of this application. Other application environments may include more than one application scenario. Figure 1 The number of more or fewer terminal connection devices shown, or the terminal connection network connection relationships, for example Figure 1 Only one terminal connection device is shown in the diagram. It is understood that the scenario of this terminal connection method may also include one or more terminal connection devices, which are not specifically limited here. The terminal connection device 100 may also include a memory for storing connection request frames and other data.
[0029] It should be noted that, Figure 1 The schematic diagram of the terminal connection method shown is merely an example. The scenarios of the terminal connection method described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention and do not constitute a limitation on the technical solutions provided in the embodiments of the present invention.
[0030] Based on the scenarios described above regarding terminal connection methods, various embodiments of the terminal connection method disclosed in this invention are proposed.
[0031] like Figure 2 As shown, Figure 2 This is a flowchart illustrating one embodiment of the terminal connection method in this application. The terminal connection method includes the following steps 201 to 203: 201. Receive a terminal connection request triggered by the peer connection device, and obtain the connection request frame carried in the terminal connection request; The terminal connection method in this embodiment is applied to a terminal connection device. The type and number of terminal connection devices are not specifically limited; that is, the terminal connection device can be one or more smart terminals that support point-to-point connections. Specifically, the terminal connection device can establish a terminal connection with other smart terminals directly without needing a wireless access point or router. Optionally, in one specific embodiment, the point-to-point connection is a Wi-Fi Direct connection. In one specific embodiment, the terminal connection device is a smart terminal such as a smartphone, tablet, smart wearable device, or laptop that supports Wi-Fi Direct STA mode.
[0032] Optionally, the peer connection device is a smart terminal that establishes a peer-to-peer connection with the terminal connection device. That is, the peer connection device is a smart terminal such as a smartphone, tablet, smart wearable device, or laptop that supports Wi-Fi Direct and establishes a peer-to-peer connection with the terminal connection device. Optionally, the terminal connection device and the smart terminal establishing a peer-to-peer connection with the terminal device are peer connection devices to each other.
[0033] Optionally, the terminal connection request is an operation event triggered by either the peer connection device or the terminal connection device to control the peer connection device and the terminal connection device to establish a peer-to-peer connection. Optionally, in one specific embodiment, the terminal connection request can be triggered by a user clicking the device identifier associated with the terminal connection device in the peer connection device. Optionally, in other embodiments, the terminal connection request can also be automatically triggered by either the peer connection device or the terminal connection device. For example, in one specific embodiment, the terminal connection request can be a re-issued peer-to-peer connection request after the peer connection device and the terminal connection device fail to establish a peer-to-peer connection.
[0034] Optionally, the connection request frame is a connection negotiation data frame sent by the peer connection device to establish a point-to-point terminal connection with the terminal connection device. This connection request frame includes newly added fields indicating whether the peer connection request has the capability to provide historical connection information, and a newly added field carrying historical connection attributes corresponding to the past terminal connection states of the peer connection device. That is, when a peer connection device capable of providing historical connection information fails to establish a point-to-point connection with the terminal connection device in the past, it can record the historical connection attributes corresponding to that point-to-point connection process in the newly added field of the connection request frame.
[0035] Optionally, during the point-to-point connection process with the terminal connection device, the peer connection device generates a terminal connection request and a corresponding connection request frame. The peer device then enters the historical connection attributes from the last point-to-point connection with the terminal connection device into a newly added field in the connection request frame, and sends the terminal connection request carrying the connection request frame to the terminal connection device. Optionally, in one specific embodiment, the connection request frame is a Nego Request frame containing a connection error identifier and a historical connection identifier.
[0036] Optionally, when a terminal connection device receives a terminal connection request triggered by a peer connection device, it obtains the connection request frame carried by the terminal connection request and determines the terminal connection strategy corresponding to the terminal connection request through the connection request frame in subsequent steps to improve the terminal connection success rate.
[0037] 202. Determine the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame; Optionally, after receiving a connection request frame sent by the peer connection device, the terminal connection device determines the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame.
[0038] Optionally, the historical connection attribute is an identifier that indicates whether there was an abnormal state in the last point-to-point terminal connection between the peer connection device and the terminal connection device.
[0039] Optionally, the abnormal connection attribute records connection error information between the peer connection device and the terminal connection device during the last point-to-point terminal connection. That is, the abnormal connection attribute is attribute information generated by the peer connection device recording information such as the channel used by the peer connection device and the corresponding connection error description during the last connection failure.
[0040] Optionally, after receiving a connection request frame, the terminal connection device parses the connection request frame and obtains the error description identifier in the connection request frame. Optionally, in one specific embodiment, the error description identifier is identifier information indicating whether the connection request frame transmitted by the peer connection device has the ability to provide point-to-point connection error information. Optionally, in one specific embodiment, the peer connection device pre-adds an identifier field corresponding to the error description identifier in the connection request frame, used to indicate whether the connection request frame corresponding to the peer connection device has the ability to provide past point-to-point connection error information. Optionally, in one specific embodiment, the error description identifier includes a first description identifier indicating that the connection request frame can provide past point-to-point connection information and a second description identifier indicating that the connection request frame cannot provide past point-to-point connection information. In one specific embodiment, the identifier field corresponding to the error description identifier is a newly added P2PDevice Capability Bitmap bit (6) field in the connection request frame. The P2P Device Capability Bitmap bit (6) field corresponding to the first description identifier has a value of 1, indicating that the device supports providing error information in past point-to-point connection processes. The value of the P2P Device Capability Bitmap bit(6) field corresponding to the second description identifier is 0, indicating that the device does not support providing abnormal information in the past point-to-point connection process.
[0041] Optionally, if the terminal connection device determines that the error description identifier is the first description identifier, it determines that the connection request frame contains historical connection information from the peer connection device's past point-to-point connection processes, and then obtains the historical connection attributes in the connection request frame, parses the historical connection attributes to determine the abnormal connection attributes corresponding to the peer connection device.
[0042] Optionally, after obtaining the historical connection attributes, the terminal connection device parses these attributes to determine the historical connection identifier within them. This historical connection identifier is information indicating whether the terminal experienced connection anomalies or other errors during the previous peer-to-peer terminal connection process. Optionally, the historical connection identifier includes a normal connection identifier indicating that the terminal did not experience connection anomalies during the previous peer-to-peer terminal connection process, and an abnormal connection identifier indicating that the terminal failed to connect normally during the previous peer-to-peer terminal connection process. Optionally, in one specific embodiment, the historical connection identifier is a newly added P2P Error Info field in the connection request frame. The P2P Error Info field value corresponding to the normal connection identifier is 0, and the P2P Error Info field value corresponding to the abnormal connection identifier is 1.
[0043] Optionally, when the historical connection identifier is an abnormal connection identifier, the historical connection attribute carries abnormal connection attributes. Therefore, when the terminal connection device determines that the historical connection identifier is an abnormal connection identifier after reading it, it reads the field description information in the abnormal connection field of the historical connection attribute to obtain the abnormal connection attribute. The abnormal connection attribute includes any one or more of the following: a first connection channel attribute, a second connection channel attribute, and error description information. Specifically, the first connection channel attribute is the channel identifier information of the STA connection channel that identified the connection between the peer connection device and the terminal connection device when the terminal experienced a connection abnormality during the last point-to-point terminal connection process. The second connection channel attribute is the channel identifier information of the P2P connection channel that identified the connection between the peer connection device and the terminal connection device when the terminal experienced a connection abnormality during the last point-to-point terminal connection process. The error description information is used to describe the abnormality description information used by the peer connection device and the terminal connection device when the terminal experienced a connection abnormality during the last point-to-point terminal connection process. Optionally, in one specific embodiment, the error description information includes [weak signal], [no Nego resp packet received], [no Nego Confirm packet received], [no GO beacon or P2P Resp frame received], and a description of specific abnormal parameters, etc.
[0044] 203. Generate a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attributes, establish a terminal connection with the peer connection device based on the terminal connection policy, and obtain the terminal connection result.
[0045] Optionally, after obtaining the abnormal connection attributes of the peer connection device, the terminal connection device also generates a terminal connection policy based on the abnormal connection attributes, and establishes a point-to-point terminal connection with the peer connection device based on the terminal connection policy to obtain the terminal connection result.
[0046] Optionally, the terminal connection strategy is a connection control strategy that includes connection optimization measures corresponding to abnormal connection attributes. Optionally, the terminal connection strategy includes information such as connection parameter configurations for point-to-point connections between the peer connection device and the terminal connection device, which can guide the peer connection device and the terminal connection device to perform point-to-point connections.
[0047] Optionally, the terminal connection device parses the abnormal connection attribute and obtains the error description information in the abnormal connection attribute.
[0048] Optionally, the terminal connection device pre-sets corresponding connection optimization measures for different error descriptions and stores the error descriptions and connection optimization measures in a connection optimization database. After obtaining the error descriptions from the peer connection device, the terminal connection device accesses the connection optimization database and matches the connection optimization measures corresponding to the error descriptions. The connection optimization measures are optimizations used to adjust the terminal connection strategy of the terminal connection device. These optimization measures are optimization methods capable of adjusting at least one or more connection parameters in the terminal connection strategy, such as parameters, reception status, and retry count.
[0049] Optionally, the terminal connection device generates a terminal connection policy corresponding to the terminal connection request based on the connection optimization measures, establishes a terminal connection with the peer connection device based on the terminal connection policy, and obtains a terminal connection result. Optionally, the terminal connection policy includes a first connection policy and a second connection policy. The first connection policy is a terminal connection policy used to adjust specified connection parameters during the point-to-point connection process. The second connection policy is a terminal connection policy used to adjust the connection channel and the number of connection retries during the point-to-point connection process.
[0050] Optionally, the terminal connection device obtains the reconnection request frame corresponding to the terminal connection policy and sends the reconnection request frame to the peer connection device. The reconnection request frame is a confirmation frame used to confirm the negotiation between the terminal connection device and the peer connection device. In one specific embodiment, the reconnection request frame is a Nego Confirm frame.
[0051] Optionally, if the terminal connection device receives a reconnection confirmation frame transmitted by the peer connection device based on the reconnection request frame within a preset connection time window, then it establishes a terminal connection with the peer connection device based on the terminal connection strategy and obtains the terminal connection result.
[0052] In this embodiment, the terminal connection device receives a terminal connection request triggered by the peer connection device, obtains a connection request frame carried in the connection request, and the connection request frame carries historical connection attributes recording the past terminal connection states of the peer connection device. Based on the historical connection attributes in the connection request frame, the device determines the abnormal connection attributes of the peer connection device. Based on the abnormal connection attributes, it generates a terminal connection policy corresponding to the terminal connection request, establishes a terminal connection with the peer connection device based on the terminal connection policy, and obtains a terminal connection result. This enables the terminal to obtain the connection request frame carried in the terminal connection request when establishing a WiFi P2P connection with the peer connection device, determine the abnormal connection attributes that caused the previous terminal connection failure on the peer connection device based on the historical connection attributes configured in the connection request frame, dynamically configure the terminal connection policy for the current terminal connection based on the abnormal connection attributes, and perform the terminal connection based on the terminal connection policy. This allows for the effective identification of reasons for past connection failures of the peer connection device during the terminal connection process, and the dynamic adjustment of the current terminal connection policy based on the reasons for connection failures to improve the terminal connection success rate.
[0053] like Figure 3 As shown, Figure 3 A flowchart illustrating an embodiment of the terminal connection method provided in this application for establishing a terminal connection with the peer connection device based on the terminal connection strategy is shown below. Figure 3 In the illustrated embodiment, the terminal connection method further includes steps 301 to 302: 301. If the terminal connection strategy is the first connection strategy, then the target connection parameters are configured based on the error description information corresponding to the first connection strategy. 302. Establish a terminal connection with the peer connection device based on the target connection parameters to obtain the terminal connection result.
[0054] Based on the above embodiments, in this embodiment, after obtaining the abnormal connection attributes of the peer connection device, the terminal connection device also generates a terminal connection policy based on the abnormal connection attributes, and establishes a point-to-point terminal connection with the peer connection device based on the terminal connection policy to obtain the terminal connection result.
[0055] Optionally, when the terminal connection device determines that the error description information is due to abnormal parameters or weak signal causing the connection failure, it determines the terminal connection strategy as the first connection strategy and configures the target connection parameters based on the error description information corresponding to the first connection strategy. That is, the terminal connection device obtains the first connection optimization measure corresponding to the error description information of abnormal parameters or weak signal causing the connection failure, and adjusts the connection parameters of the first connection strategy based on the first connection optimization measure to obtain the target connection parameters. The first connection optimization measure is an optimization measure used to adjust the connection parameters during the point-to-point connection process. In a specific embodiment, the first connection optimization measure can adjust the connection parameters according to the error parameters of the error description information to generate the target connection parameters. For example, in a specific embodiment, the first connection optimization measure includes adjusting the transmit power and changing the antenna parameters, etc. In addition, the first connection optimization measure can also adjust other abnormal connection parameters according to the specific error description information to obtain the target connection parameters.
[0056] Optionally, after configuring and obtaining the target connection parameters, the terminal connection device establishes a terminal connection with the peer device based on the target connection parameters and obtains the terminal connection result.
[0057] In this embodiment, when the terminal connection device determines that the terminal connection strategy is the first connection strategy, it configures target connection parameters based on the error description information corresponding to the first connection strategy; based on the target connection parameters, it establishes a terminal connection with the peer connection device to obtain the terminal connection result. This achieves dynamic adjustment of the abnormal connection parameters of the terminal connection device according to the error description information to generate target connection parameters to eliminate connection anomalies, and uses the target connection parameters to establish a point-to-point connection with the peer connection device, thereby improving connection stability and reliability, and increasing the connection success rate.
[0058] like Figure 4 As shown, Figure 4 A flowchart illustrating another embodiment of the terminal connection method provided in this application for establishing a terminal connection with the peer connection device based on the terminal connection strategy is shown below. Figure 4 In the illustrated embodiment, the terminal connection method further includes steps 401 to 403: 401. If the terminal connection strategy is the second connection strategy, then the current connection channel is adjusted based on the error description information corresponding to the second connection strategy to obtain the target connection channel; 402. Adjust the number of connection retries based on the error description information corresponding to the second connection strategy to obtain the updated number of retries; 403. Establish a terminal connection based on the target connection channel and / or the peer connection device with the updated retry count, and obtain the terminal connection result.
[0059] Based on the above embodiments, in this embodiment, after obtaining the abnormal connection attributes of the peer connection device, the terminal connection device also generates a terminal connection policy based on the abnormal connection attributes, and establishes a point-to-point terminal connection with the peer connection device based on the terminal connection policy to obtain the terminal connection result.
[0060] Optionally, when the terminal connection device determines that the error description information corresponds to the error description information when it has not received a connection request frame or other data packet (e.g., Nego resp packet, Nego Confirm packet, GO beacon, or P2P Resp frame) sent by the peer connection device, it determines the terminal connection strategy as the second connection strategy and adjusts the current connection channel or connection retrieval count based on the error description information corresponding to the second connection strategy. The second connection optimization measure is a connection optimization measure that adjusts the connection channel or connection retrieval count when the terminal connection device has not received a connection request frame or other data packet sent by the peer connection device. Optionally, the second connection optimization measure includes measures such as checking and / or switching the transmission channel, checking the GO working channel, and adjusting the connection retrieval count.
[0061] Optionally, after determining the second connection optimization measure, the terminal connection device adjusts the current connection channel (including the transmission channel and / or the GO working channel) based on the second connection optimization measure to switch the current connection channel to the correct transmission channel or the GO working channel supported by the peer connection device, thereby obtaining the target connection channel.
[0062] Optionally, the terminal connection device can also adjust the number of connection retries based on the second connection measure to obtain an updated number of retries, and then establish a terminal connection based on the target connection channel and / or the peer connection device with the updated number of retries to obtain a terminal connection result.
[0063] In this embodiment, when the terminal connection device determines that the terminal connection strategy is the second connection strategy, it adjusts the current connection channel based on the error description information corresponding to the second connection strategy to obtain the target connection channel; and / or, it adjusts the connection retrieval count based on the error description information corresponding to the second connection strategy to obtain the updated retrieval count; based on the target connection channel and / or the updated retrieval count, it establishes a terminal connection with the peer connection device to obtain the terminal connection result. This achieves dynamic adjustment of the connection channel or connection retrieval count of the terminal connection device according to the error description information to eliminate connection anomalies, thereby establishing a point-to-point connection with the peer connection device, improving connection stability and reliability, and increasing the connection success rate.
[0064] To better implement the terminal connection method in the embodiments of this application, based on the terminal connection method, the embodiments of this application also provide a terminal connection device, such as... Figure 5 As shown, Figure 5This is a schematic diagram of the structure of one embodiment of the terminal connection device provided in this application. Specifically, the terminal connection device 500 includes: The information acquisition module 501 is configured to receive a terminal connection request triggered by a peer connection device, acquire a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device. The attribute parsing module 502 is configured to determine the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame. The terminal connection module 503 is configured to generate a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attributes, establish a terminal connection with the peer connection device based on the terminal connection policy, and obtain a terminal connection result.
[0065] In one possible implementation of this application, the terminal connection device determines the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame, including: Parse the connection request frame to obtain the error description identifier in the connection request frame; If the error description identifier is the first description identifier, then the historical connection attributes in the connection request frame are obtained; The historical connection attributes are parsed to determine the abnormal connection attributes corresponding to the peer connection device.
[0066] In one possible implementation of this application, the terminal connection device parses the historical connection attributes to determine the abnormal connection attributes corresponding to the peer connection device, including: Parse the historical connection attributes to determine the historical connection identifier in the historical connection attributes; If the historical connection identifier is an abnormal connection identifier, then the field description information in the abnormal connection field of the historical connection attribute is read to obtain the abnormal connection attribute. The abnormal connection attribute includes any one or more of the first connection channel attribute, the second connection channel attribute, and error description information.
[0067] In one possible implementation of this application, the terminal connection device generates a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attribute, establishes a terminal connection with the peer connection device based on the terminal connection policy, and obtains a terminal connection result, including: Parse the abnormal connection attribute to obtain the error description information in the abnormal connection attribute; Access the connection optimization database and match the connection optimization measures corresponding to the error description information; Based on the connection optimization measures, a terminal connection strategy corresponding to the terminal connection request is generated. Based on the terminal connection strategy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0068] In one possible implementation of this application, the terminal connection device establishes a terminal connection with the peer connection device based on the terminal connection strategy and obtains a terminal connection result, including: Obtain the reconnection request frame corresponding to the terminal connection policy and send the reconnection request frame to the peer connection device. If a reconnection confirmation frame is received from the peer connection device based on the reconnection request frame, a terminal connection is established with the peer connection device based on the terminal connection strategy, and a terminal connection result is obtained.
[0069] In one possible implementation of this application, the terminal connection device establishes a terminal connection with the peer connection device based on the terminal connection strategy and obtains a terminal connection result, including: If the terminal connection strategy is the first connection strategy, then the target connection parameters are configured based on the error description information corresponding to the first connection strategy. Based on the target connection parameters, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0070] In one possible implementation of this application, the terminal connection device establishes a terminal connection with the peer connection device based on the terminal connection strategy and obtains a terminal connection result, including: If the terminal connection strategy is the second connection strategy, then the current connection channel is adjusted based on the error description information corresponding to the second connection strategy to obtain the target connection channel; And / or, adjust the number of connection retries based on the error description information corresponding to the second connection strategy to obtain the updated number of retries; Based on the target connection channel and / or the updated retry count, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0071] In this embodiment, the terminal connection device receives a terminal connection request triggered by a peer connection device, obtains a connection request frame carried in the connection request, and the connection request frame carries historical connection attributes recording the past terminal connection states of the peer connection device. Based on the historical connection attributes in the connection request frame, it determines the abnormal connection attributes of the peer connection device; based on the abnormal connection attributes, it generates a terminal connection policy corresponding to the terminal connection request; and based on the terminal connection policy, it establishes a terminal connection with the peer connection device to obtain a terminal connection result. This enables the device to obtain the connection request frame carried in the terminal connection request when establishing a WiFi P2P connection with a peer connection device, determine the abnormal connection attributes that caused the previous terminal connection failure on the peer connection device based on the historical connection attributes configured in the connection request frame, dynamically configure the terminal connection policy for the current terminal connection based on the abnormal connection attributes, and perform the terminal connection based on the terminal connection policy. This allows for the effective identification of reasons for past connection failures of the peer connection device during the terminal connection process, and the dynamic adjustment of the current terminal connection policy based on the reasons for connection failures to improve the terminal connection success rate.
[0072] This invention also provides a terminal connection device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of an embodiment of the terminal connection device provided in this application.
[0073] The terminal connection device integrates any of the terminal connection devices provided in the embodiments of the present invention, and the terminal connection device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor in the steps of the terminal connection method described in any of the embodiments of the above terminal connection method.
[0074] Specifically, the terminal connection device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 6 The terminal connection device structure shown does not constitute a limitation on the terminal connection device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 601 is the control center of the terminal connection device. It connects various parts of the terminal connection device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, it performs various functions and processes data of the terminal connection device, thereby providing overall monitoring of the terminal connection device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.
[0075] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and terminal connections by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal connection device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0076] The terminal connection device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0077] The terminal connection device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0078] Although not shown, the terminal connection device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the terminal connection device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 602 to realize various functions, as follows: Receive a terminal connection request triggered by a peer connection device, obtain a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device; The abnormal connection attributes of the peer connection device are determined based on the historical connection attributes in the connection request frame. Based on the abnormal connection attributes, a terminal connection policy corresponding to the terminal connection request is generated. Based on the terminal connection policy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0079] Therefore, embodiments of the present invention provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the terminal connection methods provided in the embodiments of the present invention. For example, the computer program loaded by the processor can execute the following steps: Receive a terminal connection request triggered by a peer connection device, obtain a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device; The abnormal connection attributes of the peer connection device are determined based on the historical connection attributes in the connection request frame. Based on the abnormal connection attributes, a terminal connection policy corresponding to the terminal connection request is generated. Based on the terminal connection policy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
[0080] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0081] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0082] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0083] The terminal connection method provided by the embodiments of this application has been described in detail above. Specific embodiments have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A terminal connection method, characterized in that, The terminal connection method includes: Receive a terminal connection request triggered by a peer connection device, obtain a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device; The abnormal connection attributes of the peer connection device are determined based on the historical connection attributes in the connection request frame. Based on the abnormal connection attributes, a terminal connection policy corresponding to the terminal connection request is generated. Based on the terminal connection policy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
2. The terminal connection method according to claim 1, characterized in that, Determining the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame includes: Parse the connection request frame to obtain the error description identifier in the connection request frame; If the error description identifier is the first description identifier, then the historical connection attributes in the connection request frame are obtained; The historical connection attributes are parsed to determine the abnormal connection attributes corresponding to the peer connection device.
3. The terminal connection method according to claim 2, characterized in that, The step of parsing the historical connection attributes to determine the abnormal connection attributes corresponding to the peer connection device includes: Parse the historical connection attributes to determine the historical connection identifier in the historical connection attributes; If the historical connection identifier is an abnormal connection identifier, then the field description information in the abnormal connection field of the historical connection attribute is read to obtain the abnormal connection attribute. The abnormal connection attribute includes any one or more of the first connection channel attribute, the second connection channel attribute, and error description information.
4. The terminal connection method according to claim 1, characterized in that, The process of generating a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attributes, establishing a terminal connection with the peer connection device based on the terminal connection policy, and obtaining a terminal connection result includes: Parse the abnormal connection attribute to obtain the error description information in the abnormal connection attribute; Access the connection optimization database and match the connection optimization measures corresponding to the error description information; Based on the connection optimization measures, a terminal connection strategy corresponding to the terminal connection request is generated. Based on the terminal connection strategy, a terminal connection is established with the peer connection device to obtain the terminal connection result.
5. The terminal connection method according to any one of claims 1-4, characterized in that, The step of establishing a terminal connection with the peer connection device based on the terminal connection strategy and obtaining the terminal connection result includes: Obtain the reconnection request frame corresponding to the terminal connection policy and send the reconnection request frame to the peer connection device. If a reconnection confirmation frame is received from the peer connection device based on the reconnection request frame, a terminal connection is established with the peer connection device based on the terminal connection strategy, and a terminal connection result is obtained.
6. The terminal connection method according to claim 5, characterized in that, The step of establishing a terminal connection with the peer connection device based on the terminal connection strategy and obtaining the terminal connection result includes: If the terminal connection strategy is the first connection strategy, then the target connection parameters are configured based on the error description information corresponding to the first connection strategy. Based on the target connection parameters, a terminal connection is established with the peer connection device to obtain the terminal connection result.
7. The terminal connection method according to claim 5, characterized in that, The step of establishing a terminal connection with the peer connection device based on the terminal connection strategy and obtaining the terminal connection result includes: If the terminal connection strategy is the second connection strategy, then the current connection channel is adjusted based on the error description information corresponding to the second connection strategy to obtain the target connection channel; And / or, adjust the number of connection retries based on the error description information corresponding to the second connection strategy to obtain the updated number of retries; Based on the target connection channel and / or the updated retry count, a terminal connection is established with the peer connection device to obtain the terminal connection result.
8. A terminal connection device, characterized in that, The terminal connection device includes: The information acquisition module is configured to receive a terminal connection request triggered by a peer connection device, acquire a connection request frame carried in the terminal connection request, and the connection request frame carries historical connection attributes that record the past terminal connection status of the peer connection device. The attribute parsing module is configured to determine the abnormal connection attributes of the peer connection device based on the historical connection attributes in the connection request frame. The terminal connection module is configured to generate a terminal connection policy corresponding to the terminal connection request based on the abnormal connection attributes, establish a terminal connection with the peer connection device based on the terminal connection policy, and obtain a terminal connection result.
9. A terminal connection device, characterized in that, The terminal connection device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the terminal connection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps of the terminal connection method according to any one of claims 1 to 7.