A universal router management method and device
By storing management methods of routers with different brands in the server, terminal devices obtain and upload network information to achieve automatic login and management, solving the problem of users needing to frequently change management software and improving the network experience.
Patent Information
- Application Number
- CN202411925197.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-01
AI Technical Summary
The combination of existing router management software brands and equipment causes users to change management software and re-register their account when changing the router, reducing the user's experience of using the Internet.
By storing management methods of different brands of network equipment in the server, the terminal device obtains the network information of the target network equipment, uploads the server to obtain the corresponding login information and initiates the login. After successful, the brand information is obtained and the management request is initiated to achieve control of the target network equipment.
Users do not need to log in to management applications of different brands, so as to achieve unified management of network devices of different brands, improving user experience of network use.
Smart Images

Figure CN119743365A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of access network management, and in particular to a universal router management method and device. Background Art
[0002] With the popularity of smart homes, almost every router has its own WiFi management software, which can effectively improve network management efficiency, security and user experience, and meet the high requirements of modern families and enterprises for the network. However, usually each brand of router has a corresponding management application, and the management application needs to be registered and logged in before it can be used. When users need to replace routers, they need to replace the management software and re-register their accounts at the same time, which reduces the user's network experience. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a universal router management method and device to improve the user's network experience.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0005] A general router management method is applied to a terminal device, wherein the terminal device executes the following method:
[0006] Acquire network information of the target network device and send the network information to the server; instruct the server to obtain login information according to the network information query and then feed the login information back to the terminal device;
[0007] Log in to the target network device according to the feedback login information, and if the login is successful, feed back the login data to the server; instruct the server to verify whether the login is successful, and if so, return the brand information corresponding to the target network device;
[0008] Generate a management request according to the login information and brand information, send the management request to the server, and instruct the server to feedback management information according to the management request;
[0009] The target network device is controlled according to the management information.
[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0011] A universal router management device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in the universal router management method as described above is implemented.
[0012] The beneficial effects of the present invention are as follows: by storing management methods of network devices of different brands in a server, after a terminal device obtains network information of a target network device, it initiates login to the target network device by uploading corresponding login information to a server, so that a user can automatically log in to the corresponding target network device; at the same time, after successfully logging in to obtain brand information corresponding to the target network device, it can initiate a management request for the target network device based on the login information and the brand information, and control the target network device based on the management information fed back by the server, thereby achieving control over network devices of different brands, meeting the user's needs for network device management without the need to perform login operations for different management applications, thereby improving the user's network experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A flowchart of a general router management method in an embodiment of the present invention;
[0014] Figure 2 A flowchart of the interaction steps of a general router management method in an embodiment of the present invention;
[0015] Figure 3 The figure is a schematic diagram of the structure of a universal router management device in an embodiment of the present invention. DETAILED DESCRIPTION
[0016] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0017] A general router management method is applied to a terminal device, wherein the terminal device executes the following method:
[0018] Acquire network information of the target network device and send the network information to the server; instruct the server to obtain login information according to the network information query and then feed the login information back to the terminal device;
[0019] Log in to the target network device according to the feedback login information, and if the login is successful, feed back the login data to the server; instruct the server to verify whether the login is successful, and if so, return the brand information corresponding to the target network device;
[0020] Generate a management request according to the login information and brand information, send the management request to the server, and instruct the server to feedback management information according to the management request;
[0021] The target network device is controlled according to the management information.
[0022] From the above description, it can be seen that the beneficial effects of the present invention are: by storing the management methods of network devices of different brands in the server, after the terminal device obtains the network information of the target network device, the corresponding login information is obtained by uploading to the server to initiate the login of the target network device, so that the user can automatically log in to the corresponding target network device; at the same time, after successfully logging in to obtain the brand information corresponding to the target network device, a management request for the target network device can be initiated based on the login information and brand information, and the target network device can be controlled based on the management information fed back by the server, thereby realizing the control of network devices of different brands, meeting the user's needs for network device management, and eliminating the need to log in for different management applications, thereby improving the user's network experience.
[0023] Further, the login information includes at least one router login data;
[0024] The step of logging into the target network device according to the fed-back login information includes:
[0025] The target network device is logged in sequentially through each router login data.
[0026] From the above description, it can be seen that since the login information of the target network device cannot be determined when the target network device is not logged in, all router login data are sent to the terminal device so that the terminal device can log in to the target network device based on all router login data.
[0027] Further, the step of logging into the target network device in sequence through each router login data includes:
[0028] If all the router login data fails to log in, it will prompt that the management of the target network device is not supported, and prompt to fill in the router information of the target network device;
[0029] Report the received router information to the server.
[0030] From the above description, it can be seen that when all router login data fails to log in, it means that the management of the target network device is not currently supported. Therefore, the user needs to be prompted to fill in the router information and report it to the server. The server developer will then analyze and process the target router and add it to the support list later.
[0031] Further, the login information includes a type identifier;
[0032] Before logging into the target network device according to the fed-back login information, the method includes:
[0033] Acquire a target login mode of the target network device according to the type identifier;
[0034] Log in to the target network device according to the target login method.
[0035] It can be seen from the above description that corresponding type identifiers are set for different types of routing devices, so that when logging in to different types of routing devices, the routing devices can be logged in in a corresponding manner.
[0036] Furthermore, before sending the management request to the server, the process includes:
[0037] The login information and brand information are cached.
[0038] It can be seen from the above description that by caching the login information and brand information corresponding to the target network device, the terminal device can initiate an effective management request to the target network device based on the cached login information and brand information.
[0039] Furthermore, the management request also includes a request to obtain a list of connected devices on the current target network device;
[0040] The instructing the server to feed back management information according to the management request comprises:
[0041] The server obtains a connection device list corresponding to the target network device according to the brand information, and feeds the connection device list back to the terminal device.
[0042] As can be seen from the above description, the management request includes a request to obtain a list of connected devices on the current target network device, so that the terminal device can obtain information about the connected devices on the current target network device and control the connected devices.
[0043] Furthermore, the server obtains a list of connected devices corresponding to the target network device according to the brand information, including:
[0044] The server retrieves a target method for obtaining the list of connected devices from a database according to the brand information, and feeds back the target method to the terminal device;
[0045] The terminal device executes the target method and returns the execution result to the server; and instructs the server to parse the execution result to obtain the connection device list, and then feeds the connection device list back to the terminal device.
[0046] From the above description, it can be seen that after the server obtains the corresponding operation method according to the brand information, the operation method is sent to the terminal device. After the terminal device executes the corresponding operation method, the execution result is returned to the server. The server then parses it to obtain the connected device list and feeds it back to the terminal device, thereby realizing the visualization of the connected device list on the terminal device and enabling the user to manage the connected device list.
[0047] Furthermore, the management request also includes a request to modify the password;
[0048] The instructing the server to feed back management information according to the management request comprises:
[0049] Instruct the server to obtain a target process for modifying the password of the target network device according to the brand information, and execute the target process to obtain the modification parameters and then feed them back to the terminal device;
[0050] The controlling the target network device according to the management information includes:
[0051] The target network device is matched according to the modification parameters, and if the match is successful, the password is successfully modified.
[0052] It can be seen from the above description that the management request also includes a password modification request, that is, the user can modify the password of the target network device based on the password modification request, thereby improving the security of the target network device.
[0053] Furthermore, after the password is successfully modified, the following steps are also included:
[0054] Determine whether the target network device is restarted, and if so, use the new password and initiate a connection to the target network device at a preset time interval until the connection is successful, and upload the new password to the server.
[0055] From the above description, it can be seen that when the password is successfully modified, the target network device may perform a restart operation. By using the new password and initiating a connection to the target network device at a preset time interval, after the target network device restarts, the terminal device can automatically establish a connection with the target network device.
[0056] Another embodiment of the present invention provides a universal router management device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of a universal router management method as described above when executing the computer program.
[0057] The general router management method and device provided by the present invention can be applied to Android devices to manage the WiFi of different routers, and implement functions such as modifying WiFi passwords and allowing / disabling devices to access the Internet. The following is an explanation through specific implementation methods:
[0058] Embodiment 1
[0059] Please refer to Figure 1 as well as Figure 2 , a general router management method is applied to a terminal device, and the terminal device executes the following method:
[0060] S1. Obtain the network information of the target network device and send the network information to the server; instruct the server to obtain the login information based on the network information query and then feed the login information back to the terminal device. The server is a background server, and the developer collects and analyzes the information of each brand of router in advance, including operations such as router login, device management, adding to the blacklist, controlling the device's Internet access time, and changing the WiFi password, as well as the processes involved in the operation, whether it will cause the router to restart, how long the browser needs to wait to open the URL, whether the operation needs to inject a JS script, the time required to execute the JS script, the success mark on the page, etc., and stores the above collected information in the database; for example, in actual operation, the background developer opens the login URL of the corresponding brand of router through the PC browser in advance, enters the account password, and performs the corresponding management operation; at the same time, the developer needs to analyze which jumps these operations will involve, which JS scripts need to be loaded, and whether the GET or POST method is used. If the POST method is used, what data needs to be carried, how long it will take to open the browser, whether HTTP is needed to request data, and other related information.
[0061] Among them, the terminal device obtains the network information of the target network device, which means that the terminal device is connected to WiFi at this time. The WiFi management application on the terminal device (that is, the software that executes the method of this embodiment) obtains the WiFi SSID (WiFi name), BSSID (router physical address), and router gateway information. The terminal device initiates a request to obtain the router brand and sends the above information to the background server.
[0062] The background server retrieves the router information of all brands currently supported by the background from the database according to the above network information, and feeds the information back to the terminal in the form of an array; each element in the array contains the login information corresponding to a different router, and the login information includes the router login URL, router login account and password, JS script for executing router login, login success flag, type identifier and other parameters.
[0063] S2. Log in to the target network device according to the feedback login information. If the login is successful, the login data is fed back to the server; the server is instructed to verify whether the login is successful. If so, the brand information corresponding to the target network device is returned. When logging in to the target network device according to the login information, the target network device is logged in through each router login data in turn; at the same time, when logging in, the target login method of the target network device is obtained according to the type identifier, and the target network device is logged in according to the target login method.
[0064] For example, after the terminal device receives the data returned by the server, it determines the login method according to the browser waiting time (browerWaitTime) field in the returned data. If browerWaitTime is 0, the HTTP protocol is used to request the address; if it is not 0, a global WebView (web browser) is initialized for operation; then, the terminal device attempts to log in to the target router using the login information in each element of the array in turn according to the received array; it determines whether the page jump result contains a success mark or whether the HTTP request response result contains a success mark. If so, it means that the login is successful, and all the HTML content of the page or the HTTP response result is sent to the background server.
[0065] The backend server further confirms whether the login is successful based on the returned HTML content or HTTP response result. If successful, the router brand is returned to the terminal device. Since the login methods of different models of each brand of router may be different, some may use WebView to log in, while others may issue a request based on the HTTP protocol to log in. If a WebView page is involved, the server needs to determine whether the returned HTML content contains certain specific strings or certain HTML content. If it is detected that these specific contents are included, it is considered successful; if the login is achieved through HTTP request, the response result is used to determine whether the login is successful. For example, returning errorCode=0 indicates a successful login.
[0066] That is, through the above interaction, after the terminal device successfully logs in using one of the login information, the brand of the target router can be determined. As for the model, after each router logs in successfully, the product model will be reflected on the page, for example, it can be displayed on the page through div or other html elements in html; the server needs to obtain different brands and models separately. If the HTTP login is successful, the router will also have an address that needs to be opened by WebView. After opening this address and sending the html content to the server, the server will parse the product model.
[0067] At the same time, if all the router login data fails to log in, it will prompt that the management of the target network device is not supported, and prompt to fill in the router information of the target network device; the received router information will be reported to the server. That is, when the terminal device fails to log in according to each element in the array, it means that the current application does not support the management of the router, and it is necessary to prompt the user whether he is willing to fill in the router information and report it to the server, and then the server developer will analyze and process the router and add it to the support list later.
[0068] S3. Generate a management request based on the login information and brand information, send the management request to the server, and instruct the server to feedback the management information based on the management request. After the terminal device obtains the login information and brand information, it caches the login information and brand information, that is, caches the router brand, router login address, login account, password and other related data. Subsequently, the terminal device generates a management request based on user needs and sends it to the server, and the management request carries parameter information such as router brand.
[0069] S4. Control the target network device according to the management information.
[0070] In some optional implementations, the above steps S3 and S4 are described with the requirement of obtaining a list of connected devices on the current target network device as a request:
[0071] S31. The terminal device sends a request to the server for obtaining a list of devices connected to the current router.
[0072] S32. The server obtains a list of connected devices corresponding to the target network device according to the brand information, and feeds the list of connected devices back to the terminal device. Specifically:
[0073] S321. The server retrieves the target method for obtaining the list of connected devices from the database according to the brand information, and feeds back the target method to the terminal device; for example, the server retrieves the data item corresponding to the target router brand for obtaining the current WiFi connected device list, and the data item includes the requested URL, the waiting time required to open the URL, the JS script required to be injected to open the URL, etc.; specifically: the server retrieves the router of the corresponding model of the target brand from the database to obtain the device connection list. There may be only one step or multiple steps. Each step is defined as an Action. Each Action includes the request address, whether to use the GET or POST method, whether to judge the success mark, the JS script required to load to access this address (can be empty), and the time required to access the address and the unique identifier of the step, etc. The Action data constitutes the target method and returns it to the terminal device.
[0074] S322, the terminal device executes the target method and returns the execution result to the server. Specifically, the terminal WiFi management application uses WebView to open the requested URL, gradually accesses the address in the Action (some may need to add data to the request protocol header, and some may need to execute JS scripts), and determines whether the execution result page content contains a success mark. If so, the success page content, the router brand, and the router identifier returned by the background are returned to the background; when all Actions are executed, the HTML content of the page where the last WebView stays and the unique identifier and other parameters are returned to the server. Among them, the identifier is only used by the server to distinguish the HTML content and the parsing method of the response data. Each operation of each brand and model will have an identifier, which is used to determine what parsing method is needed to parse the HTML content and response content sent up. The identifier is customized by the server developer.
[0075] S323. The server determines the parsing method of the HTML content according to the unique identifier, thereby obtaining the device connection list of the current WiFi, stores the device connection list in a database, and returns the list to the terminal device for visual display.
[0076] S4. On the terminal device, click a device in the device list to view detailed information of the device, such as the device name, the device's Mac address, whether Internet access has been disabled, etc.
[0077] In some optional implementations, it also includes function requests such as adding to the blacklist, controlling the device's Internet access time, and changing the WiFi password. The data transmission method is the same as the above embodiment, except that the data transmitted is different. The background server also needs to store some operation results. For example, if a device is added to the blacklist, the corresponding flag in the database needs to be changed accordingly. The above steps S1-S4 are explained with the requirement of changing the WiFi password as a request:
[0078] For example, a TPLINK model is used to illustrate the process of changing the WiFi password and the data involved:
[0079] S1a, the terminal device sends network information to the server.
[0080] Since most operations of the above-mentioned router models can be completed with the help of HTTP protocol, the server returns all the router login addresses, accounts, passwords, and data formats to the terminal device as follows:
[0081] {
[0082] "actionName":"action_login",
[0083] "request":[
[0084] {
[0085] "requestName":"request_brand name",
[0086] “url”: “https: / / router login address”,
[0087] "method": "POST", / / POST means using the POST method, GET means using the GET method
[0088] "header": [ / / The header contains a value, indicating that the terminal application needs to set the header when initiating a request
[0089] {
[0090] "name":"accept",
[0091] "value":"application / json,text / javascript,* / *; q=0.01"
[0092] },
[0093] ........ / / Multiple
[0094] ],
[0095] "POSTData": [
[0096] "login":{
[0097] "password":"xxxxxxxxx"
[0098] }
[0099] ], / / method is the data sent to the URL when POST, when method is GET, this value is empty
[0100] "successFlag": "errorCode = 0", / / Flag of successful request
[0101] "browerWaitTime": 0 / / Browser waiting time, 0 means HTTP request, non-0 means WebView loading
[0102] },
[0103] ... / / Multiple routers, here are multiple element data ]
[0105] }
[0106] S2a. Log in to the target network device according to the feedback login information. Specifically: after the terminal device receives the data array returned by the background, it accesses the elements in the request array in turn. If browserWaitTime is 0, use HTTP to initiate a GET or POST request, and determine whether the response data contains successFlag (success flag). If it does, the login is successful and the response result is returned to the background server.
[0107] Subsequently, the background server determines the router brand through requestName from the data sent by the terminal device, and obtains a token field from the response data. This field can be used to splice a request address: http: / / router login address / stok=token field / ds for use in subsequent steps; if the router model cannot be determined, the next Action data needs to be returned to the terminal, and the url in the request in the returned Action is: http: / / router login address / stok=token data / pc / Content.htm.
[0108] After that, the terminal device receives the response from the server and uses WebView to open the URL. It may encounter a situation where an account needs to be authenticated. The router account and password can be passed in WebView for authentication, and the HTML content of the page is sent to the server. The server parses the router model through a div element and returns it to the terminal for storage. The router brand and model are determined.
[0109] S3a, the terminal device sends a request to modify the WiFi password to the server. The terminal application initiates a request to modify the WiFi password to the server, and at the same time needs to carry data such as the router brand and product model.
[0110] Subsequently, the server obtains the target process for modifying the password of the target network device according to the brand information, executes the target process to obtain the modified parameters, and then feeds back to the terminal device. Specifically: the server retrieves the process and related parameters required to modify the WiFi password according to the router brand and model. The data of the relevant models are as follows:
[0111]
[0112]
[0113]
[0114]
[0115]
[0116] S4a, control the target network device according to the management information, specifically: match the target network device according to the modified parameters, if the match is successful, the password is successfully modified; that is, after the terminal device receives the data returned by the server, it uses WebView or Http protocol to request the elements in reqeust in sequence, and after the steps are completed, if the success mark is matched, it means that the password is successfully modified. At the same time, determine whether the router will restart according to routerRestart, if it will restart, use the new WiFi password to reconnect once at a preset time interval until the connection is successful; if restart is not required, directly use the new WiFi password to connect to the current WiFi, and send the new WiFi password and other parameters to the server, and the WiFi password modification process ends here.
[0117] Embodiment 2
[0118] Please refer to Figure 3 This embodiment provides a universal router management device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in a universal router management method as described in Embodiment 1 is implemented.
[0119] In summary, the universal router management method and device provided by the present invention collects and analyzes the processes involved in the relevant operations of each brand of router in advance through the server, and stores the relevant parameters and data in the database, so that after the terminal device obtains the network information of the target network device, it initiates the login of the target network device by uploading the server to obtain the corresponding login information, so that the user can automatically log in to the corresponding target network device; at the same time, after successfully logging in to obtain the brand information corresponding to the target network device, it can initiate a management request for the target network device based on the login information and the brand information, and control the target network device based on the management information fed back by the server, such as realizing the modification of the WiFi password, the list of connected devices and other control requirements, and realizing the control of network devices of different brands, meeting the user's needs for network device management, without the need to log in to different management applications, thereby improving the user's network experience.
[0120] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A general router management method, characterized in that: Applied to a terminal device, the terminal device executes the following method: Obtaining network information of the target network device and sending the network information to the server; instructing the server to obtain login information according to the network information query and then feed the login information back to the terminal device; Logging in to the target network device according to the feedback login information, and if the login is successful, feeding back the login data to the server; Instructing the server to verify whether the login is successful, and if so, returning the brand information corresponding to the target network device; Generate a management request according to the login information and brand information, send the management request to the server, and instruct the server to feedback management information according to the management request; The target network device is controlled according to the management information.
2. A general router management method according to claim 1, characterized in that: The login information includes at least one router login data; The step of logging into the target network device according to the fed-back login information includes: The target network device is logged in sequentially through each router login data.
3. A general router management method according to claim 2, characterized in that: The step of logging into the target network device in turn through each of the router login data comprises: If all the router login data fail to log in, it will prompt that the management of the target network device is not supported, and prompt to fill in the router information of the target network device; Report the received router information to the server.
4. A general router management method according to claim 1 or 2, characterized in that: The login information includes a type identifier; Before logging into the target network device according to the feedback login information, the method includes: Acquire a target login mode of the target network device according to the type identifier; Log in to the target network device according to the target login method.
5. A general router management method according to claim 1, characterized in that: Before sending the management request to the server, the step includes: The login information and brand information are cached.
6. A general router management method according to claim 1, characterized in that: The management request also includes a request to obtain a list of connected devices currently on the target network device; The instructing the server to feed back management information according to the management request comprises: The server obtains a connection device list corresponding to the target network device according to the brand information, and feeds the connection device list back to the terminal device.
7. A universal router management method according to claim 6, characterized in that: The server acquiring a list of connected devices corresponding to the target network device according to the brand information includes: The server retrieves a target method for obtaining the list of connected devices in a database according to the brand information, and feeds back the target method to the terminal device; The terminal device executes the target method and returns the execution result to the server; and instructs the server to parse the execution result to obtain the connection device list, and then feeds the connection device list back to the terminal device.
8. A universal router management method according to claim 1, characterized in that: The management request also includes a request to modify the password; The instructing the server to feed back management information according to the management request comprises: Instruct the server to obtain a target process for modifying the password of the target network device according to the brand information, and execute the target process to obtain the modification parameters and then feed them back to the terminal device; The controlling the target network device according to the management information includes: The target network device is matched according to the modification parameters, and if the match is successful, the password is successfully modified.
9. A universal router management method according to claim 8, characterized in that: After the password is successfully modified, the following steps are also included: Determine whether the target network device is restarted, and if so, use the new password and initiate a connection to the target network device at a preset time interval until the connection is successful, and upload the new password to the server.
10. A universal router management 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, each step in a general router management method as described in any one of claims 1 to 9 is implemented.