Key determination method, storage medium and electronic device

By using the AP currently communicating with the terminal to negotiate with the target AP in the Wi-Fi Mesh network to determine the target key, the problem of key negotiation delay of the terminal when switching the Mesh node is solved, reducing network delay and improving user experience.

CN119922540APending Publication Date: 2025-05-02ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311435973.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In Wi-Fi Mesh network, the terminal needs to negotiate the key with the Mesh node to be switched when switching Mesh nodes, resulting in extended switching time and network delay problems such as game delays and video stuttering.

Method used

When the mobile terminal joins the wireless grid Mesh network, the target key is determined through the AP (first AP) currently establishing a communication connection with the terminal, so that the terminal does not need to conduct key negotiation after switching to the target AP.

Benefits of technology

By negotiating and determining the target key in advance, the key negotiation time of terminals when switching between APs is reduced, network delay is reduced, and user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922540A_ABST
    Figure CN119922540A_ABST
Patent Text Reader

Abstract

Provided in an embodiment of the present invention are a key determination method, a storage medium and an electronic device, the key determination method comprising: when a mobile terminal joins a wireless mesh network, indicating a target wireless access point AP in the mesh network to negotiate with the mobile terminal through a first AP to determine a corresponding target key; wherein the first AP is an AP currently establishing communication connection with the mobile terminal in the Mesh network, and the target key corresponding to the target AP node is a key used when the target AP communicates with the mobile terminal after establishing communication connection with the mobile terminal. According to the invention, the problem that the terminal carries out Mesh node switching in the Mesh network is solved, and the technical effect that after the mobile terminal is switched from the first AP to the target AP, the negotiation of the target key is not needed is further achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communications, and in particular, to a key determination method, a storage medium, and an electronic device. Background Art

[0002] The most important purpose of Wireless Fidelity (Wi-Fi) mesh network (Mesh network for short) is to expand the wireless coverage. When a wireless terminal moves in the coverage area of ​​the Mesh network, the terminal needs to switch between different Mesh nodes. However, each time the terminal switches the Mesh node, it needs to negotiate the key with the Mesh node to be switched, which will prolong the switching time and make the terminal prone to network delay problems, such as game delays, video freezes, etc. Summary of the invention

[0003] The embodiments of the present invention provide a key determination method, a storage medium and an electronic device to at least solve the problem of a terminal performing Mesh node switching in a Mesh network in the related art.

[0004] According to one embodiment of the present invention, a key determination method is provided, comprising: when a mobile terminal joins a wireless mesh Mesh network, instructing a target wireless access point AP in the Mesh network to negotiate with the mobile terminal through a first AP to determine a corresponding target key; wherein the first AP is an AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key corresponding to the target AP node is the key used when the target AP communicates with the mobile terminal.

[0005] According to another embodiment of the present invention, a key determination method is also provided, including: when a mobile terminal joins a Mesh network, determining a target key corresponding to the target AP through negotiation between a first AP and a target AP in the Mesh network; wherein the first AP is an AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key is a key used when the mobile terminal communicates with the target AP.

[0006] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0007] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0008] Through the present invention, after the mobile terminal joins the wireless mesh Mesh network, the target AP in the Mesh network will negotiate with the mobile terminal through the first AP to determine the corresponding target key, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, thereby solving the problem of the terminal switching the Mesh node in the Mesh network. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 is a schematic diagram of a hardware structure block diagram of a mobile terminal according to a key determination method according to an embodiment of the present invention;

[0010] Figure 2 It is a timing diagram of Wi-Fi connection between mobile terminal and AP node;

[0011] Figure 3 is a schematic diagram of a scene according to an embodiment of the present invention;

[0012] Figure 4 is a flow chart of a key determination method according to an embodiment of the present invention;

[0013] Figure 5 is a schematic diagram of a scene according to another embodiment of the present invention;

[0014] Figure 6 is a timing diagram of roaming control right negotiation between a mobile terminal and a Mesh network according to an embodiment of the present invention;

[0015] Figure 7 is a schematic flow chart of a key determination method according to another embodiment of the present invention;

[0016] Figure 8 is a schematic flow chart of a key determination method according to another embodiment of the present invention;

[0017] Fig. 9 is a schematic diagram of a user interface according to an embodiment of the present invention;

[0018] Fig.10 is a schematic diagram of a structural block diagram of a key determination device according to an embodiment of the present invention;

[0019] Fig.11 is a schematic block diagram of a key determination device according to another embodiment of the present invention;

[0020] Fig.12is a schematic block diagram of a key determination device according to another embodiment of the present invention;

[0021] Fig.13 It is a schematic diagram of a structural block diagram of a key determination system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0022] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0024] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a schematic diagram of a hardware structure block diagram of a mobile terminal according to a key determination method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0025] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the key determination method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0026] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0027] For a better understanding, the following is a brief description of the relevant technologies:

[0028] Figure 2 It illustrates a series of interactions between a mobile terminal and an AP during the process of establishing a Wi-Fi connection. It should be noted that these interactions can all be completed in the air. Figure 2 The two processes of "start 4 way handshake" and "start group handshake" are the process of installing keys on the wireless access point (AP) side and the wireless LAN terminal device (STA) side respectively. This key is used to encrypt 802.11 data packets. Only after the key installation is completed, can IP addresses be allocated, Transmission Control Protocol (TCP) / User Datagram Protocol (UDP) communication and other services be carried out.

[0029] It should be noted that there are three protocols in the 802.11 protocol (802.11k, 802.11v, and 802.11r) that are all related to roaming, and these three protocols focus on different aspects. Among them, 802.11k focuses on the acquisition of air interface environment information and provides data support for roaming decision algorithms; 802.11v focuses on roaming control and is a protocol that specifically executes and guides roaming operations; 802.11r is also called fast transition (FT for short), which is used to simplify the handshake protocol and increase the roaming speed.

[0030] The current Mesh network is a tree structure. There is only one device in the entire network called the controller (i.e., the manager in the Mesh network), which is generally located at the root node of the tree; other nodes are called agents (i.e., agents, the executors in the Mesh network). The Controller is the manager of the network, and the other nodes are managed.

[0031] It should be noted that the current common roaming process can be described as follows:

[0032] 1. Connect your mobile phone to any node in the Wi-Fi Mesh network and start data services (voice / video, etc.).

[0033] 2. The mobile phone starts to move within the coverage area of ​​the Mesh network.

