Method for discovering and binding OLT (Optical Line Terminal) equipment by mobile equipment in local area network

By scanning the QR code of the OLT device and automatically binding using the HTTP protocol and token parameters, the problem of cumbersome and inaccurate discovery and binding of OLT devices in the existing technology is solved, and an efficient and secure device binding process is achieved.

CN120378776APending Publication Date: 2025-07-25SHENZHEN C-DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510456026.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the discovery and binding methods of mobile devices and OLT devices are cumbersome, inaccurate, and inefficient in multi-device scenarios, and are difficult to efficiently handle in batch equipment deployment.

Method used

By scanning the QR code of the OLT device, obtaining device information, using HTTP protocol and token parameters for login verification, automatically comparing device information and binding, simplifying operation process, and improving security and efficiency.

Benefits of technology

It realizes that mobile devices can efficiently and securely discover and bind OLT devices within the LAN, simplify user operations, and improve binding efficiency and system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378776A_ABST
    Figure CN120378776A_ABST
Patent Text Reader

Abstract

The invention discloses a method for discovering and binding OLT (Optical Line Terminal) equipment by mobile equipment in a local area network, which comprises the following steps of: S1, scanning a two-dimensional code of the OLT equipment, acquiring equipment information, and inquiring whether the OLT equipment is bound or not; s2, if the OLT equipment is not bound, acquiring a local area network IP address allocated by the OLT equipment; s3, acquiring a unique access credential token parameter of the OLT equipment; s4, acquiring basic information of the OLT equipment, and comparing the basic information of the OLT equipment with the acquired equipment information; and S5, if the OLT device scanned by the mobile device is consistent with the OLT device connected through Wi-Fi, automatically binding with the OLT device based on the acquired token parameter. The OLT equipment can be efficiently and safely found and bound in the local area network, user operation is simplified, and binding efficiency and system safety are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of optical fiber communication, and particularly to a method for a mobile device in a local area network to discover and bind an OLT device. Background Art

[0002] With the popularization of optical fiber communication technology, optical line terminal (OLT) devices have become core devices in home and enterprise network deployments. In the prior art, there are the following problems with the method for a mobile device to discover and bind an OLT device: 1. The device binding process is cumbersome: Most devices rely on manual input or step-by-step operations to complete the binding. For example, users need to input the MAC address and serial number (SN number) of the device, resulting in a poor user experience. 2. Device discovery is inaccurate: The discovery of devices in a local area network usually relies on broadcast or multicast protocols (such as UPnP or mDNS), which may cause problems such as conflicts, delays, and even discovery failures in a complex network environment. 3. Poor adaptability to multi-device scenarios: Traditional binding methods are difficult to efficiently handle the discovery and binding of multiple devices, especially in scenarios of batch device deployment, with low efficiency. Summary of the Invention

[0003] The purpose of the present invention is to provide a method for a mobile device in a local area network to discover and bind an OLT device, which can efficiently and securely discover and bind an OLT device in a local area network, simplify user operations, and improve the binding efficiency and system security.

[0004] To achieve the above purpose, the following technical solutions are adopted: A method for a mobile device in a local area network to discover and bind an OLT device includes the following steps: S1: Scan the QR code of the OLT device to obtain device information, and based on the obtained device information, query whether the OLT device has been bound, where the device information includes the MAC address, SN number, Wi-Fi account, and Wi-Fi password; S2: If the OLT device has been bound, return the bound information. If the OLT device has not been bound, the mobile device connects to the Wi-Fi network of the OLT device based on the obtained Wi-Fi account and Wi-Fi password, and then obtains the local area network IP address assigned by the OLT device; S3: Based on the obtained IP address of the OLT device, the mobile device accesses the management interface of the OLT device through an HTTP request for login verification to obtain the unique access credential token parameter of the OLT device; S4: Based on the obtained token parameter, obtain the basic information of the OLT device, and compare the basic information of the OLT device with the obtained device information to determine whether the OLT device scanned by the mobile device is the same as the OLT device connected via Wi-Fi; S5: If the OLT device scanned by the mobile device is the same as the OLT device connected via Wi-Fi, automatically bind with the OLT device based on the obtained token parameter. Further, the specific steps of S1 are as follows: S11: Scan the QR code of the OLT device and parse the QR code to obtain the device model, encryption version number, and encryption information of the OLT device; S12: Based on the obtained encryption version number, select the corresponding decryption algorithm to decrypt the encryption information to obtain the device information; S13: Use the GET request of the HTTP protocol to call the OLT device binding status interface and send the request parameters in JSON format to the background to query the binding status. Among them, the request parameters include the MAC address and SN number of the OLT device; S14: Based on the pre-stored OLT device binding information database in the background, use SQL statements to query whether the MAC address and SN number transmitted by the mobile device are the same as the information stored in the OLT device in the database. If they are not the same, return the information that the device does not exist. If they are the same, query the binding status information of the OLT device; S15: If the queried binding status information of the OLT device is empty, return the unbound information. If the queried binding status information of the OLT device is already bound, return the bound information.

