Method and device for determining disconnection cause, storage medium and electronic device
By sending an access request to a second wireless access access point with the same name as the target wireless access access point, and combining the physical address and working duration in the frame data, the reason for disconnection between the WIFI device and the wireless access access point is automatically determined. The problem of the judgment of disconnection reasons in the prior art depends on user participation, and automation and accuracy are achieved.
Patent Information
- Application Number
- CN202211510808.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-11-29
AI Technical Summary
In the prior art, the reason why the WIFI device and the router are disconnected can only be determined through user participation, and there is a lack of automation and accuracy solutions.
By sending an access request to a second wireless access access point with the same name as the target wireless access access point, establishing a connection and receiving frame data, including the physical address and working duration, combining similarity, time difference and working duration, automatically Determine the reason for the disconnection.
It realizes the automatic and accurate determination of the reason why WIFI devices and wireless access access points are disconnected without manual participation, improving user experience and device management efficiency.
Smart Images

Figure CN115955386B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method and device for determining a disconnection cause, a storage medium, and an electronic device. Background Art
[0002] With the development of Internet of Things technology, a large number of WIFI IoT devices have entered people's lives. The use scenario system of IoT devices mainly includes WIFI modules, routers, cloud and user terminals (such as mobile phones, etc.). Specifically, the device is connected to the wireless router network in the user's home through its own WIFI module, and relies on wireless communication to realize the control of the device by mobile phones and other network terminals.
[0003] When using a WIFI device, if the device is disconnected or fails to control, it is often related to the automatic restart or power outage of the user's home router. In particular, many current routers have similar automatic or intelligent automatic restart functions. Such problems will affect the user experience. The current way to determine whether the router is powered off is: the user confirms the power supply environment of the router or confirms it by comparing other devices that have also been powered off; the way to determine whether the router is restarted is: the user logs into the router management system to check whether there are related settings such as automatic restart. In other words, the reason for the disconnection between the WIFI device and the router can only be determined through user participation.
[0004] In view of the problem in the related technology that the reason for the disconnection between the WIFI device and the router can only be determined through user participation, no effective solution has been proposed. Summary of the invention
[0005] The embodiments of the present application provide a method and device for determining a disconnection cause, a storage medium, and an electronic device, so as to at least solve the problem in the related art that the disconnection cause between a WIFI device and a router can only be determined through user participation.
[0006] According to an embodiment of the present application, a method for determining a disconnection reason is provided, comprising: in a case where it is determined that a target device is disconnected from a first wireless access point, sending an access request to a second wireless access point having the same name as the first wireless access point; in a case where the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, receiving frame data sent by the second wireless access point, wherein the frame data comprises: a first physical address of the second wireless access point and a first working duration of the second wireless access point; determining a similarity between the first physical address and the second physical address of the first wireless access point, and determining a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device is disconnected from the first wireless access point; determining a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference, and the first working duration.
[0007] In an exemplary embodiment, determining the disconnection reason between the target device and the first wireless access point based on the similarity, the first time difference and the first working duration includes: determining a first size relationship between the similarity and a first preset threshold; when the first size relationship is used to indicate that the similarity is equal to the first preset threshold, determining a second size relationship between the first time difference and a second preset threshold, and a third size relationship between the first working time and the second working time, wherein the second working time is the working time of the first wireless access point before determining that the target device is disconnected from the first wireless access point; when the second size relationship indicates that the first time difference is less than or equal to the second preset threshold, and the third size relationship indicates that the second working time is less than the first working time, determining that the disconnection reason between the target device and the first wireless access point is that the first wireless access point is restarted.
[0008] In an exemplary embodiment, after determining a first size relationship between the similarity and a first preset threshold, the method further includes: when the first size relationship indicates that the similarity is less than the first preset threshold, determining that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
[0009] In an exemplary embodiment, before determining the second size relationship between the first time difference and the second preset threshold, the method further includes: determining multiple historical restart durations of the first wireless access point when performing a restart event, wherein the restart duration is used to indicate the duration from shutdown to restart of the first wireless access point; determining an average value of the multiple historical restart durations, and determining the second preset threshold based on the average value.
[0010] In an exemplary embodiment, sending an access request to a second wireless access point having the same name as the first wireless access point includes: acquiring a wireless access point list, and determining whether there is a second wireless access point having the same name as the first wireless access point in the wireless access point list; if the second wireless access point does not exist in the wireless access point list, determining a second time difference between a first time and a disconnection time, wherein the first time is used to indicate a time when it is determined that the second wireless access point does not exist in the wireless access point list; if the second time difference is greater than a second preset threshold, determining that a reason for disconnection between the target device and the first wireless access point is that the first wireless access point is powered off; and if the second time difference is less than or equal to the second preset threshold, sending an access request to the second wireless access point having the same name as the first wireless access point.
[0011] In an exemplary embodiment, after sending an access request to a second wireless access point having the same name as the first wireless access point, the method further includes: if the second wireless access point does not respond to the access request, determining a third time difference between a second time and the disconnection time, wherein the second time is used to indicate the time when it is determined that the second wireless access point does not respond to the access request; and if the third time difference is greater than a second preset threshold, determining that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
[0012] In an exemplary embodiment, after determining to receive the frame data sent by the second wireless access point, the method further includes: parsing the frame data to determine a first physical address of the second wireless access point according to a first field in the frame data, and determining a first operating duration of the second wireless access point according to a second field in the frame data.
[0013] According to another embodiment of the embodiment of the present application, a device for determining a disconnection reason is further provided, comprising: a sending module, configured to send an access request to a second wireless access point having the same name as the first wireless access point when it is determined that the target device is disconnected from the first wireless access point; a receiving module, configured to receive frame data sent by the second wireless access point when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, wherein the frame data comprises: a first physical address of the second wireless access point and a first working duration of the second wireless access point; a first determining module, configured to determine a similarity between the first physical address and the second physical address of the first wireless access point, and to determine a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device is disconnected from the first wireless access point; and a second determining module, configured to determine a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working duration.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for determining the disconnection cause when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the disconnection cause through the computer program.
[0016] In an embodiment of the present application, when it is determined that the target device is disconnected from the first wireless access point, an access request is sent to a second wireless access point with the same name as the first wireless access point; when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, frame data sent by the second wireless access point is received, wherein the frame data includes: a first physical address of the second wireless access point and a first working time of the second wireless access point; a similarity between the first physical address and the second physical address of the first wireless access point is determined, and a first time difference between a connection time and a disconnection time is determined, wherein the connection time is used to indicate whether the target device has established a connection with the second wireless access point. The disconnection time is used to indicate the time when the target device is disconnected from the first wireless access point; the disconnection reason between the target device and the first wireless access point is determined according to the similarity, the first time difference and the first working time; the above technical solution solves the problem that the disconnection reason between the WIFI device and the router can only be determined through user participation. In the embodiment of the present invention, the disconnection reason between the target device and the wireless access point is determined through the similarity between the first physical address of the second wireless access point and the second physical address of the first wireless access point, the first time difference between the connection time and the disconnection time, and the working time of the second wireless access point, without manual participation, and the disconnection reason between the target device and the wireless access point can be automatically and accurately determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 It is a hardware environment diagram of a method for determining a disconnection cause in an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for determining a disconnection cause according to an embodiment of the present application;
[0021] Figure 3 Schematic diagram of a method for determining a disconnection cause according to an embodiment of the present application
[0022] Figure 4 is a schematic diagram of a method for determining a disconnection cause according to an embodiment of the present application;
[0023] Figure 5 It is a structural block diagram of a device for determining a disconnection cause according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] According to one aspect of an embodiment of the present application, a method for determining a disconnection cause is provided. The method for determining a disconnection cause is widely used in smart home, smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for determining a disconnection cause can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0027] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0028] In this embodiment, a method for determining a disconnection reason is provided, which is applied to a computer terminal. Figure 2 : is a flowchart of a method for determining a disconnection cause according to an embodiment of the present application, the process comprising the following steps:
[0029] Step S202: When it is determined that the target device is disconnected from the first wireless access point, an access request is sent to a second wireless access point with the same name as the first wireless access point;
[0030] It should be noted that the first wireless access point and the second wireless access point may be routers.
[0031] Step S204: when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, receiving frame data sent by the second wireless access point, wherein the frame data includes: a first physical address of the second wireless access point and a first working duration of the second wireless access point;
[0032] It should be noted that when the router is working normally, it will periodically send 802.11 Beacon frames. The Timestamp in the Beacon frame is used to indicate the time (in microseconds) that the router has been working. The target device can receive the Beacon frame sent by the router. When the router is powered on or restarted, the Timestamp of the Beacon frame will be accumulated from 0. The rollback of the Timestamp of the Beacon frame means that the Timestamp of the Beacon frame becomes smaller. Therefore, you can determine whether the router has been restarted by comparing whether the Timestamps of the two received Beacon frames have rolled back.
[0033] Step S206, determining a similarity between the first physical address and the second physical address of the first wireless access point, and determining a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device disconnects from the first wireless access point;
[0034] Step S208: determining a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working duration.
[0035] Through the above steps, when it is determined that the target device is disconnected from the first wireless access point, an access request is sent to a second wireless access point with the same name as the first wireless access point; when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, frame data sent by the second wireless access point is received, wherein the frame data includes: a first physical address of the second wireless access point and a first working time of the second wireless access point; similarity between the first physical address and the second physical address of the first wireless access point is determined, and a first time difference between a connection time and a disconnection time is determined, wherein the connection time is used to indicate whether the target device has established a connection with the second wireless access point. The disconnection time is used to indicate the time when the target device is disconnected from the first wireless access point; the disconnection reason between the target device and the first wireless access point is determined according to the similarity, the first time difference and the first working time, which solves the problem that the disconnection reason between the WIFI device and the router can only be determined through user participation in the related art. In the embodiment of the present invention, the disconnection reason between the target device and the wireless access point is determined through the similarity between the first physical address of the second wireless access point and the second physical address of the first wireless access point, the first time difference between the connection time and the disconnection time, and the working time of the second wireless access point, without manual participation, and the disconnection reason between the target device and the wireless access point can be automatically and accurately determined.
[0036] In an exemplary embodiment, the above step S208 can be implemented by the following steps:
[0037] Step 1: Determine a first magnitude relationship between the similarity and a first preset threshold;
[0038] It can be understood that the first preset threshold is 100%, that is, whether the first physical address is consistent with the second physical address is determined according to the similarity between the first physical address of the second wireless access point and the second physical address of the first wireless access point, and then whether the second wireless access point and the first wireless access point are the same wireless access point is determined.
[0039] Step 2: when the first size relationship is used to indicate that the similarity is equal to the first preset threshold, determine a second size relationship between the first time difference and the second preset threshold, and a third size relationship between the first working time and the second working time, wherein the second working time is the working time of the first wireless access point before determining that the target device is disconnected from the first wireless access point;
[0040] It should be noted that the second preset threshold is determined by: determining multiple historical restart durations of the first wireless access point when executing a restart event, wherein the restart duration is used to indicate the duration from shutdown to restart of the first wireless access point; determining an average value of the multiple historical restart durations, and determining the second preset threshold based on the average value.
[0041] That is to say, the second preset threshold is the preset restart duration, and the preset restart duration is determined according to the average value of multiple historical restart durations when the wireless access point executes a restart event, thereby achieving the technical effect of accurately determining the preset restart duration.
[0042] It should be noted that a first time difference between a moment when a target device establishes a connection with the second wireless access point and a moment when the target device disconnects from the first wireless access point and a second preset threshold value are determined, thereby determining whether a duration for establishing a connection between the target device and the second wireless access point exceeds a preset restart duration; and a third size relationship between a first working time of the second wireless access point and a second working time of the first wireless access point is determined, thereby determining whether a rolling back of the working time of the second access point occurs.
[0043] Step 3: When the second size relationship indicates that the first time difference is less than or equal to the second preset threshold, and the third size relationship indicates that the second working duration is less than the first working duration, determine that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is restarted.
[0044] It is understandable that when the duration of establishing the connection between the target device and the second wireless access point does not exceed the preset restart duration and the working duration of the second access point is rolled back, it is determined that the first wireless access point has executed a restart event.
[0045] In an exemplary embodiment, after determining a first size relationship between the similarity and a first preset threshold, the following steps need to be performed: when the first size relationship indicates that the similarity is less than the first preset threshold, determining that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
[0046] That is, when the second wireless access point and the first wireless access point are not the same wireless access point, it is directly determined that the first wireless access point is powered off.
[0047] In an exemplary embodiment, the above step S202 can be implemented by the following steps:
[0048] Step 1: Obtain a wireless access point list, and determine whether there is a second wireless access point in the wireless access point list with the same name as the first wireless access point;
[0049] Step 2: when the second wireless access point does not exist in the wireless access point list, determine a second time difference between the first time and the disconnection time, wherein the first time is used to indicate the time when it is determined that the second wireless access point does not exist in the wireless access point list;
[0050] Step 3: When the second time difference is greater than a second preset threshold, determining that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off;
[0051] It is understandable that, when the preset restart time has expired and the first wireless access point has not been connected, it is determined that the first wireless access point is powered off.
[0052] Step 4: When the second time difference is less than or equal to the second preset threshold, send an access request to a second wireless access point having the same name as the first wireless access point.
[0053] It is understandable that, when the preset restart time has not expired and the first wireless access point has not been connected, an attempt is made to send an access request to a second wireless access point having the same name as the first wireless access point to determine whether the connected second wireless access point is the first wireless access point.
[0054] In an exemplary embodiment, after sending an access request to a second wireless access point having the same name as the first wireless access point, if the second wireless access point does not respond to the access request, a third time difference between a second time and the disconnection time is determined, wherein the second time is used to indicate the time when it is determined that the second wireless access point does not respond to the access request; and if the third time difference is greater than a second preset threshold, it is determined that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
[0055] It is understandable that, when the preset restart time has expired and the second wireless access point with the same name as the first wireless access point has not been connected, it is determined that the first wireless access point is powered off.
[0056] In an exemplary embodiment, after determining to receive the frame data sent by the second wireless access point, the method further includes: parsing the frame data to determine a first physical address of the second wireless access point according to a first field in the frame data, and determining a first operating duration of the second wireless access point according to a second field in the frame data.
[0057] It should be noted that the frame data sent by the second wireless access point includes: a first field and a second field, wherein the first field is used to indicate the first physical address of the second wireless access point, and the second field is used to indicate the first working duration of the second wireless access point.
[0058] To better understand the process of the method for determining the above disconnection cause, the implementation method flow of determining the above disconnection cause is described below in combination with an optional embodiment, but is not intended to limit the technical solution of the embodiment of the present application.
[0059] The embodiment of the present invention records the timestamp data in the Beacon frame sent by the router through the WIFI module of the target device, and detects whether the router has been restarted through a software algorithm. The overall architecture diagram is as follows: Figure 3 As shown:
[0060] The router sends an 802.11Beacon frame to the cloud platform / mobile phone's WIFI module, and the WIFI module sends the result of whether the router has been restarted to the cloud platform / mobile phone through a TCP connection.
[0061] In this embodiment, a method for determining the disconnection cause is provided. Figure 4 is a schematic diagram of a method for determining a disconnection cause according to an embodiment of the present application, such as Figure 4 As shown, the specific steps are as follows:
[0062] Step S401: successfully connect to router A;
[0063] Step S402: Setting a router restart detection time threshold T;
[0064] For example, in the embodiment of the present invention, T is set to 150 seconds, because the time from automatic restart or power-off startup to normal operation of most wireless access points (AP, ie, routers) does not exceed 150 seconds.
[0065] Step S403: Record the BSSID of router A = BSA (equivalent to the second working time in the above embodiment);
[0066] It should be noted that the BSSID represents the MAC address of the wireless access point, and is the unique physical identifier of the wireless access point.
[0067] Step S404: receiving the Beacon frame sent by router A;
[0068] Step S405: Parse the Beacon frame to determine the Beacon timestamp (BeaconTimestamp) TS1, and record the timestamp TS1 of router A (equivalent to the second working duration in the above embodiment);
[0069] It should be noted that BeaconTimestamp will start to accumulate from 0 when the AP is powered on or restarted.
[0070] Step S406: Determine whether to disconnect from router A. If disconnected, execute step S407; otherwise, execute steps S404-S406;
[0071] Step S407: Record the time T1 of disconnection from router A;
[0072] Step S408: Determine whether a router B with the same name as router A is scanned, and if a router B with the same name as router A is scanned, execute step S409, otherwise, always try to connect to router B with the same name as router A;
[0073] Step S409: record Flag=1;
[0074] Step S410: Determine whether the connection to router B is successful. If the connection to router B is successful, execute steps S411-S417; otherwise, execute steps S418-S419;
[0075] Step S411: record the BSSID of router B = BSB;
[0076] Step S412: receiving the Beacon frame sent by router B, parsing the Beacon frame to determine the Beacon timestamp (BeaconTimestamp) TS2, and recording the timestamp TS2 of router B (equivalent to the first working duration in the above embodiment);
[0077] Step S413: record time as T2;
[0078] Step S414: Determine whether BSA is equal to BSB. If BSA is equal to BSB, execute steps S415 to S416; otherwise, execute step S417;
[0079] Step S415: Determine whether TS2 is less than TS1, and whether T2-T1 is less than T;
[0080] Step S416: When TS2 is less than TS1 and T2-T1 is less than T, it is determined that router A has been restarted;
[0081] Step S417: Determine that router A is powered off;
[0082] Step S418: Determine whether the current time - T1 is greater than T. If it is determined that the current time - T1 is greater than T, execute step S419; otherwise, execute step S408;
[0083] Step S419: Determine whether router A has a power outage.
[0084] In an embodiment of the present invention, when it is determined that a target device is disconnected from a first wireless access point, an access request is sent to a second wireless access point having the same name as the first wireless access point; when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, frame data sent by the second wireless access point is received, wherein the frame data includes: a first physical address of the second wireless access point and a first working time of the second wireless access point; similarity between the first physical address and the second physical address of the first wireless access point is determined, and similarity between the connection time and the disconnection time is determined. a time difference; determining the disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working time, which solves the problem that the disconnection reason between the WIFI device and the router can only be determined through user participation in the related art. The embodiment of the present invention determines the disconnection reason between the target device and the wireless access point through the similarity between the first physical address of the second wireless access point and the second physical address of the first wireless access point, and determines the first time difference between the connection time and the disconnection time, and the working time of the second wireless access point. No human participation is required, and the disconnection reason between the target device and the wireless access point can be automatically and accurately determined.
[0085] 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 by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, 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 ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0086] Figure 5 is a structural block diagram of a device for determining a disconnection cause according to an embodiment of the present application; Figure 5 As shown, including:
[0087] A sending module 52, configured to send an access request to a second wireless access point having the same name as the first wireless access point when it is determined that the target device is disconnected from the first wireless access point;
[0088] The receiving module 54 is configured to receive frame data sent by the second wireless access point when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, wherein the frame data includes: a first physical address of the second wireless access point and a first working duration of the second wireless access point;
[0089] a first determining module 56, configured to determine a similarity between the first physical address and a second physical address of the first wireless access point, and to determine a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device disconnects from the first wireless access point;
[0090] The second determining module 58 is configured to determine a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working duration.
[0091] By means of the above-mentioned device, when it is determined that the target device is disconnected from the first wireless access point, an access request is sent to a second wireless access point with the same name as the first wireless access point; when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, frame data sent by the second wireless access point is received, wherein the frame data includes: a first physical address of the second wireless access point and a first working time of the second wireless access point; the similarity between the first physical address and the second physical address of the first wireless access point is determined, and a first time difference between the connection time and the disconnection time is determined, wherein the connection time is used to indicate whether the target device has established a connection with the second wireless access point. The disconnection time is used to indicate the time when the target device is disconnected from the first wireless access point; the disconnection reason between the target device and the first wireless access point is determined according to the similarity, the first time difference and the first working time, which solves the problem that the disconnection reason between the WIFI device and the router can only be determined through user participation in the related art. In the embodiment of the present invention, the disconnection reason between the target device and the wireless access point is determined through the similarity between the first physical address of the second wireless access point and the second physical address of the first wireless access point, the first time difference between the connection time and the disconnection time, and the working time of the second wireless access point, without manual participation, and the disconnection reason between the target device and the wireless access point can be automatically and accurately determined.
[0092] In an exemplary embodiment, the second determination module 58 is used to determine a first size relationship between the similarity and a first preset threshold; when the first size relationship is used to indicate that the similarity is equal to the first preset threshold, determine a second size relationship between the first time difference and a second preset threshold, and a third size relationship between the first working time and the second working time, wherein the second working time is the working time of the first wireless access point before determining that the target device is disconnected from the first wireless access point; when the second size relationship indicates that the first time difference is less than or equal to the second preset threshold, and the third size relationship indicates that the second working time is less than the first working time, determine that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is restarted.
[0093] In an exemplary embodiment, the second determining module 58 is configured to determine that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off when the first size relationship indicates that the similarity is less than the first preset threshold.
[0094] In an exemplary embodiment, the first determination module 56 is used to determine multiple historical restart durations of the first wireless access point when performing a restart event, wherein the restart duration is used to indicate the duration from shutdown to restart of the first wireless access point; determine an average value of the multiple historical restart durations, and determine the second preset threshold value based on the average value.
[0095] In an exemplary embodiment, the sending module 52 is used to obtain a wireless access point list and determine whether there is a second wireless access point with the same name as the first wireless access point in the wireless access point list; if the second wireless access point does not exist in the wireless access point list, determine a second time difference between the first time and the disconnection time, wherein the first time is used to indicate the time when it is determined that the second wireless access point does not exist in the wireless access point list; if the second time difference is greater than a second preset threshold, determine that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off; if the second time difference is less than or equal to the second preset threshold, send an access request to the second wireless access point with the same name as the first wireless access point.
[0096] In an exemplary embodiment, the second determination module 58 is used to determine a third time difference between the second time and the disconnection time when the second wireless access point does not respond to the access request, wherein the second time is used to indicate the time when it is determined that the second wireless access point does not respond to the access request; and when the third time difference is greater than a second preset threshold, it is determined that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
[0097] In an exemplary embodiment, the first determination module 56 is used to parse the frame data to determine the first physical address of the second wireless access point according to a first field in the frame data, and to determine the first operating duration of the second wireless access point according to a second field in the frame data.
[0098] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0099] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0100] S1, when it is determined that the target device is disconnected from the first wireless access point, sending an access request to a second wireless access point with the same name as the first wireless access point;
[0101] S2, when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, receiving frame data sent by the second wireless access point, wherein the frame data includes: a first physical address of the second wireless access point and a first working duration of the second wireless access point;
[0102] S3, determining a similarity between the first physical address and a second physical address of the first wireless access point, and determining a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device disconnects from the first wireless access point;
[0103] S4: Determine a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working duration.
[0104] An embodiment of the present application 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.
[0105] Optionally, 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.
[0106] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0107] S1, when it is determined that the target device is disconnected from the first wireless access point, sending an access request to a second wireless access point with the same name as the first wireless access point;
[0108] S2, when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, receiving frame data sent by the second wireless access point, wherein the frame data includes: a first physical address of the second wireless access point and a first working duration of the second wireless access point;
[0109] S3, determining a similarity between the first physical address and a second physical address of the first wireless access point, and determining a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device disconnects from the first wireless access point;
[0110] S4: Determine a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working duration.
[0111] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: 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, and other media that can store program codes.
[0112] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0113] Obviously, those skilled in the art should understand that the above modules or steps of the present application 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, and optionally, 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 from that herein, 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 application is not limited to any specific combination of hardware and software.
[0114] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for determining a disconnection cause, characterized in that: include: When it is determined that the target device is disconnected from the first wireless access point, sending an access request to a second wireless access point with the same name as the first wireless access point; In a case where the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, receiving frame data sent by the second wireless access point, wherein the frame data includes: a first physical address of the second wireless access point and a first working duration of the second wireless access point; Determine a similarity between the first physical address and a second physical address of the first wireless access point, and determine a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device disconnects from the first wireless access point; The reason for disconnection between the target device and the first wireless access point is determined according to the similarity, the first time difference and the first working duration.
2. The method for determining the disconnection cause according to claim 1, characterized in that: Determining a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference, and the first working duration includes: Determine a first magnitude relationship between the similarity and a first preset threshold; In a case where the first size relationship indicates that the similarity is equal to the first preset threshold, a second size relationship between the first time difference and the second preset threshold, and a third size relationship between the first working time and the second working time are determined, wherein the second working time is the working time of the first wireless access point before it is determined that the target device is disconnected from the first wireless access point; in a case where the second size relationship indicates that the first time difference is less than or equal to the second preset threshold, and the third size relationship indicates that the second working time is less than the first working time, it is determined that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is restarted.
3. The method for determining the disconnection cause according to claim 2, characterized in that: After determining a first magnitude relationship between the similarity and a first preset threshold, the method further includes: When the first size relationship indicates that the similarity is less than the first preset threshold, it is determined that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
4. The method for determining the disconnection cause according to claim 2, characterized in that: Before determining a second magnitude relationship between the first time difference and a second preset threshold, the method further includes: Determine a plurality of historical restart durations of the first wireless access point when executing a restart event, wherein the restart duration is used to indicate the duration from shutdown to restart of the first wireless access point; An average value of the plurality of historical restart durations is determined, and the second preset threshold is determined according to the average value.
5. The method for determining the disconnection cause according to claim 1, characterized in that: Sending an access request to a second wireless access point having the same name as the first wireless access point includes: Acquire a wireless access point list, and determine whether there is a second wireless access point with the same name as the first wireless access point in the wireless access point list; if the second wireless access point does not exist in the wireless access point list, determine a second time difference between the first time and the disconnection time, wherein the first time is used to indicate the time when it is determined that the second wireless access point does not exist in the wireless access point list; When the second time difference is greater than a second preset threshold, determining that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off; When the second time difference is less than or equal to the second preset threshold, an access request is sent to a second wireless access point having the same name as the first wireless access point.
6. The method for determining the disconnection cause according to claim 1, characterized in that: After sending an access request to a second wireless access point having the same name as the first wireless access point, the method further includes: In the case where the second wireless access point does not respond to the access request, determining a third time difference between a second time and the disconnection time, wherein the second time is used to indicate the time when it is determined that the second wireless access point does not respond to the access request; When the third time difference is greater than a second preset threshold, it is determined that the reason for the disconnection between the target device and the first wireless access point is that the first wireless access point is powered off.
7. The method for determining the disconnection cause according to claim 1, characterized in that: After determining to receive the frame data sent by the second wireless access point, the method further includes: The frame data is parsed to determine a first physical address of the second wireless access point according to a first field in the frame data, and a first operating duration of the second wireless access point according to a second field in the frame data.
8. A device for determining a disconnection cause, characterized in that: include: a sending module, configured to send an access request to a second wireless access point with the same name as the first wireless access point when it is determined that the target device is disconnected from the first wireless access point; a receiving module, configured to receive frame data sent by the second wireless access point when the second wireless access point responds to the access request so that the second wireless access point establishes a connection with the target device, wherein the frame data includes: a first physical address of the second wireless access point and a first working duration of the second wireless access point; a first determining module, configured to determine a similarity between the first physical address and a second physical address of the first wireless access point, and to determine a first time difference between a connection time and a disconnection time, wherein the connection time is used to indicate a time when the target device establishes a connection with the second wireless access point, and the disconnection time is used to indicate a time when the target device disconnects from the first wireless access point; The second determining module is configured to determine a disconnection reason between the target device and the first wireless access point according to the similarity, the first time difference and the first working duration.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Access method for wireless network and mobile terminal
CN106507289A
Method and device for connecting with equipment, electronic equipment and storage medium
CN113098972A