[0034] 3. At this time, the mobile phone itself chooses whether to disconnect from a hotspot and connect to another hotspot based on the threshold value.

[0035] There are two defects in the above switching process:

[0036] (1) The switching threshold of the mobile phone itself is often different from that of the Mesh network. When the mobile phone determines whether to switch, it can only consider fewer external factors.

[0037] (2) When using 802.11k switching, the mobile phone needs to renegotiate the installation key each time it reconnects to a new hotspot (i.e., the AP in the Mesh network). This will lengthen the entire connection process, which is reflected in the user's perception as game delays and video freezes.

[0038] It should be noted that Figure 3 The schematic diagram of the scenario of the present application is shown, and a Mesh network can be composed of several routers (APs), such as Figure 3As shown in the figure, there is a Controller (i.e., the main AP in the Mesh network) and two Agents, which exchange data in the Mesh network through the 1905 protocol. A mobile terminal can be connected to Agent1, and the interactive messages between the mobile terminal and Agent1 are messages defined by the 802.11 protocol.

[0039] In this embodiment, a key determination method running on a Mesh network is provided. Figure 4 FIG. 1 is a flow chart of a key determination method according to an embodiment of the present invention. Figure 4 As shown, the process may include the following step S402:

[0040] Step S402, when the mobile terminal joins the wireless mesh network, instructing a target wireless access point AP in the Mesh network to negotiate with the mobile terminal through a first AP to determine a corresponding target key;

[0041] It should be noted that the first AP is the AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key corresponding to the target AP node is the key used when the target AP communicates with the mobile terminal.

[0042] It should be noted that the first AP may be a Controller in the Mesh network or other Mesh nodes. If the mobile terminal currently establishes a communication connection with the Controller in the Mesh network, the first AP is the Controller in the Mesh network.

[0043] It should be noted that, during the process of establishing a communication connection between the target AP and the mobile terminal, the corresponding target key needs to be determined. After the target AP establishes a communication connection with the mobile terminal, when transmitting data between the target AP and the mobile terminal, the corresponding target key needs to be used to encrypt the transmitted data.

[0044] Through the above steps, after the mobile terminal joins the wireless mesh Mesh network, the target AP in the Mesh network will negotiate with the mobile terminal through the first AP to determine the corresponding target key, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, thereby solving the problem of the terminal switching the Mesh node.

[0045] The execution subject of the above step S402 may be a main AP in the Mesh network (ie, a controller in the Mesh network), etc., but is not limited thereto.

[0046] In an exemplary embodiment, before the above step S402, the method may also include: determining any AP in the Mesh network except the first AP as the target AP; or determining an AP in the Mesh network except the first AP whose distance to the mobile terminal is less than a preset distance as the target AP; or determining an AP designated by the target object in the Mesh network as the target AP.

[0047] That is to say, the controller (i.e., the main AP) can send key pre-negotiation requests to all online Agents. In special cases, the controller will send key pre-negotiation requests to one or several specific Agents. The judgment basis can be the Agents closest to the mobile phone, or the Agents specified by the user.

[0048] It should be noted that, before determining the target AP, the master AP needs to first determine the network structure of the Mesh network, and then determine the target AP for key pre-negotiation with the mobile terminal according to the network structure.

[0049] In an exemplary embodiment, the above step S402 may include: sending a key pre-negotiation instruction to the target AP, wherein the key pre-negotiation instruction is used to instruct the target AP to send a first message to the mobile terminal through the first AP, and generate a reference key according to a first random number, a pre-shared key, and a second random number generated by the mobile terminal in the second message when a second message sent by the mobile terminal is obtained through the first AP; sending a third message to the mobile terminal through the first AP, and determining the reference key as the target key when a fourth message sent by the mobile terminal in response to the third message is obtained through the first AP;

[0050] Among them, the first message carries at least a first random number generated by the target AP, the pre-shared key is a key pre-negotiated by the target AP and the mobile terminal, and the fourth message is used to instruct the mobile terminal to successfully decrypt the third message using the reference key generated by itself; after obtaining the first message, the mobile terminal generates the reference key according to the first random number, the pre-shared key and the second random number.

[0051] That is to say, after obtaining the key pre-negotiation instruction, the target AP may need to pre-negotiate the key with the mobile terminal. In an exemplary embodiment, the target AP generates a first random number and sends the first random number to the mobile terminal through a first message; after the mobile terminal obtains the first message, it will generate a second random number accordingly and send the second random number to the target AP through a second message; the target AP and the mobile terminal will respectively generate a reference key based on the first random number, the second random number and the pre-shared key; in order to verify the correctness of the reference key, the target AP will use the reference key to encrypt a message and send it to the mobile terminal. If the mobile terminal successfully decrypts the message using the reference key generated by itself, it means that the target key has been successfully negotiated and determined, and then the reference key is determined as the target key.

[0052] The following combination Figure 2 The "start 4 way handshake" in the figure is specifically explained. The pre-installed key node (i.e., the target AP) first sends a 1 / 4 eapol key 802.11i message. In order to be transmitted in the Mesh network, this message needs to be encapsulated into a 1905 protocol message first, and then transmitted to the node currently connected to the mobile terminal (i.e., the first AP). The 1905 encapsulation is removed at the node and sent to the mobile terminal. After receiving the message, the mobile terminal confirms that this is a pre-installed key behavior, generates its own key using the message content, and saves it separately. Then, it sends 2 / 4 eapol key 802.11i to the directly connected node (i.e., the first AP), which is encapsulated into a 1905 message by the directly connected node and transmitted to the pre-installed key node. The pre-installed key node also generates its own key. The encapsulation and decapsulation process of 3 / 4 and 4 / 4 eapol is the same as above. It should be noted that eapol stands for Extensible Authentication Protocol over LAN (eapol for short). eapol is a network authentication protocol used for identity authentication and key exchange in wireless local area networks (WLANs).

[0053] In an exemplary embodiment, the target AP interacts with the first AP via a first protocol, and the first AP interacts with the mobile terminal via a second protocol, wherein the first protocol is a protocol used for communication between APs in the Mesh network, and the second protocol is a protocol used for communication between the AP and the mobile terminal.