[0005] Further, in S2, use the getLocalIpAddress() method to obtain the LAN IP address assigned by the OLT device.

[0006] Further, the specific steps of S3 are as follows: S31: The mobile device sends an HTTP POST request to the login interface of the OLT device. In the request, a request parameter body in JSON format will be sent. Among them, the request parameter body includes module parameters, administrator account, and administrator password; S32: Based on the received POST request, the OLT device performs a correctness check according to the administrator account and administrator password, and returns the response data in JSON format to the mobile device. Among them, the response data includes the following fields: Error code: Used to identify the processing result of the request; Description information: Used to briefly describe the processing result; Data body: Includes the token parameter.

[0007] Further, S4 specifically includes the following steps: S41: The mobile device obtains the basic information of the OLT device through a GET request of the HTTP protocol. Among them, the request parameters include module parameters and token parameters; S42: Based on the received GET request, the OLT device returns JSON data containing the basic information of the device to the mobile device. Among them, the JSON data includes the following fields: Error code: Used to identify the processing result of the request; Description information: Used to briefly describe the processing result; Data body: Includes the basic information of the device. Among them, the basic information includes the device model, MAC address, SN number, hardware version, and software version; S43: The mobile device compares the MAC address of the OLT device obtained through the GET request with the MAC address obtained by scanning the QR code before for consistency.

[0008] Further, S5 specifically includes the following steps: S51: The mobile device sends an HTTP POST request in JSON format to the OLT device for device binding operation. Among them, the request parameters include module parameters, token parameters, and the server serverUrl; S52: Based on the received POST request, the OLT device binds the device to the background server corresponding to serverUrl and returns the corresponding JSON data to the mobile device. Among them, the JSON data includes: Error code: Used to identify the result of the binding operation; Description information: Used to briefly describe the binding result; Data body: Includes the specific data of the binding operation.

[0009] Adopting the above solution, the beneficial effects of the present invention are: 1) Simple and easy to use: This method uses the way of scanning the QR code by the mobile device, enabling users to easily discover and bind the OLT device without cumbersome network configuration and operations, and providing a good user experience; 2) High security: This method includes encrypted information in the QR code and requires login authentication, which can improve the security of the overall process data and effectively protect user privacy and data security; 3) Efficient and fast: After scanning the QR code and connecting to the OLT device Wi-Fi, this method will automatically connect and bind the OLT device without the need for users to perform complex network configuration and waiting processes, improving the binding efficiency. Description of the Drawings

[0010] Figure 1 This is a flowchart of the method of the present invention. Specific embodiments

[0011] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0012] Referring to Figure 1 As shown, the present invention provides a method for a mobile device in a local area network to discover and bind to an OLT device, including the following steps: S1: Scan the QR code of the OLT device to obtain device information, and based on the obtained device information, query whether the OLT device has been bound, where the device information includes the MAC address, SN number, Wi-Fi account, and Wi-Fi password.

[0013] The S1 specifically includes the following steps: S11: Scan the QR code of the OLT device and parse the QR code to obtain the device model, encryption version number, and encryption information of the OLT device; S12: Based on the obtained encryption version number, select the corresponding decryption algorithm to decrypt the encryption information to obtain the device information; S13: Use the GET request of the HTTP protocol to call the OLT device binding status interface and send the request parameters in JSON format to the background to query the binding status, where the request parameters include the MAC address and SN number of the OLT device; S14: The background, based on the pre-stored OLT device binding information database, uses SQL statements to query whether the MAC address and SN number transmitted by the mobile device are consistent with the information stored in the OLT device in the database. If they are inconsistent, it returns device non-existence information. If they are consistent, it queries the binding status information of the OLT device; S15: If the queried binding status information of the OLT device is empty, it returns unbound information. If the queried binding status information of the OLT device is already bound, it returns bound information.

[0014] The mobile device is loaded with an APP for discovering and binding OLT devices. In this step, the user first opens the APP on the mobile device and scans the QR code of the OLT device. After parsing this QR code, the device model, encryption version number, and encryption information of the current OLT are obtained. Among them, the device model indicates which model the OLT device belongs to, and the encryption version number indicates which type of encryption method is used. Different encryption version numbers use different encryption methods. When the encryption technology needs to be upgraded, the encryption version number is synchronously increased; the QR code encrypts the device information using the encryption method corresponding to the encryption version number. The APP can select different decryption algorithms to decrypt the encryption information according to different encryption version numbers, so that the specific encryption algorithm does not need to be exposed, ensuring the security of the overall encryption and decryption process of the device and the APP, and at the same time facilitating the subsequent update of the encryption method; after decrypting the encryption information using the agreed encryption and decryption algorithm, the APP can obtain device information such as the MAC (MAC address), SN (serial number), Wi-Fi account, and password of the current OLT device.

[0015] After obtaining the device information of the OLT, the APP uses an HTTP GET request to query the device binding status interface (the request URL is https: / / baseUrl.com / v1 / cms / device / isExist), and sends the request parameters in JSON format ({"identityList":["E0:56:B2:7B:11:F2","DA18-2211003311"]}), that is, the MAC address and SN number of the OLT device to the background to query the binding status; the background uses the database to pre-store the device binding table of all OLT devices, and the fields include device ID, MAC address, SN number, and device binding status; when the background receives the MAC address and SN number sent by the APP, the background uses SQL statements to query whether the MAC address and SN number information transmitted by the APP is consistent with the information stored in the database to ensure the authenticity of the data; subsequently, the background returns the return parameters in JSON format, and the return parameters include the error code code, return data data, and error information msg ({"code":0,"data":{},"msg":""}), which are specifically divided into the following situations: When the MAC address and SN number information received by the background for the GET request is inconsistent, relevant data indicating that the device does not exist is returned to the APP (that is, the error code code = 240001, data = null, msg = device does not exist); If they are consistent, query the binding status information of the OLT device; if the query result of the binding status is empty, it means the device is not bound, and the background returns the 'not bound' status to the APP (i.e., error code code = 0, data = {"bindState": false, "deviceId": xxxxxxx, "mac": xxxxxx, "sn": xxxxxx,...}, msg = null); If the query result is not empty and the device status is 'bound', return the bound device data to the APP (i.e., error code code = 0, data = {"bindState": true, "deviceId": xxxxxxx, "mac": xxxxxx, "sn": xxxxxx,...}, msg = null); The APP makes corresponding processing according to the binding status information returned by the background. In the case of not being bound, it will parse out the Wi-Fi account and Wi-Fi password of the OLT device from the QR code and prompt the user to connect to the Wi-Fi local area network of the OLT device. In other cases, corresponding prompt processing will be done.

[0016] S2: If the OLT device is bound, return the bound information; if the OLT device is not bound, the mobile device connects to the Wi-Fi network of the OLT device based on the obtained Wi-Fi account and Wi-Fi password, and then obtains the local area network IP address assigned by the OLT device.

[0017] In the above S2, the local area network IP address assigned by the OLT device is obtained through the getLocalIpAddress() method.

[0018] When the user connects to the local area network of the OLT device according to the Wi-Fi account and Wi-Fi password, the APP calls the system's Wi-Fi connection API to automatically connect to the Wi-Fi network of the OLT device; after connecting to the Wi-Fi of the OLT device, the APP obtains the local area network IP address assigned by the OLT device through methods such as getLocalIpAddress(). Once the IP address is obtained, the APP will access the management interface of the OLT device through an HTTP request for login verification.

[0019] S3: Based on the obtained IP address of the OLT device, the mobile device accesses the management interface of the OLT device through an HTTP request for login verification to obtain the unique access credential token parameter of the OLT device.

[0020] The above S3 specifically includes the following steps: S31: The mobile device sends an HTTP POST request to the login interface of the OLT device. In the request, a request parameter body in JSON format is sent, where the request parameter body includes module parameters, an administrator account, and an administrator password. S32: Based on the received POST request, the OLT device performs a correctness check according to the administrator account and the administrator password, and returns response data in JSON format to the mobile device. The response data includes the following fields: Error code: Used to identify the processing result of the request. Description information: Used to briefly describe the processing result. Data body: Includes a token parameter.