[0054] As an optional example, the first protocol is the 1905 protocol, and the second protocol is the 802.11 protocol. All messages interacting between the target AP and the mobile terminal need to pass through the first AP, that is, the target AP uses the 1905 protocol to send messages to the first AP, and the first AP then converts the 1905 protocol message into an 802.11 protocol message and sends it to the mobile terminal. Similarly, the mobile terminal uses the 802.11 protocol to send messages to the first AP, and the first AP then converts the 802.11 protocol message into a 1905 protocol message and sends it to the target AP. That is, the first AP needs to convert between 1905Message and 802.11message.

[0055] In an exemplary embodiment, after the above step S402, the method may further include: after a preset time, instructing the target AP to renegotiate with the mobile terminal to determine the corresponding target key, so that the target AP uses the newly determined target key to update the original target key.

[0056] That is to say, in this embodiment, after the target key is successfully installed, the Mesh master node will set a refresh period for the target key, and will re-initiate the key update operation in each refresh period, replacing the old key with the negotiated new key to ensure the security of the key.

[0057] In an exemplary embodiment, after the above step S402, the method may further include: instructing the target AP to delete the target key determined by negotiation with the mobile terminal when detecting that the mobile terminal leaves the Mesh network.

[0058] As an optional example, when the Mesh master node finds that the mobile terminal has left the Mesh network, it may request the target AP to delete all key information about the mobile terminal (the key information includes the target key) after a timeout period.

[0059] In an exemplary embodiment, the method may further include the following steps S11-S12:

[0060] Step S11: When the mobile terminal joins the wireless mesh network, a first request message is sent to the mobile terminal through the first AP, wherein the first request message is used to request the roaming control right of the mobile terminal;

[0061] Step S12: Determine whether the Mesh network has the roaming control right for the mobile terminal according to the first response message sent by the mobile terminal in response to the first request message.

[0062] It should be noted that since the switching threshold of the mobile terminal itself and the switching threshold of the Mesh network are often different, when the mobile terminal determines whether to switch alone, it can only consider fewer external factors; while the Mesh master node will consider more external factors at the same time when considering whether to switch, such as topology results, the quality of wireless links between nodes, etc. Therefore, the switching judgment made by the Mesh master node should be more comprehensive and accurate. Furthermore, in this embodiment, the Mesh master node can send a first request message to the mobile terminal to request roaming control of the mobile terminal.

[0063] In order to better understand the above steps S11-S12, the following Figure 5 and Figure 6 The following steps may be included:

[0064] Step 1: The Controller sends a control request message of the 1905 protocol to Agent 1 (i.e., the first AP);

[0065] The 1905 message sent by the Controller should include the following fields:

[0066] sourceMacAddress:XX:XX:XX:XX:XX:XX:XX The address of the controller sending the request;

[0067] targetMacAddress:XX:XX:XX:XX:XX:XX:XX mobile phone address requesting control;

[0068] action: 0 / 1, where 0: request to give up roaming control rights; 1: request to obtain roaming control rights;

[0069] Step 2: After receiving the control request message, Agent 1 removes the 1905 packet header information, extracts the values ​​of TargetMacAddress and Action, adds the header information of the 802.11 action frame, and sends the message to the mobile terminal (such as a mobile phone).

[0070] Step 3: After receiving the action frame, the mobile terminal checks the targetMacAddress and action, and replies to Agent 1 with a corresponding message requesting control using the 802.11 protocol according to the following conditions;

[0071] (1) If the mobile phone agrees to the controller's request: when action is 1, it temporarily shuts down its roaming-related logic and does not actively roam; if action is 0, it restores its roaming-related logic. It replies with an 802.11 action ack frame and the execution result is 0 (indicating success);

[0072] (2) If the mobile phone rejects the controller's request, it directly returns the 802.11 action ack result as 1 (indicating rejection).

[0073] Step 4: After receiving the 802.11 action Ack frame from the mobile phone, Agent 1 removes the 802.11 frame header information, adds the 1905 header information, and feeds the result back to the Controller.

[0074] In an exemplary embodiment, the method may further include steps S21-S23:

[0075] Step S21: when it is determined according to the first response message that the Mesh network has roaming control of the mobile terminal, and when it is detected that the signal strength of the signal sent by the mobile terminal is less than a first threshold and / or the signal quality of the signal is less than a second threshold, sending a second request message to the mobile terminal, wherein the signal quality is used to indicate the stability and interference degree of the signal, and the second request message is used to request to obtain information about the wireless network detected by the mobile terminal in the environment;

[0076] Step S22: when the wireless network information sent by the mobile terminal is acquired, determining a second AP from the Mesh network according to the wireless network information;

[0077] Step S23: Send a switching message to the mobile terminal, wherein the switching message carries an identifier of the second AP, and the switching message is used to instruct the mobile terminal to disconnect the communication connection established with the first AP and establish a communication connection with the second AP.

[0078] That is to say, in this embodiment, when it is determined according to the first response message that the Mesh network has the roaming control right of the mobile terminal, the Mesh network can perform roaming control on the mobile terminal according to the network status of the mobile terminal. Specifically, the Mesh master node will determine the roaming threshold of the mobile terminal. If the switching condition is met, the Mesh master node will require the mobile terminal to report the surrounding wireless environment / service set identifier (Service Set Identifier, referred to as SSID) (through the 802.11k protocol). The Mesh master node searches for a new node suitable for the mobile terminal to switch based on the reported situation. If found, 802.11v is used to guide the mobile terminal to connect to another node, and then the mobile terminal disconnects from the original node and connects to the new node.

[0079] In an exemplary embodiment, after the above step S402, the method may further include: in a case where it is determined that the target AP has successfully negotiated with the mobile terminal to determine the corresponding target key, sending an indication message to the target AP, wherein the indication information is used to instruct the target AP to determine whether the third request message carries pre-installation information when obtaining the third request message sent by the mobile terminal, and to send a second response message to the mobile terminal when the third request message carries the pre-installation information and the target AP has the target key; wherein the pre-installation information is used to indicate that the mobile terminal has the target key corresponding to the target AP, the third request message is used to request to establish a communication connection between the mobile terminal and the target AP, the second response message is used to indicate that the mobile terminal has successfully established a communication connection with the target AP, and the second response message carries indication information used to indicate that the target AP has the target key.

[0080] It should be noted that when the mobile terminal switches nodes, it will disconnect from the previous node (send a deauth frame), and then send an Association request frame to the new node. If the mobile terminal finds that it has negotiated the key with the target node in advance, it will add a key pre-installation message in the Associationy request frame, indicating that the mobile terminal is a pre-negotiated mobile phone, and select the corresponding key to install from the saved keys. If it is found that the target key corresponding to the target AP is not saved, a normal Association request frame is sent.