[0021] In this step, the APP sends an HTTP POST request (the request URL is http: / / localIp / cgi-bin?module=sys_login) to the login interface of the OLT device, and sends a request parameter body in JSON format ("module": "sys_login", "username": xxxxxx, "password": xxxxxx), that is, the module parameter module, the administrator account username, and the administrator password password to the OLT device. After receiving the POST request, the OLT device performs a correctness check according to the administrator account and the administrator password, and returns corresponding data in JSON format to the APP. The returned parameters include an error code code, a description information description, and a data body data ({"code": 0, "description": "success", "data": {}}). Specifically: If the verification fails, relevant JSON data indicating login failure is returned to the APP (such as {"code": 1, "description": "fail", "data": null}); If the verification passes, relevant JSON data indicating login success is returned to the APP (such as {"code": 0, "description": "success", "data": {"token": xxxxxxxxxxx, "username": xxxx,...}}); The APP uses the token parameter returned by the device as the sole credential for login verification.

[0022] S4: Based on the obtained token parameter, obtain the basic information of the OLT device, and compare the basic information of the OLT device with the obtained device information to determine whether the OLT device scanned by the mobile device is the same as the OLT device connected via Wi-Fi.

[0023] The specific steps of S4 are as follows: S41: The mobile device obtains the basic information of the OLT device through a GET request of the HTTP protocol, where the request parameters include the module parameter and the token parameter. S42: Based on the received GET request, the OLT device returns JSON data containing the basic device information to the mobile device. The JSON data includes the following fields: Error code: Used to identify the processing result of the request. Description information: Used to briefly describe the processing result. Data body: Includes the basic information of the device. The basic information includes the device model, MAC address, SN number, hardware version, and software version. S43: The mobile device compares the MAC address of the OLT device obtained through the GET request with the MAC address obtained by scanning the QR code before.

[0024] In this step, after the APP obtains the access credential token of the device, it uses HTTP to send a GET request to obtain the basic information of the current device (the request URL is http: / / localIp / cgi-bin?module=sys_dev_info). The GET request parameters are the module parameter module and the access credential token (i.e., {"module": "sys_dev_info", "token": xxxxxx}). After receiving this GET request, the device will return JSON data related to the device to the APP. The returned parameters include the error code code, description information description, and data body data ({"code": 0, "description": "success", "data": {}}). Among them, the data body data contains information such as the device model devType, MAC, SN, hardware version hardware, and software version software (i.e., "data": {"devType": xxx, "MAC": xxxxxx, "snNum": xxxxxxxx, "hardware": 1.0, "software": 1.2,...}).

[0025] At this time, compare the MAC information obtained by the GET request with the MAC address information in the QR code for consistency; if the two values are the same, it is determined that the scanned device and the connected device are the same device, and the next step can be carried out; if the two values are different, it means that the scanned device and the connected device are not the same device, and at this time, the user will be prompted "Device inconsistent" to avoid incorrect binding.

[0026] S5: If the OLT device scanned by the mobile device is the same as the OLT device connected via Wi-Fi, automatically bind to the OLT device based on the obtained token parameter. The specific steps of S5 are as follows: S51: The mobile device sends an HTTP POST request in JSON format to the OLT device for device binding operation. Among them, the request parameters include module parameters, token parameters, and the server serverUrl; S52: Based on the received POST request, the OLT device binds the device to the background server corresponding to serverUrl and returns the corresponding JSON data to the mobile device. The JSON data includes: Error code: used to identify the result of the binding operation; Description information: used to briefly describe the binding result; Data body: includes the specific data of the binding operation.

[0027] In this step, when the devices are the same, the APP automatically sends an HTTP POST request to bind the device (the request URL is http: / / localIp / cgi-bin?module=sys_connect), and the POST request parameters are in JSON format, including the module parameter module, the access credential token, and the server serverUrl (i.e., {"module":"sys_connect","token":xxxxxxxxxx,"serverUrl":xxxxxxxxxx}). After receiving this POST request, the device will be automatically bound to the background server corresponding to serverUrl and return the corresponding JSON data to the APP. The returned parameters include the error code code, the description information description, and the data body data ({"code":0,"description":"success","data":{}}). Specifically: If the binding is successful, return the successful JSON data to the APP (such as {"code":0,"description":"success","data":null,}); If the binding fails, the relevant JSON data of the binding failure is returned to the APP (such as {"code": 5, "description": "fail", "data": null}); Among them, different error codes represent different reasons for the binding failure. The APP can give a prompt on the APP page according to the corresponding error information and let the user retry the binding process.

[0028] In summary, the present invention realizes the function of discovering and binding the OLT device through the mobile device APP. Without the need for other devices or additional protocol access, the device discovery and binding process is completed quickly and securely using the HTTP protocol, improving the user experience. At the same time, the QR code encryption and the request to obtain the unique access credential of the OLT device ensure the security of data transmission.

[0029] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for a mobile device in a local area network to discover and bind to an OLT device, characterized in that, It includes the following steps: S1: Scan the QR code of the OLT device to obtain device information, and based on the obtained device information, query whether the OLT device has been bound. Among them, the device information includes the MAC address, SN number, Wi-Fi account, and Wi-Fi password; S2: If the OLT device has been bound, return the bound information. If the OLT device has not been bound, the mobile device connects to the Wi-Fi network of the OLT device based on the obtained Wi-Fi account and Wi-Fi password, and then obtains the LAN IP address assigned by the OLT device; S3: Based on the obtained IP address of the OLT device, the mobile device accesses the management interface of the OLT device through an HTTP request for login verification to obtain the unique access credential token parameter of the OLT device; S4: Based on the obtained token parameter, obtain the basic information of the OLT device, and compare the basic information of the OLT device with the obtained device information to determine whether the OLT device scanned by the mobile device is consistent with the OLT device connected through Wi-Fi; S5: If the OLT device scanned by the mobile device is consistent with the OLT device connected through Wi-Fi, automatically bind with the OLT device based on the obtained token parameter.

2. The method for a mobile device within a local area network to discover and bind to an OLT device according to claim 1, wherein, The specific steps of S1 are as follows: S11: Scan the QR code of the OLT device and parse the QR code to obtain the device model, encryption version number, and encryption information of the OLT device; S12: Based on the obtained encryption version number, select the corresponding decryption algorithm to decrypt the encryption information to obtain the device information; S13: Use the GET request of the HTTP protocol to call the OLT device binding status interface and send the request parameters in JSON format to the background to query the binding status. Among them, the request parameters include the MAC address and SN number of the OLT device; S14: The background, based on the pre-stored OLT device binding information database, uses SQL statements to query whether the MAC address and SN number transmitted by the mobile device are consistent with the information stored in the OLT device in the database. If they are inconsistent, return the device does not exist information. If they are consistent, query the binding status information of the OLT device; S15: If the queried binding status information of the OLT device is empty, return the unbound information. If the queried binding status information of the OLT device is bound, return the bound information.

3. The method for a mobile device within a local area network to discover and bind to an OLT device according to claim 1, wherein In S2, the LAN IP address assigned by the OLT device is obtained through the getLocalIpAddress() method.

4. The method for a mobile device within a local area network to discover and bind to an OLT device according to claim 1, characterized in that, The specific steps of S3 are as follows: S31: The mobile device sends an HTTP POST request to the login interface of the OLT device. In the request, a request parameter body in JSON format will be sent. Among them, the request parameter body includes module parameters, administrator account, and administrator password; S32: The OLT device, based on the received POST request, performs correctness verification according to the administrator account and administrator password, and returns the response data in JSON format to the mobile device. Among them, the response data includes the following fields: Error code: used to identify the processing result of the request; Description information: used to briefly describe the processing result; Data body: includes the token parameter.

5. The method for a mobile device within a local area network to discover and bind to an OLT device according to claim 1, wherein Step S4 specifically includes the following steps: S41: The mobile device obtains the basic information of the OLT device through a GET request of the HTTP protocol. Among them, the request parameters include module parameters and token parameters; S42: Based on the received GET request, the OLT device returns JSON data containing the device's basic information to the mobile device. Among them, the JSON data includes the following fields: Error code: used to identify the processing result of the request; Description information: used to briefly describe the processing result; Data body: includes the basic information of the device. Among them, the basic information includes the device model, MAC address, SN number, hardware version, and software version; S43: The mobile device compares the MAC address of the OLT device obtained through the GET request with the MAC address obtained by scanning the QR code before for consistency.

6. The method for a mobile device in a local area network to discover and bind to an OLT device according to claim 1, wherein Step S5 specifically includes the following steps: S51: The mobile device sends an HTTP POST request in JSON format to the OLT device to perform the device binding operation. Among them, the request parameters include module parameters, token parameters, and the server serverUrl; S52: Based on the received POST request, the OLT device binds the device to the background server corresponding to serverUrl and returns the corresponding JSON data to the mobile device. Among them, the JSON data includes: Error code: used to identify the result of the binding operation; Description information: used to briefly describe the binding result; Data body: includes the specific data of the binding operation.