[0081] After the target AP has pre-negotiated the key with the mobile terminal, if the target AP obtains the Association request frame sent by the mobile terminal (i.e., the third request message mentioned above), it will first check whether there is key pre-installation information and detect its own saved keys. If the check is successful (i.e., there is key pre-installation information in the Association request frame and the corresponding target key is included in its own saved keys), a key installation flag is returned in the returned Association Response (i.e., the second response message mentioned above).

[0082] After receiving such an Association Response, the mobile terminal no longer attempts the four-way handshake, but directly uses the pre-installed key (i.e. the above-mentioned target key) to encrypt the data and then sends it out for direct data communication; if the Association Response received by the mobile terminal does not contain the key installed flag, the regular four-way handshake operation is started.

[0083] It should be noted that, since the mobile terminal does not need to negotiate a key after switching from the first AP to the target AP, the switching time of the mobile terminal between APs is reduced, thereby reducing the network delay of the mobile terminal.

[0084] It should be noted that, in this embodiment, a key determination method running on a mobile terminal is also provided. Figure 7 is a flow chart of a key determination method according to another embodiment of the present invention. Figure 7 As shown, the process may include the following step S702:

[0085] Step S702: When the mobile terminal joins the Mesh network, a target key corresponding to the target AP is determined through negotiation between the first AP and the target AP in the Mesh network;

[0086] It should be noted that the first AP is an AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key is a key used when the mobile terminal communicates with the target AP.

[0087] Through the above steps, after the mobile terminal joins the wireless mesh Mesh network, the mobile terminal will determine the corresponding target key through the first AP and the target AP in the Mesh network, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, which solves the problem of the terminal switching the Mesh node in the Mesh network.

[0088] The execution subject of the above step S702 may be a mobile terminal, etc., but is not limited thereto.

[0089] In an exemplary embodiment, the above step S702 may include: when the first AP obtains the first message sent by the target AP for requesting to negotiate with the mobile terminal to determine the corresponding target key, the first AP negotiates with the target AP to determine the target key corresponding to the target AP.

[0090] It should be noted that after the mobile terminal negotiates with the target AP through the first AP to determine the target key corresponding to the target AP, the mobile terminal will store the target key corresponding to the target AP.

[0091] In an exemplary embodiment, determining the target key corresponding to the target AP through negotiation between the first AP and the target AP may be implemented through the following steps S31-S34:

[0092] Step S31: Generate a second random number;

[0093] Step S32: Generate a reference key according to the first random number, the pre-shared key and the second random number, and send a second message to the target AP node, wherein the second message carries the second random number, the pre-shared key is a key pre-negotiated between the mobile terminal and the target AP, and the first message carries the first random number generated by the target AP;

[0094] Step S33: when a third message sent by the target AP node is acquired through the first AP, decrypting the third message using the reference key;

[0095] Step S34: When the third message is successfully decrypted, the reference key is determined as the target key, and a fourth message is sent to the target AP, wherein the fourth message is used to instruct the mobile terminal to successfully decrypt the third message using the reference key.

[0096] That is to say, after the target AP obtains the key pre-negotiation instruction, it needs to pre-negotiate the key with the mobile terminal. First, it sends a first message to the mobile terminal (the first message carries the first random number generated by the target AP). After the mobile terminal obtains the first message, it will generate a second random number accordingly, and then send the second random number to the target AP through the second message; then the target AP and the mobile terminal will respectively generate a reference key based on the first random number, the second random number and the pre-shared key. In order to verify the correctness of the reference key, the target AP will use the reference key to encrypt a message and send it to the mobile terminal. If the mobile terminal successfully decrypts the message using the reference key generated by itself, it means that the target key is successfully negotiated and determined, and then the reference key is determined as the target key.

[0097] In an exemplary embodiment, after the above step S704, the method may further include: when the mobile terminal leaves the Mesh network, deleting the target key corresponding to the target AP in the mobile terminal.

[0098] That is, in this embodiment, when the mobile terminal finally leaves the Mesh network, the mobile terminal will automatically delete the key information of all nodes in the Mesh network.

[0099] In an exemplary embodiment, the method may also include: in a case where a first request message sent by the Mesh network is obtained through the first AP, determining whether the Mesh network is allowed to perform roaming control on the mobile terminal, and sending a first response message to the Mesh network; wherein the first request message is used to request roaming control rights for the mobile terminal, and the first response message is used to indicate whether the Mesh network has roaming control rights for the mobile terminal.

[0100] As an optional example, after the mobile terminal obtains the first request message, the prompt message "Determine whether to allow the Mesh network to perform roaming control on the mobile terminal" can be displayed on the display of the mobile terminal. Then, when the first instruction is obtained through the display, it is determined that the Mesh network is allowed to perform roaming control on the mobile terminal. When the second instruction is obtained through the display, it is determined that the Mesh network is not allowed to perform roaming control on the mobile terminal.

[0101] In an exemplary embodiment, after the above-mentioned step S702, the method may further include: in a case where a second request message sent by the Mesh network is obtained through the first AP, detecting the wireless network in the environment where the mobile terminal is located, and sending the information of the detected wireless network to the Mesh network through the first AP, wherein the second request message is a message sent by the Mesh network when it is detected that the signal strength of the signal sent by the mobile terminal is less than a first threshold, and / or the signal quality of the signal is less than a second threshold; in a case where the Mesh network has roaming control over the mobile terminal and a switching message sent by the Mesh network is obtained through the first AP, disconnecting the communication connection established with the first AP, and establishing a communication connection with the target AP, wherein the switching message carries the identifier of the target AP.

[0102] That is to say, in this embodiment, the Mesh master node will determine the roaming threshold of the mobile terminal. If the switching condition is met, the Mesh master node will require the mobile terminal to report the surrounding wireless environment / SSID status (through the 802.11k protocol), and then the Mesh master node will search for a new node suitable for the mobile terminal to switch based on the reported situation. If found, 802.11v will be used to send a switching message to the mobile terminal to guide the mobile terminal to connect to another node. Then, when the mobile terminal obtains the switching message, it will disconnect the communication connection with the currently connected first AP and request to establish a communication connection with the target AP.

[0103] In an exemplary embodiment, the above-mentioned establishment of a communication connection with the target AP may be implemented by the following steps S41-S42:

[0104] Step S41: Sending a third request message to the target AP, wherein the third request message carries pre-installation information of a target key corresponding to the target AP, wherein the pre-installation information is used to indicate that the mobile terminal has the target key corresponding to the target AP, and the third request message is used to request to establish a communication connection between the mobile terminal and the target AP;

[0105] Step S42: when a second response message sent by the target AP is obtained, determining that a communication connection with the target AP is successfully established;

[0106] It should be noted that after obtaining the second response message sent by the target AP, the mobile terminal allows direct use of the target key to communicate with the target AP. The second response message is a message sent by the target AP when it is determined that the third request message carries the pre-installation information and the target AP has the target key.

[0107] It should be noted that, when the mobile terminal needs to establish a communication connection with the target AP, the mobile terminal will send an Association request frame (i.e., the third request message mentioned above) to the target AP. If the mobile terminal finds that it has negotiated the key with the target node in advance, it will add a key pre-installation message to the Association request frame, indicating that the mobile terminal is a pre-negotiated mobile phone, and selects to install the corresponding key from the saved keys. If it is found that the target key corresponding to the target AP is not saved, a normal Association request frame will be sent.

[0108] After the target AP has pre-negotiated the key with the mobile terminal, if the target AP obtains the Association request frame sent by the mobile terminal, it will first check whether there is key pre-installation information and detect its own saved keys. If the check is successful (that is, there is key pre-installation information in the Association request frame and the corresponding target key is included in its own saved keys), the key installation flag is returned in the returned Association Response (that is, the above-mentioned second response message).

[0109] After receiving such an Association Response, the mobile terminal no longer attempts the four-way handshake, but directly uses the pre-installed key (i.e. the above-mentioned target key) to encrypt the data and then sends it out to directly communicate data; if the Association Response received by the mobile terminal does not contain the key installed flag, the regular four-way handshake operation is started.

[0110] It should be noted that, since the mobile terminal does not need to negotiate a key after switching from the first AP to the target AP, the switching time of the mobile terminal between APs is reduced, thereby reducing the network delay of the mobile terminal.

[0111] It should be noted that, in this embodiment, a key determination method running on a target AP is also provided. Figure 8 is a flow chart of a key determination method according to another embodiment of the present invention. Figure 8 As shown, the process may include the following step S802:

[0112] Step S802: when a key pre-negotiation instruction sent by a master AP in the Mesh network is obtained, a target key is determined through negotiation between the first AP and the mobile terminal;

[0113] It should be noted that the first AP is the AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key is the key used by the target AP to communicate with the mobile terminal after establishing a communication connection with the mobile terminal.

[0114] The execution subject of the above step S802 may be a target AP, etc., but is not limited thereto.

[0115] It should be noted that the target AP is any AP other than the first AP in the Mesh network, or an AP other than the first AP in the Mesh network whose distance from the mobile terminal is less than a preset distance, or an AP designated by the target object in the Mesh network.

[0116] Through the above steps, after the mobile terminal joins the wireless mesh Mesh network, the target AP in the Mesh network will negotiate with the mobile terminal through the first AP to determine the corresponding target key, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, which solves the problem of the terminal switching the Mesh node in the Mesh network.

[0117] It should be noted that, since the mobile terminal does not need to negotiate a key after switching from the first AP to the target AP, the switching time of the mobile terminal between APs is reduced, thereby reducing the network delay of the mobile terminal.

[0118] In an exemplary embodiment, step S802 may be implemented in the following manner: sending a first message to the mobile terminal through a first AP, and generating a reference key according to a first random number, a pre-shared key, and a second random number generated by the mobile terminal in the second message when a second message sent by the mobile terminal is obtained through the first AP; sending a third message to the mobile terminal through the first AP, and determining the reference key as the target key when a fourth message sent by the mobile terminal in response to the third message is obtained through the first AP; wherein the first message carries at least a first random number generated by the target AP, the pre-shared key is a key pre-negotiated between the target AP and the mobile terminal, and the fourth message is used to instruct the mobile terminal to successfully decrypt the third message using the reference key generated by itself; after obtaining the first message, the mobile terminal generates the reference key according to the first random number, the pre-shared key, and the second random number.

[0119] In an exemplary embodiment, the method may further include: upon obtaining a key renegotiation instruction sent by the master AP, re-negotiating with the mobile terminal to determine a corresponding target key, and updating the original target key with the newly determined target key.

[0120] In an exemplary embodiment, the method may further include: in case of obtaining a key deletion instruction sent by the master AP, deleting the target key determined by negotiation with the mobile terminal.

[0121] In an exemplary embodiment, the method may also include: in a case where a third request message sent by the mobile terminal is obtained through the first AP, determining whether the third request message carries pre-installation information, and in a case where the third request message carries the pre-installation information and the target AP has the target key, sending a second response message to the mobile terminal; wherein the pre-installation information is used to indicate that the mobile terminal has the target key corresponding to the target AP, the third request message is used to request to establish a communication connection between the mobile terminal and the target AP, the second response message is used to indicate that the mobile terminal has successfully established a communication connection with the target AP, and the second response message carries indication information for indicating that the target AP has the target key.

[0122] To facilitate the understanding of the technical solution provided by the present invention, a detailed description will be given below in conjunction with embodiments of specific scenarios.

[0123] One of the most important purposes of Wi-Fi Mesh technology is to expand the wireless coverage. When a wireless terminal moves within the coverage of the Mesh network, the terminal needs to switch between different Mesh nodes (factors such as the distance, direction, and number of hops between the terminal and the Mesh node need to be considered). On the one hand, the switching process will cause delays, which will affect the user experience of ongoing real-time applications; on the other hand, the switching strategies on the AP side and the STA side have their own considerations, which leads to different roaming experiences for different terminals. The present invention uses a method for pre-negotiation between the terminal and the AP node to reduce delays during the switching process on the one hand, and unify the roaming strategies of different terminals on the other hand, thereby improving the user experience of users when roaming. The method described in the present invention can also be used as a part of the supplement to the EasyMesh protocol (Simple Mesh Protocol).

[0124] Optionally, taking a mobile terminal as a mobile phone as an example, the roaming control right negotiation process between the Mesh network and the mobile phone is as follows:

[0125] 1. The mobile phone is connected to the Mesh network, and the Controller is informed of the mobile phone connection;

[0126] 2. The Controller sends a roaming control negotiation request to the mobile phone. It should be noted that this request is sent in the Mesh network through the 1905 protocol. The 802.11 protocol is used from the directly connected node to the mobile phone. The 802.11 protocol content needs to be encapsulated using 1905 when transmitted in the Mesh network.

[0127] 3. After receiving the roaming control right negotiation request, the mobile phone can choose to retain or give up its control right and report its selection result to the controller.

[0128] The following combination Figure 6 The above interaction process is described in detail:

[0129] (1) The 1905 message sent by the Controller should include the following fields:

[0130] sourceMacAddress:XX:XX:XX:XX:XX:XX:XX The address of the controller sending the request;

[0131] targetMacAddress:XX:XX:XX:XX:XX:XX:XX mobile phone address requesting control;

[0132] action: 0 / 1, where 0: request to give up roaming control rights; 1: request to obtain roaming control rights.

[0133] (2) After receiving the message, Agent 1 removes the 1905 header information, extracts the TargetMacAddress and Action values, adds the header information of the 802.11action frame, and sends the message to the mobile phone.

[0134] (3) After receiving the action frame, the mobile phone checks the targetMacAddress and action. If the mobile phone agrees with the controller's request: when action is 1, it temporarily shuts down its roaming-related logic and does not actively roam; if action is 0, it restores its roaming-related logic and replies with an 802.11action ack frame with an execution result of 0 (indicating success). If the mobile phone rejects the controller's request, it directly returns an 802.11action ack result of 1 (indicating rejection).

[0135] (4) After receiving the 802.11 action Ack frame (action confirmation frame) from the mobile phone, Agent 1 removes the 802.11 frame header information, adds the 1905 header information, and feeds the result back to the controller.

[0136] Optionally, the key pre-negotiation process between the Mesh network and the mobile phone is as follows:

[0137] 1. The mobile phone connects to any device in the Mesh network (it can be connected to the controller or the agent) through the entire authentication process, association process, and key exchange process. At this time, a pair of keys is stored on the mobile phone and the node device.

[0138] 2. The mobile phone connection event reaches the Controller through the Mesh network. The Controller learns that a mobile phone is connected to the Mesh network for the first time. The communication channel used between Mesh nodes is the IEEE 1905 protocol.

[0139] 3. The controller transmits the pre-installed key for the newly added mobile phone to all other nodes through the IEEE 1905 protocol. It should be noted that the information transmission between Mesh nodes needs to use the 1905 protocol, and the key negotiation process needs to use the 802.11i protocol. The following is a description of the four-way handshake process transmitted between Mesh nodes:

[0140] (1) The pre-installed key node first sends a 1 / 4eapol key 802.11i message. In order to be transmitted in the Mesh network, this message needs to be encapsulated into a 1905 message and transmitted to the node to which the mobile phone is currently connected. The 1905 encapsulation is removed at the node and sent to the mobile phone.

[0141] (2) After receiving the message, the mobile phone confirms that this is a pre-installed key behavior, uses the message content to generate its own key, saves it separately, and then sends 2 / 4eapol key 802.11i to the directly connected node, which encapsulates it into a 1905 message and transmits it to the pre-installed key node. The pre-installed key node also generates its own key.

[0142] (3) The encapsulation and decapsulation process of 3 / 4 and 4 / 4eapol process is the same as above.

[0143] It should be noted that after the key exchange, the connection established between the mobile phone and all nodes is different in that only one of them is an actual connection, while all others are virtual connections. The difference lies in which set of keys the mobile phone and the router use to exchange.

[0144] 4. When the mobile phone finally leaves the Mesh network, it will automatically delete the key information of all nodes. When the Mesh master node finds that the mobile phone has left the Mesh network, after a timeout period, the master node requires all other nodes to delete all key information about this mobile phone.

[0145] 5. Each time a set of keys is successfully installed, the Mesh master node sets a refresh cycle for this set of keys. In each refresh cycle, the key update operation will be re-initiated to replace the old key with the negotiated new key to ensure the security of the key.

[0146] 6. By default, the controller will send key pre-negotiation requests to all online Agents. In special cases, the controller will send key pre-negotiation requests to one or several specific Agents. The judgment basis can be the Agents closest to the mobile phone, or the Agents specified by the user.

[0147] It should be noted that after the mobile phone is connected to any Mesh device for the first time, it can already start data services. After that, if the Mesh master node needs to install the key of each node in advance, this action is a background process and will not affect the normal business of the mobile phone.

[0148] Optionally, the roaming activation key process for the Mesh network and mobile phone is as follows:

[0149] 1. After the mobile phone moves, the controller calculates the node that the mobile phone is ready to connect to next, which is called the target node.

[0150] 2. After receiving the roaming command, the mobile phone checks that it has coordinated with the target node in advance and installed the key;

[0151] 3. The mobile phone disconnects from the previous node (sends a deauth frame), and then sends an Association request frame to the new node. If the mobile phone finds that it has negotiated the key with the target node in advance, it adds a key pre-installation message in the Association request frame, indicating that the mobile phone is a pre-negotiated mobile phone, and selects the corresponding key to install from the saved keys. If it is found that the target node has not been saved, a normal Association request frame is sent.

[0152] 4. After receiving the Association Request frame from the mobile phone, the target node first checks whether there is any key pre-installation information and checks its own saved key. If the check is successful, the key installation flag is returned in the returned Association Response.

[0153] 5. When the mobile phone receives such an Association Response, it no longer attempts the four-way handshake, but directly uses the pre-installed key to encrypt the data and sends it out, and directly conducts data communication; if the Association Response received by the mobile phone does not contain the key installed flag, the regular four-way handshake operation begins.

[0154] Optionally, the user interface on the mobile terminal may be as follows: Fig. 9 Two information displays can be added to the access list information sample column: (1) the key has been pre-installed / fast roaming is supported; (2) roaming control authority: Mesh AP or terminal.

[0155] It should be noted that in the present invention, after the mobile phone accesses the network, the Mesh network takes over the roaming operation, and the autonomous roaming function of the mobile phone can be temporarily disabled by negotiation. When the roaming function is completely taken over by the Mesh AP, more controllable roaming control functions can be implemented: such as more reasonable roaming decisions, more flexible roaming strategies, etc. (such as limiting the roaming range for a specific terminal, or alarming for roaming outside a specific range).

[0156] It should be noted that in the present invention, after the terminal is connected to any device in the Mesh network via WiFi, the Mesh network master node receives the event notification and requires all other Mesh nodes to connect to the terminal in advance to negotiate the key. Through this operation, each device in the Mesh will save a set of keys for the terminal, and the terminal will save the corresponding keys of all Mesh nodes. When the terminal roams, it only needs to interact with the AssociationRequest / Response once before it can start transmitting data without the need for key generation and installation.

[0157] It should be noted that, compared with the existing multi-device key installation solutions, the present invention uses the 1905 protocol to transmit information in multiple Mesh nodes, and encapsulates and decapsulates the 1905 protocol and the 802.11 protocol on the Mesh device directly connected to the mobile phone.

[0158] It should be noted that the use of the technology in the present invention can enable the Mesh network to have stronger control over terminals such as mobile phones and provide faster switching time during roaming.

[0159] It should be noted that the technical solution of the present invention can be combined with the roaming control function to limit the user's roaming area, such as terminal 1 can only be active on the first floor, and terminal 2 can only be active on the second floor. The Mesh master node can monitor the signal strength of the terminal and the location of the connected node. When the signal strength of the terminal is lower than a certain value, it can be determined whether the terminal is far away. Based on this, an electronic fence application based on a Wi-Fi Mesh network can be established, and the electronic fence based on Mesh can increase the monitoring range, etc.

[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory (ROM / RAM), a magnetic disk, or an optical disk), and can include a number of instructions to enable a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0161] In this embodiment, a key determination device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0162] Fig.10 is a schematic block diagram of a key determination device according to an embodiment of the present invention. Fig.10 As shown, the device may include:

[0163] The instruction module 102 is used to instruct a target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine a corresponding target key when the mobile terminal joins the Mesh network.

[0164] Among them, the first AP is the AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key corresponding to the target AP node is the key used by the target AP to communicate with the mobile terminal after establishing a communication connection with the mobile terminal.

[0165] Through the above-mentioned device, after the mobile terminal joins the wireless mesh Mesh network, the target AP in the Mesh network will negotiate with the mobile terminal through the first AP to determine the corresponding target key, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, which solves the problem of the terminal switching the Mesh node in the Mesh network.

[0166] Fig.11 is a schematic block diagram of a key determination device according to another embodiment of the present invention. Fig.11 As shown, the device may include:

[0167] The first determination module 112 is used to determine the target key corresponding to the target AP through negotiation between the first AP and the target AP in the Mesh network when the mobile terminal joins the Mesh network; wherein the first AP is the AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key is the key used by the mobile terminal to communicate with the target AP after establishing a communication connection with the target AP.

[0168] Through the above-mentioned device, after the mobile terminal joins the wireless mesh Mesh network, the mobile terminal will determine the corresponding target key through the first AP and the target AP in the Mesh network, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, which solves the problem of the terminal switching the Mesh node in the Mesh network.

[0169] Fig.12 is a schematic block diagram of a key determination device according to another embodiment of the present invention. Fig.12 As shown, the device comprises:

[0170] The second determination module 122 is used to determine the target key through negotiation between the first AP and the mobile terminal when a key pre-negotiation instruction sent by the main AP in the Mesh network is obtained; wherein the first AP is the AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key is the key used by the target AP to communicate with the mobile terminal after establishing a communication connection with the mobile terminal.

[0171] Through the above-mentioned device, after the mobile terminal joins the wireless mesh Mesh network, the target AP in the Mesh network will negotiate with the mobile terminal through the first AP to determine the corresponding target key, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, which solves the problem of the terminal switching the Mesh node in the Mesh network.

[0172] In this embodiment, a key determination system is also provided, which is used to implement the above embodiments and preferred implementation modes. Fig.13 is a schematic diagram of a structure block diagram of a key determination system according to an embodiment of the present invention. Fig.13 As shown, the system may include:

[0173] A master AP 132 in the Mesh network, configured to send a key pre-negotiation instruction to a target AP in the Mesh network when a mobile terminal joins the Mesh network;

[0174] The target AP 134 is used to determine the corresponding target key through the first AP through negotiation with the mobile terminal when the key pre-negotiation instruction is obtained;

[0175] The mobile terminal 136 is used to determine the target key corresponding to the target AP through negotiation between the first AP and the target AP when joining the Mesh network; wherein the first AP is the AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key corresponding to the target AP node is the key used by the target AP to communicate with the mobile terminal after establishing a communication connection with the mobile terminal.

[0176] Through the above system, after the mobile terminal joins the wireless mesh Mesh network, the target AP in the Mesh network will negotiate with the mobile terminal through the first AP to determine the corresponding target key, so that after the mobile terminal switches from the first AP to the target AP, there is no need to negotiate the key, which solves the problem of the terminal switching the Mesh node in the Mesh network.

[0177] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0178] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0179] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0180] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0181] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0182] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0183] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0184] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A key determination method, characterized in that: include: When the mobile terminal joins the wireless mesh Mesh network, instruct a target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine a corresponding target key; The first AP is an AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key corresponding to the target AP is a key used when the target AP communicates with the mobile terminal.

2. The method according to claim 1, characterized in that: Before instructing the target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine the corresponding target key, the method further includes: Determine any AP other than the first AP in the Mesh network as the target AP; or Determine an AP other than the first AP in the Mesh network and having a distance from the mobile terminal less than a preset distance as the target AP; or An AP designated by a target object in the Mesh network is determined as the target AP.

3. The method according to claim 1, characterized in that Instructing a target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine a corresponding target key, including: Sending a key pre-negotiation instruction to a target AP, wherein the key pre-negotiation instruction is used to instruct the target AP to send a first message to the mobile terminal through a first AP, and to generate a reference key according to a first random number, a pre-shared key, and a second random number generated by the mobile terminal in the second message when a second message sent by the mobile terminal is obtained through the first AP; sending a third message to the mobile terminal through the first AP, and to determine the reference key as the target key when a fourth message sent by the mobile terminal in response to the third message is obtained through the first AP; Among them, the first message carries at least a first random number generated by the target AP, the pre-shared key is a key pre-negotiated by the target AP and the mobile terminal, and the fourth message is used to instruct the mobile terminal to successfully decrypt the third message using the reference key generated by itself; after obtaining the first message, the mobile terminal generates the reference key according to the first random number, the pre-shared key and the second random number.

4. The method according to claim 3, characterized in that The target AP exchanges messages with the first AP through a first protocol, and the first AP exchanges messages with the mobile terminal through a second protocol, wherein the first protocol is a protocol used for communication between APs in the Mesh network, and the second protocol is a protocol used for communication between APs and mobile terminals.

5. The method according to claim 1, characterized in that: After instructing the target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine the corresponding target key, the method further includes: After a preset time, the target AP is instructed to re-negotiate with the mobile terminal to determine the corresponding target key, so that the target AP uses the newly determined target key to update the original target key.

6. The method according to claim 1, characterized in that After instructing the target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine the corresponding target key, the method further includes: In case of detecting that the mobile terminal leaves the Mesh network, the target AP is instructed to delete the target key determined by negotiation with the mobile terminal.

7. The method according to claim 1, characterized in that The method further comprises: When the mobile terminal joins the wireless mesh network, sending a first request message to the mobile terminal through the first AP, wherein the first request message is used to request the roaming control right of the mobile terminal; Determine whether the Mesh network has the roaming control right of the mobile terminal according to a first response message sent by the mobile terminal in response to the first request message.

8. The method according to claim 7, characterized in that The method further comprises: When it is determined according to the first response message that the Mesh network has the roaming control right of the mobile terminal and it is detected that the signal strength of the signal sent by the mobile terminal is less than a first threshold and / or the signal quality of the signal is less than a second threshold, sending a second request message to the mobile terminal, wherein the signal quality is used to indicate the stability and interference degree of the signal, and the second request message is used to request to obtain information about the wireless network detected by the mobile terminal in the environment in which it is located; In a case where the information of the wireless network sent by the mobile terminal is acquired, determining a second AP from the Mesh network according to the information of the wireless network; A handover message is sent to the mobile terminal, wherein the handover message carries an identifier of the second AP, and the handover message is used to instruct the mobile terminal to disconnect the communication connection established with the first AP and establish a communication connection with the second AP.

9. The method according to claim 1, characterized in that: After instructing the target wireless access point AP in the Mesh network to negotiate with the mobile terminal through the first AP to determine the corresponding target key, the method further includes: In the case where it is determined that the target AP successfully negotiates with the mobile terminal to determine the corresponding target key, sending indication information to the target AP, wherein the indication information is used to instruct the target AP to determine whether the third request message carries pre-installation information when obtaining the third request message sent by the mobile terminal, and to send a second response message to the mobile terminal when the third request message carries the pre-installation information and the target AP has the target key; Among them, the pre-installation information is used to indicate that the mobile terminal has a target key corresponding to the target AP, the third request message is used to request to establish a communication connection between the mobile terminal and the target AP, and the second response message is used to indicate that the mobile terminal has successfully established a communication connection with the target AP, and the second response message carries indication information for indicating that the target AP has the target key.

10. A key determination method, characterized in that: include: When a mobile terminal joins a Mesh network, a target key corresponding to the target AP is determined through negotiation between a first AP and a target AP in the Mesh network; The first AP is an AP in the Mesh network that currently establishes a communication connection with the mobile terminal, and the target key is a key used when the mobile terminal communicates with the target AP.

11. The method according to claim 10, characterized in that Determining a target key corresponding to the target AP through negotiation between the first AP and the target AP in the Mesh network includes: In a case where a first message sent by the target AP for requesting to negotiate with the mobile terminal to determine a corresponding target key is acquired through the first AP, the target key corresponding to the target AP is determined through negotiation between the first AP and the target AP.

12. The method according to claim 11, characterized in that Determining a target key corresponding to the target AP through negotiation between the first AP and the target AP includes: generating a second random number; Generate a reference key according to the first random number, the pre-shared key and the second random number, and send a second message to the target AP node, wherein the second message carries the second random number, the pre-shared key is a key pre-negotiated between the mobile terminal and the target AP, and the first message carries the first random number generated by the target AP; In a case where a third message sent by the target AP node is acquired through the first AP, decrypting the third message using the reference key; In case that the third message is successfully decrypted, the reference key is determined as the target key, and a fourth message is sent to the target AP, wherein the fourth message is used to instruct the mobile terminal to successfully decrypt the third message using the reference key.

13. The method according to claim 10, characterized in that After determining a target key corresponding to the target AP through negotiation between the first AP and the target AP in the Mesh network, the method further includes: When the mobile terminal leaves the Mesh network, the target key corresponding to the target AP is deleted in the mobile terminal.

14. The method according to claim 10, characterized in that The method further comprises: In a case where a first request message sent by the Mesh network is obtained through the first AP, determining whether to allow the Mesh network to perform roaming control on the mobile terminal, and sending a first response message to the Mesh network; The first request message is used to request the roaming control right of the mobile terminal, and the first response message is used to indicate whether the Mesh network has the roaming control right of the mobile terminal.

15. The method according to claim 10, characterized in that After determining a target key corresponding to the target AP through negotiation between the first AP and the target AP in the Mesh network, the method further includes: In the case where the second request message sent by the Mesh network is obtained through the first AP, the wireless network in the environment where the mobile terminal is located is detected, and the information of the detected wireless network is sent to the Mesh network through the first AP, wherein the second request message is a message sent by the Mesh network when it is detected that the signal strength of the signal sent by the mobile terminal is less than a first threshold value, and / or the signal quality of the signal is less than a second threshold value; When the Mesh network has roaming control rights for the mobile terminal and a switching message sent by the Mesh network is obtained through the first AP, the communication connection established with the first AP is disconnected, and a communication connection with the target AP is established, wherein the switching message carries an identifier of the target AP.

16. The method according to claim 15, characterized in that Establishing a communication connection with the target AP includes: Sending a third request message to the target AP, wherein the third request message carries pre-installation information of a target key corresponding to the target AP, wherein the pre-installation information is used to indicate that the mobile terminal has the target key corresponding to the target AP, and the third request message is used to request to establish a communication connection between the mobile terminal and the target AP; In case of obtaining a second response message sent by the target AP, determining that a communication connection with the target AP is successfully established; Among them, after obtaining the second response message sent by the target AP, the mobile terminal allows direct use of the target key to communicate with the target AP, and the second response message is the message sent by the target AP when it is determined that the third request message carries the pre-installation information and the target AP has the target key.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 9 are implemented, or the steps of the method described in any one of claims 10 to 16 are implemented.

18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of the method described in any one of claims 1 to 9, or implements the steps of the method described in any one of claims 10 to 16.