CN116709475A - Shutdown control method - Google Patents

Shutdown control method Download PDF

Info

Publication number
CN116709475A
CN116709475A CN202211150759.9A CN202211150759A CN116709475A CN 116709475 A CN116709475 A CN 116709475A CN 202211150759 A CN202211150759 A CN 202211150759A CN 116709475 A CN116709475 A CN 116709475A
Authority
CN
China
Prior art keywords
router
shutdown
network
route
execution code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211150759.9A
Other languages
Chinese (zh)
Other versions
CN116709475B (en
Inventor
张军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211150759.9A priority Critical patent/CN116709475B/en
Publication of CN116709475A publication Critical patent/CN116709475A/en
Application granted granted Critical
Publication of CN116709475B publication Critical patent/CN116709475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a shutdown control method. When the method is implemented, under the scene of multi-router networking, a user can send a one-key shutdown instruction to a main route in the multi-router through User Equipment (UE), and all routes in the network are controlled to execute shutdown operation. In this way, a user may control one or more routers in the access local area network to power off by the UE anytime and anywhere without having to walk around through manual keys to power off individual routing devices. In the process of controlling the shutdown of the router, the router in the network can determine whether to execute the shutdown operation according to the executing or to-be-executed transaction in the queue. When the shutdown operation is refused to be performed, the router can return a message refusing the shutdown and a reason refusing the shutdown to the UE.

Description

Shutdown control method
Technical Field
The application relates to the field of terminals, in particular to a shutdown control method.
Background
The router can accelerate the loss of electronic components of the router after being opened for a long time, and the service life of equipment is reduced. On the other hand, when not in use, the routing equipment is closed, so that the wireless radiation can be reduced, and the power is saved and the environment is protected. However, most existing router products have no shutdown function or require shutdown by manual key press or power down. At this time, the user needs to walk near the router, and the power off of the router is controlled by a power off button or a power off mode. When the user cannot walk near the router, the user cannot control the router to shut down.
Disclosure of Invention
In a first aspect, the present application provides a shutdown control method, which is applied to a first router, and includes: receiving a first request from User Equipment (UE) accessing a first network, wherein the first network is a network where a first router is located, and the first request is used for indicating all routers in the first network to execute shutdown operation; sending a first instruction to a second router, wherein the second router is downstream equipment of the first router in the first network, and the first instruction is generated according to a first request and is used for controlling the router to execute shutdown operation; after receiving the first shutdown execution code, executing shutdown operation; the first shutdown execution code is indication information sent by the second router to indicate that the second router has executed a shutdown operation.
Implementing the method provided in the first aspect, an upstream device (a first router) in the network may send a shutdown instruction to a downstream device (a second router), so that all routers in the network receive the shutdown instruction. In this way, the user can send a one-touch shutdown instruction to the network composed of a plurality of routers through the UE, and control all routes in the network to be shutdown. The user can control all routers in the access local area network to execute the shutdown operation through the UE anytime and anywhere, and the user does not need to walk back and forth to close a plurality of routers through a manual key.
The first router determines the shutdown state of the downstream equipment before executing the shutdown operation according to the shutdown instruction. When the downstream device of the first router determines to be shut down, the first router performs a shutdown operation. In this way, in the scenario where the upstream device is powered off, the UE can also determine that the downstream device of the upstream device is also powered off at the same time, without requiring additional verification operations.
In some embodiments, in combination with the method provided in the first aspect, after receiving the first shutdown execution code, after executing the shutdown operation, the method further includes: returning a first shutdown result to the UE, wherein the first shutdown result comprises: the first router is powered off and the second router is powered off. In this way, the user can obtain the shutdown results of all routers in the network through the UE: all have been shut down.
With reference to the method provided in the first aspect, in some embodiments, the method further includes: after receiving the second shutdown execution code, refusing to execute the shutdown operation; the second shutdown execution code is indication information sent by the second router and indicating that the second router refuses to execute the shutdown operation.
By implementing the method provided by the embodiment, when the downstream equipment of the first router refuses to be shut down, so that the upstream equipment is prevented from being shut down to influence the normal operation of the downstream equipment.
In some embodiments, in combination with the method provided in the first aspect, after receiving the second shutdown execution code, after refusing to execute the shutdown operation, the method further includes: and returning a second shutdown result to the UE, wherein the second shutdown result comprises: the first router is not powered off, and the second router is not powered off. In case routers in the network are not all closed, the user can know through the UE which routers are closed and which routers are not closed.
With reference to the method provided in the first aspect, in some embodiments, the method further includes: determining whether a first transaction exists in a first queue, wherein the first queue is a queue of the transaction being executed and/or the transaction to be executed stored in a first router, and the priority of the first transaction is higher than that of a shutdown operation; after receiving the first shutdown execution code, executing a shutdown operation, including: after receiving the first shutdown execution code and confirming that there is no first transaction in the first queue, a shutdown operation is executed.
Implementing the method provided by the above embodiments, the first router may determine whether to respond to the shutdown instruction based on whether a high priority transaction is currently being processed and/or is to be processed. When no high priority transaction is to be processed, the first router responds to the shutdown instruction, namely responds to the shutdown request of the user. Thus, the router blocking and other problems caused by abnormal processing of the high-priority transaction can be avoided. Similarly, other routers in the network such as the second router also determine whether to respond to the shutdown instruction to execute the shutdown operation according to the priority of the transaction to be processed in the queue of the second router.
With reference to the method provided in the first aspect, in some embodiments, the method further includes: after receiving the first shutdown execution code and confirming that there is a first transaction in the first queue, the shutdown operation is refused to be executed.
By implementing the method provided by the embodiment, when the downstream equipment is shut down and the high-priority transaction to be processed is in the queue of the downstream equipment, the first router can also refuse to respond to the shutdown instruction and refuse to execute the shutdown operation, so that the router function is prevented from being influenced by failure caused by abnormal processing of the high-priority transaction.
In some embodiments, after receiving the first shutdown execution code and confirming that there is a first transaction in the first queue, the method further includes, after refusing to execute the shutdown operation: and returning a third shutdown result to the UE, wherein the third shutdown result comprises: the first router is not powered off, and the second router is powered off.
In some embodiments, the method provided in connection with the first aspect, the first transaction comprises one or more of: system upgrade, restart, restore factory settings.
With reference to the method provided in the first aspect, in some embodiments, the method further includes: confirming whether the second router is successfully powered off; after receiving the first shutdown execution code, executing a shutdown operation, including: and after receiving the first shutdown execution code and confirming that the second router is successfully shutdown, executing shutdown operation.
The router determines to begin performing the shutdown operation and is not necessarily able to shut down successfully. When the shutdown execution code sent by the downstream equipment indicates that the downstream equipment has executed shutdown operation but is not actually shut down successfully, the upstream equipment can misjudge that the downstream equipment has been shut down and shut down successfully, so that the downstream equipment is shut down, and the connection state of the downstream equipment is affected. After the first router determines that the second router has executed the shutdown operation according to the shutdown execution code, the first router also determines whether the second router is successfully shutdown, so as to avoid misjudgment and influence on the connection state of the downstream device caused by misjudgment.
In combination with the method provided in the first aspect, in some embodiments, determining whether the second router is powered down successfully includes: monitoring a heartbeat signal of the second router, and confirming whether the second router is successfully powered off according to a monitoring result; and when the heartbeat signal of the second router is not monitored within the preset time, the second router is confirmed to be successfully powered off.
By implementing the method provided by the embodiment, the upstream device can determine whether the downstream device is successfully powered off by monitoring the heartbeat signal of the downstream device.
In combination with the method provided in the first aspect, in some embodiments, the preset time is less than a heartbeat signal period of the second router in a normal working state.
By implementing the method provided by the embodiment, the upstream device can more quickly determine whether the downstream device is successfully powered off by monitoring the heartbeat signal of the downstream device, so that the overlong time of one-key power off caused by overlong monitoring time is avoided, and the user waits for too long, so that the user experience is influenced.
In combination with the method provided in the first aspect, in some embodiments, the connection established by the first router and the second router is a wired connection, and determining whether the second router is powered off successfully includes: monitoring the state of wired connection, and confirming whether the second router is successfully powered off according to the state of wired connection; when the LAN DOWN message of the first interface closing is acquired, the successful shutdown of the second router is confirmed; the first LAN DOWN message is a message generated when the wired connection is broken to indicate that the second router was successfully powered DOWN.
Implementing the method provided by the above embodiments, the upstream device may determine whether the downstream device was successfully powered DOWN via a LAN DOWN message.
With reference to the method provided in the first aspect, in some embodiments, performing a shutdown operation includes: invoking a shutdown interface provided by a kernel layer; the shutdown interface corresponds to the first pin number; and setting the universal input/output pins according to the first pin numbers to finish shutdown operation.
By implementing the method provided by the embodiment, the router can set the input and output pins of the processor through GPIO changes, so that power-off shutdown is realized.
With reference to the method provided in the first aspect, in some embodiments, the method further includes: sending a first instruction to a third router through a second router, wherein the third router is downstream equipment of the second router in the first network; the second router performs the shutdown operation after receiving a third shutdown execution code from a third router, the third shutdown execution code being indication information sent by the third router indicating that the third router has performed the shutdown operation.
By implementing the method provided by the embodiment, the first router can shut down based on the connection between routers in the network, and the shutdown execution is transferred to each router in the network in a level-by-level manner, so that all routers are controlled to execute the shutdown operation.
In some embodiments, the second shutdown execution code is sent after the second router receives the fourth shutdown execution code from the third router; the fourth shutdown execution code is instruction information sent by the third router to instruct the third router to refuse to execute the shutdown operation.
In some embodiments, in combination with the method provided in the first aspect, the UE accesses to the first network through the second router, and receives the first request, including: a first request sent by the UE through a second router is received.
The method provided by the embodiment is implemented, when the UE is directly connected with a slave route in the network, the slave route first receives the first request. The slave route can send the first request upwards to the master route and then distribute the first request by the master route so as to ensure that each router in the network can receive a shutdown instruction.
In a second aspect, the present application provides a shutdown control method applied to a user equipment UE, where the UE accesses a first network, and the first network includes at least two routers, and the method includes: displaying a first interface, wherein a first control is displayed in the first interface; after detecting a first user operation for the first control, sending a first request to a first network; the first request is used for controlling all routers in the first network to execute a shutdown operation; and displaying a second interface, wherein the second interface displays a shutdown result returned by the first network.
Implementing the method provided in the second aspect, the user may send a one-touch shutdown instruction to the network composed of a plurality of routers through the UE, and control all routes in the network to be shutdown. In this way, the user can control all routers in the access local area network to perform a shutdown operation by the UE anytime and anywhere, without having to walk back and forth through a manual key to shutdown multiple routers.
In combination with the method provided in the first aspect, in some embodiments, the shutdown result indicates: all routers in the first network have been powered off; or, one or more routers included in the first network are not powered off.
By implementing the method provided by the embodiment, when all routers in the network are successfully powered off according to the first request, the UE can display the power-off result of the successful power-off of all routers in the user interface. When one or more routers in the network are not successfully powered off according to the first request, the UE can display a power-off result of the one or more routers which are not successfully powered off in a user interface.
In some embodiments, when the shutdown result indicates that one or more routers included in the first network are not shutdown, the reason why the one or more routers are not shutdown is also displayed.
By implementing the method provided by the embodiment, when one or more routers in the network are unsuccessful, the UE can also display the reason that the routers are unsuccessful in shutdown, so that the user can confirm the reason, and the user experience is improved.
In combination with the method provided in the first aspect, in some embodiments, the reasons include: the router is or will process high priority transactions, or the downstream devices of the router are not powered down; the high priority transactions include one or more of the following: system upgrade, restart, restore factory settings.
In some embodiments, the first network includes a first router and a second router, the second router being a downstream device of the first router, the UE accessing the first network through the first router, sending a first request to the first network, including: a first request is sent to a first router.
In combination with the method provided in the first aspect, in some embodiments, the shutdown result is determined by the UE based on a shutdown execution code returned by the first router, where the shutdown execution code returned by the first router includes shutdown execution codes of some or all routers in the first network; the shutdown execution code of one router indicates whether the router has executed a shutdown operation.
In some embodiments, the shutdown execution code of one router is determined according to first information of the router, where the first information includes transactions being executed and/or to be executed stored in a queue of the router and shutdown execution codes of downstream devices of the router.
In some embodiments, the first information further comprises a heartbeat signal of a device downstream of the router in combination with the method provided in the first aspect.
In some embodiments, the connection between the first router and the second router is a wired connection, and the first information of the first router further includes a first interface shutdown LAN DOWN message; the first LAN DOWN message is used to indicate that the second router was successfully powered DOWN.
In some embodiments, the first network includes a first router and a second router, the second router being a device downstream of the first router, the UE accessing the first network through the second router, and sending a first request to the first network, including: the first request is sent to the first router through the second router.
The method provided by the embodiment is implemented, when the UE is directly connected with a slave route in the network, the slave route first receives the first request. The slave route can send the first request upwards to the master route and then distribute the first request by the master route so as to ensure that each router in the network can receive a shutdown instruction.
The foregoing embodiments may refer to the corresponding description of the first aspect, and are not repeated herein.
In a third aspect, the present application provides an electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, the one or more memories being operable to store computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform a method as described in any of the first aspect and the possible implementations of the first aspect, or cause the electronic device to perform a method as described in any of the second aspect and the possible implementations of the second aspect.
In a fourth aspect, embodiments of the present application provide a chip system for application to an electronic device, the chip system comprising one or more processors for invoking computer instructions to cause the electronic device to perform a method as described in the first aspect and any possible implementation of the first aspect, or to cause the electronic device to perform a method as described in the second aspect and any possible implementation of the second aspect.
In a fifth aspect, the present application provides a computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform a method as described in any one of the possible implementations of the first aspect and the first aspect, or cause the electronic device to perform a method as described in any one of the possible implementations of the second aspect and the second aspect.
In a sixth aspect, the application provides a computer program product comprising instructions which, when run on an electronic device, cause the electronic device to perform a method as described in any one of the possible implementations of the first aspect and the first aspect, or cause the electronic device to perform a method as described in any one of the possible implementations of the second aspect and the second aspect.
It will be appreciated that the electronic device provided in the third aspect, the chip system provided in the fourth aspect, the computer storage medium provided in the fifth aspect, and the computer program product provided in the sixth aspect are all configured to perform the method provided by the present application. Therefore, the advantages achieved by the method can be referred to as the advantages of the corresponding method, and will not be described herein.
Drawings
Fig. 1 is a Mesh networking-based network 10 according to an embodiment of the present application;
fig. 2A-2G are a set of user interfaces for controlling a one-touch power-off of a router by a UE according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for controlling shutdown of all routers in the network 10 according to an embodiment of the present application;
FIG. 4 is a flowchart of a router according to an embodiment of the present application performing a power-off operation according to a one-touch power-off instruction;
fig. 5 is a schematic structural diagram of a router 41 according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a UE according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The router can accelerate the loss of electronic components of the router after being opened for a long time, and the service life of equipment is reduced. On the other hand, when not in use, the routing equipment is closed, so that the wireless radiation can be reduced, and the power is saved and the environment is protected. However, most existing router products have no shutdown function or require shutdown by means of manual keys. At this time, the user needs to walk near the router, and the power off of the router is controlled by a power off button or a power off mode. When the user cannot walk near the router, the user cannot control the router to shut down.
Further, in a home scenario, due to limitation of wireless transmission power, high-fidelity wireless communication (wireless fidelity, wi-Fi) signals have weak wall-through capability, and a wireless network constructed by a single router has small coverage. In order to meet the requirement that household Wi-Fi signals cover a whole house, mesh networking is a popular solution at present. One master route can be matched with one or more slave routes, so that the coverage range of the home Wi-Fi can be effectively expanded. In the Mesh networking scenario, if a manual key-press or power-off shutdown strategy is adopted, a user needs to walk to the vicinity of each router to operate the power-off key-press or power off to realize power off, and the user experience is worse.
In view of this, the embodiment of the application provides a shutdown control method. The method is implemented, and based on a communication connection with a router, a User Equipment (UE) may send a shutdown request to the router. In response to the shutdown request, the router can drive the corresponding pin to be pulled down to realize shutdown operation.
In the case of multi-router networking, a User Equipment (UE) may send a one-touch shutdown request to a primary router in the multi-router. In response to the one-touch shutdown request, the master route may communicate a shutdown instruction to a slave route in the network, instructing the slave route to perform a shutdown operation. And after all the secondary routes are successfully powered off, the primary route is powered off again, and a power-off result is returned to the UE. In this way, the user can control all routers in the access local area network to perform a shutdown operation by the UE anytime and anywhere, without walking back and forth through a manual key to shutdown a plurality of routers.
In the process of controlling the shutdown of the router, the router in the network, including the master route and the slave route, can determine whether to execute the shutdown operation according to the executing or to-be-executed transaction in the queue. When the transaction being executed or to be executed in the queue includes a higher priority transaction, such as a system upgrade, a reboot, a restore factory setting, etc., the router may refuse to perform a shutdown operation. At this point, the router may return a message to the UE rejecting the shutdown. The UE may prompt the user according to the above message which router or routers are not powered down. The user may choose to close the router again later. Alternatively, the router may wait for the higher priority transaction to be completed before executing the shutdown operation.
Fig. 1 is a Mesh networking-based network 10 according to an embodiment of the present application.
The network 10 includes a master route and three slave routes: slave route 1, slave route 2, slave route 3.
One port of the main route is connected to the internet. The ports are typically WAN interfaces. The primary route also includes a plurality of LAN interfaces. The main route can be connected with other routers through the LAN interface, and the expansion of the signal coverage range is realized through a Mesh networking mode. Of course, not limited to Mesh networking, multiple routers may also be networked in an "access point+access controller" mode, i.e., an ap+ac mode. The embodiment of the application does not limit the networking mode specifically used by the multiplexer.
As shown in fig. 1, the master route may be connected to the slave route 1 by means of a wired connection. Here, the port used as shown by the master route establishing a wired connection with the slave route 1 is typically a LAN interface. Meanwhile, the master route can also be connected with the slave route 2 by a wireless connection mode. The slave route establishing a wired/wireless connection with the master route may also be wired/wireless connected with other slave routes. As shown in fig. 1, slave route 1 may also establish a wired connection with slave route 3.
Thus, the master route, the slave route 1, the slave route 2 and the slave route 3 construct a Mesh networking-based local area network 10. The user equipment UE may establish a wireless communication connection with any one of the routers in the network 10. The UE can select the router with the strongest signal strength to access according to the signal strength of each router. As shown in fig. 1, the UE detects that the router with the strongest signal strength may be the primary route, and thus, the UE directly accesses the primary route. It will be appreciated that when the router with the strongest signal strength changes, the UE may change the access router accordingly. For example, when the UE detects that the router with the strongest signal strength is changed to the slave route 1, the UE may access the slave route 1.
The router directly connected to the UE may first receive the data transmitted by the UE. In the network 10 shown in fig. 1, a primary route directly connected to a UE may first receive a one-touch power-off request sent by the UE. After all routers in the network 10 are controlled to be powered off according to the one-touch power-off request, the main router directly connected with the UE may return a power-off result to the UE.
Fig. 2A-2G are a set of user interfaces for controlling one-touch power down of a router by a UE according to an embodiment of the present application.
The UE may have a first application installed thereon. The first application may provide the user with the functionality to control the router to power off. In response to a user operation acting on the first application icon, the UE may display the user interface 21 shown in fig. 2A.
The user interface 21 may include a menu bar 201 and a window 202. Menu bar 201 may display one or more menu options, such as "network topology" 203, "device list" 204, and so forth. "network topology" 203 may be used to indicate that the UE shows in window 202 the network topology of the network 10 that the UE is currently accessing. The "device list" 204 may be used to instruct the UE to show in window 202 that the currently accessed network 10 includes detailed information for various routers in the network 10.
As shown in fig. 2A, the selected menu option is "network topology" 203. At this time, a network topology diagram of the network 10 to which the UE is currently accessing may be displayed in the window 202: master route, slave route 1, slave route 2, slave route 3. The network topology shown in window 202 is consistent with network 10 shown in fig. 1, and reference is made to the description of fig. 1, which is not repeated here. The user can clearly and intuitively determine the network structure of the current access network 10 through the network topology shown in the window 202.
Optionally, the network topology shown in window 202 may also include user devices that access network 10, such as cell phones, tablet computers, notebook computers, and the like. The user equipment may establish a limited/wireless connection with any one of the routers in the network 10. Further, any one of the user devices in the network 10 having the one-touch power-off authority may also control the other user devices in the network 10 to power off through the network 10.
Alternatively, the UE may display the first web page (web page) through a browser application. The first web page may also display the information shown in fig. 2A.
In the embodiment of the application, the UE may be a terminal device such as a mobile phone, a tablet computer, and the like. It will be appreciated that the UE according to the embodiments of the present application may also be a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) device, a Virtual Reality (VR) device, an artificial intelligence (artificial intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device, and/or a smart city device, and the specific type of the electronic device is not particularly limited by the embodiments of the present application.
In the user interface 21 shown in fig. 2A, the UE may detect a user operation acting on the "device list" 204. The operation is, for example, a click operation. In response to the above, the UE may display the user interface 22 shown in fig. 2B. At this time, detailed information of all routers included in the currently accessed network 10 may be displayed in the window 202. For example, the window 202 may have a device bar 211, a device bar 212, a device bar 213, and a device bar 214 displayed therein.
The device bar 211 may be used to present detailed information of the primary route. Illustratively, the device name of the primary route may be displayed in the device column 211: "Router A". Optionally, a master route identifier, such as "(master)", may also be displayed in the device column 211. In this way, the user can more intuitively distinguish between master and slave routes in the network 10. Further, location information, such as "living room", may also be displayed in the device field 211. In this way, the user can more intuitively determine the location of each router.
The device column 211 further includes buttons 221 and icons 222. Icon 222 may be used to indicate that router a is currently in operation. Button 221 may provide a service for the user to control router a to close when icon 222 indicates router a is in an active state.
Device column 212 ("router B (slave route 1) primary horizontal", button 223, icon 224), device column 213 ("router C (slave route 2) secondary horizontal 1", button 225, icon 226), device column 214 ("router D (slave route 3) secondary horizontal 2", button 227, icon 228) may refer to the description of device column 211 described above and will not be repeated here.
As shown in user interface 23 in fig. 2C, when multiple routers are included in network 10, button 229 ("one-touch power-off button") may also be displayed in window 202. Button 229 may be used to control simultaneous shutdown of multiple routers in network 10. After detecting the user operation on the button 229, the UE may display the user interface 24 shown in fig. 2D in response to the above operation.
As shown in user interface 24, the UE may display window 231 in window 202. A prompt may be displayed in window 231, such as "after shutdown, all routers stop working" to prompt whether to shutdown all routers in network 10. Buttons 232 and 233 are available in window 231. The user may cancel closing all routers via button 232. Alternatively, the user may confirm closing all routers through button 233.
After detecting a user operation on button 233, the UE may send an instruction to close all routers (i.e., a one-touch shutdown instruction) to the primary route in network 10. In response to the instruction, the master route may send a shutdown instruction to other slave routes in the network 10, instructing the slave routes to perform shutdown operations.
After completing the shutdown operation, the UE may display the user interface 25 shown in fig. 2E. At this point, an icon 241 may be displayed in the device bar 212 ("unopened"). Icon 241 may indicate that router a corresponding to device bar 212 has been powered off. Similarly, device fields 212, 213, 214 may display icons 242, 243, 244, respectively, indicating that the corresponding slave route 1, slave route 2, slave route 3 has been shutdown. In other examples, after a router completes shutdown, the device bar corresponding to the router is no longer displayed in window 202. For example, after routers A-D are powered down, there are no device bars 211-214 in window 202 in user interface 25.
If one or more routers in network 10 refuse to immediately perform a shutdown operation, the UE may receive a message returned by the router that refuses to shutdown. The UE may then display a prompt to the user for a shutdown failure. As shown in fig. 2F, window 251 may be displayed in user interface 26. The devices that were not successfully powered off, as well as the reasons for the unsuccessful power off, may be displayed in window 251. For example, window 251 may display: "1, the slave route 1 is executing the system upgrade operation, and the shutdown fails; 2. the downstream equipment of the main route is not shut down, and the shutdown fails. "a slave route that extends from a router may be referred to as a downstream device of the router. For example, the slave routes 1 to 3 are downstream devices of the master route, and the slave route 3 is a downstream device of the slave route 1.
Buttons 252 may also be included in window 251. After reading the shutdown failure prompt, the user may close window 251 via button 252. In response to the above, the UE may display the user interface 27 shown in fig. 2G. At this time, the device bars 211 and 212 indicate that the router a and the router B are in an operating state; the device bars 213, 214 indicate that the router C and the router D have been powered off. Similarly, the device bar 213 and the device bar 214 corresponding to the shutdown router C and the router D may not be displayed in the window 202.
Implementing the methods shown in fig. 2A-2G, a user may close all routers through UE remote control. Therefore, the user does not need to walk to the vicinity of the router to manually close the router, and can close a plurality of routers at one time, so that user operation is saved, and convenience is provided for the user to remotely control the router to close.
Fig. 3 is a flowchart of a method for controlling shutdown of all routers in the network 10 according to an embodiment of the present application.
A ue sends a one-touch power down request to a primary route.
Referring to the description of fig. 1, a UE may select a router having strongest access to a current signal according to signal strength. For example, the UE may select an access primary route based on signal strength. In the scenario of accessing the primary route, after detecting the user operation on the one-touch power-off button shown in fig. 2D, the UE may send a one-touch power-off request to the primary route.
When the router to which the UE accesses is a slave route, after detecting a user operation acting on the one-touch power-off button shown in fig. 2D, the UE may first send a one-touch power-off request to the accessed slave route. The slave route may forward the one-touch shutdown request to the master route. Optionally, when the router to which the UE accesses is the slave route, after detecting the user operation of the one-touch power-off shown in fig. 2D, the UE may further switch the connection to access the master route. Then, the UE sends a one-touch power-off request to the primary route.
302. The master route sends a shutdown instruction to the slave route 1.
303. The master route sends a shutdown instruction to the slave route 2.
After receiving the one-touch power-off request sent by the UE, the primary route may determine whether there is a downstream device. After determining that there is a downstream device, the primary route may send a shutdown instruction to its downstream device, controlling its downstream device to perform a shutdown operation. For example, the primary route determines that there is a downstream device: slave route 1 and slave route 2. The master route may then send a shutdown instruction to slave route 1 and slave route 2, respectively.
304. A shutdown instruction is sent from route 1 to route 3.
Any slave router in the network can judge whether there is a downstream device after receiving the shutdown instruction for controlling the router to execute the shutdown operation. When there is a downstream device, the slave route also transmits a shutdown instruction to the downstream device, so that the shutdown instruction sent by the master route is propagated to each router in the network. For example, after receiving a shutdown instruction issued by the master route, the slave route 1 also determines whether there is a downstream device. After determining that there is a downstream device slave route 3, slave route 1 may pass a shutdown instruction to its downstream device slave route 3.
305. From route 3, it is determined that there is no downstream device, and a shutdown operation is performed.
Upon receiving the shutdown instruction issued from route 1, slave route 3 also determines whether there is a downstream device. After determining that there is no downstream device itself, a shutdown operation may be performed from route 3. The following embodiments will specifically describe a specific process of the router performing the shutdown operation according to the shutdown instruction, which is not first described herein.
306. The shutdown execution code is returned from route 3 to route 1.
The shutdown execution code is used for indicating whether the router executes the shutdown operation or not and the reason for not executing the shutdown operation. Table 1 is a comparison table of shutdown execution codes according to an embodiment of the present application.
TABLE 1
Shutdown execution code Meaning of
0 Performing a shutdown operation
100 The router is executing system upgrade operation without executing shutdown operation
101 The router is executing a restart operation without executing a shutdown operation
102 The router is executing the restoration factory setting operation without executing the shutdown operation
103 The shutdown operation is not executed, and the downstream equipment is not normally shutdown
In 305, after slave route 3 acknowledges execution of the shutdown operation, slave route 3 may send a shutdown execution code "0" to slave route 1. The shutdown execution code "0" may indicate that a shutdown operation may be performed from route 3. After the shutdown execution code "0" is transmitted, the shutdown operation is executed from the route 3.
After the router is powered down, the connection between the router and the router may be broken. The on-line router may determine that the disconnected router has been shutdown. In the scenario where the slave route 1 establishes a wired connection with the slave route 3, the wired connection between the slave route 3 and the slave route 1 may be disconnected after the slave route 3 is powered off. At this time, the slave route 1 may generate the LAN DOWN message according to the disconnection of the LAN interface described above. Slave route 1 may then acknowledge successful shutdown from route 3 based on the LAN DOWN message described above.
In 305, the shutdown operation may be denied from route 3 when a high priority transaction such as a system upgrade, restart, or restore factory settings is being performed from route 3. At this time, the slave route 3 may transmit the shutdown execution code "100", "101", or "102" to the slave route 1, indicating that the slave route 3 does not perform the shutdown operation, and the reason why the shutdown operation is not performed.
For a slave route with a downstream device, if it is detected that the downstream device refuses to perform a shutdown action, the slave route may also refuse to perform a shutdown action. At this time, the slave router may send a corresponding shutdown execution code "103" to its upstream device, indicating that it refuses to perform the shutdown operation, and indicating the reason for refusing to perform the shutdown operation: the downstream device is not normally shut down.
307. The slave route 1 returns slave route 3 shutdown execution code to the master route.
After receiving the shutdown execution code returned from route 3, slave route 1 may return the shutdown execution code back up to the master route. Alternatively, slave route 1 may also return a LAN DOWN message to the master route indicating that slave route 3 was successfully powered DOWN. It will be appreciated that in the scenario where the connection established by slave route 1 and slave route 3 is a wireless connection, slave route 1 does not generate a LAN DOWN message indicating that slave route 3 was successfully powered DOWN, and therefore does not return the LAN DOWN message to the master route.
308. From route 2, it is determined that there is no downstream device, and a shutdown operation is performed.
309. The shutdown execution code is returned from route 2 to route 1.
After receiving the shutdown instruction issued by the master route, the slave route 2 also determines whether there is a downstream device. After determining that there is no downstream device itself, slave route 2 may also confirm whether to perform a shutdown operation based on whether there is a high priority transaction in the current queue. After determining to perform the shutdown operation, slave route 2 may return shutdown execution code "0" to the master route, and the description of steps 305-306 is omitted herein.
After receiving the shutdown instruction issued by the upstream device from the router, the router can determine whether the downstream device exists, and determine to execute the shutdown operation or transmit the shutdown instruction downwards according to whether the downstream device exists. Accordingly, embodiments of the present application are not limited to the order of steps 305 and 308, and the associated steps thereafter.
310. And the heartbeat signals of the slave routes 2 and 3 are not received in preset time, and the master route confirms that the slave routes 2 and 3 are successfully powered off.
For various reasons, a router may not be able to successfully shut down after it has acknowledged and begun to perform a shutdown operation. Thus, receipt of a shutdown execution code "0" confirming execution of a shutdown operation does not necessarily mean that the corresponding router must be shutdown successfully. Therefore, in order to further determine whether the slave route performing the shutdown operation is successfully shutdown, the master route may further acquire a heartbeat signal of the slave router, and determine whether the slave route is successfully shutdown through the heartbeat signal.
When the slave route is in an operating state, heartbeat signals can be periodically sent to the master route. If the slave route is successfully powered off, the slave route does not send a heartbeat signal outwards. Naturally, the master route can no longer receive the heartbeat signal sent by the slave route. Therefore, the master route can determine whether the corresponding slave route is in a normal working state according to the heartbeat signal. When the master route fails to periodically receive the heartbeat signal of the slave route, the master route may determine that the slave route was successfully shutdown.
Specifically, after receiving the shutdown execution code and/or the LAN DOWN message returned by the downstream device, the master route may monitor the heartbeat signal of the corresponding slave route. If the heartbeat signal of the router is not received within the preset time, the master route can confirm that the slave route is successfully powered off. Illustratively, after receiving the shutdown execution code of the slave route 3 returned from the slave route 1, the master route may monitor the heartbeat signal of the slave route 3; after receiving the shutdown execution code of the slave route 2 returned from the slave route 2, the master route may monitor the heartbeat signal of the slave route 2. If the heartbeat signals of the slave route 2 and the slave route 3 are not received within the preset time, the master route can determine that the slave route 2 and the slave route 3 have executed shutdown operation and the shutdown is successful. The preset time can be determined according to the cycle of the heartbeat signal of the router. The preset time is greater than or equal to the period of the heartbeat signal. Preferably, the preset time is greater than the period of the heartbeat signal.
Typically, the period of the router sending the heartbeat signal is 1 minute. Thus, the master route takes at least 1 minute to verify whether the slave route that has performed the shutdown operation was successfully shutdown. That is, the user needs to wait at least 1 minute from the initiation of the one-touch shutdown to the reception of the shutdown result. This results in excessive waiting time for the user. Too long waiting time greatly reduces the user experience. To avoid excessive latency, the router may shorten the period of the heartbeat signal after it sends a shutdown execution code "0" to its upstream device.
For example, after the slave route 2 transmits the shutdown execution code "0" to the master route, the slave route 2 may transmit a heartbeat signal every 5 seconds. Thus, within 6 seconds after receiving the shutdown execution code "0" of the slave route, the master route determines whether the slave route is shutdown successful by whether the heartbeat signal of the slave route 2 is received. The above 6 seconds is the preset time of the heartbeat signal of the router. In some examples, the master route may also repeat 2-3 cycles or more to listen for heartbeat signals from the slave route 2, e.g., within 16 seconds, 18 seconds, to more accurately determine if the slave route was shut down successfully. The above 6 seconds are exemplary, and not limited to 6 seconds, and the preset time may be any value greater than the adjusted heartbeat signal period (e.g., 5 seconds) and less than the heartbeat signal period before adjustment (e.g., 1 minute) such as 30ms,2s,10s, etc. The heartbeat signal period before the adjustment is also called as the heartbeat signal period in a normal working state, and the heartbeat signal period after the adjustment is also called as the heartbeat signal period when the shutdown operation is executed.
Both the LAN DOWN message and the heartbeat signal may be used to determine whether the router has successfully shutdown. The upstream device may select a LAN DOWN message and/or heartbeat signal to determine whether its downstream device has successfully powered DOWN. In particular, when the upstream device establishes a wireless connection with the downstream device, the upstream device cannot acquire the corresponding LAN DOWN message, and therefore cannot determine whether the downstream device is powered DOWN successfully through the LAN DOWN message.
311. From route 1, it is determined that the downstream device has been shutdown, and a shutdown operation is performed.
The slave router may also monitor the heartbeat signal of its downstream devices to determine if its downstream devices were successfully powered down. For example, after the step shown in step 306, i.e., after receiving the shutdown execution code returned from route 3, slave route 1 may listen for a heartbeat signal from route 3. If the heartbeat signal of the slave route 3 is detected to stop, the slave route 3 is determined to be successfully powered off. At this point, slave route 1 may determine that its downstream device has performed a shutdown operation from route 3 and that the shutdown was successful.
The slave route 1 can determine whether all of its downstream devices have performed a shutdown operation and successfully shutdown via the downstream devices' heartbeat signals and/or LAN DOWN messages. After confirming that all downstream devices have been successfully powered off, a shutdown operation is again performed from route 1.
In the embodiment of the application, the downstream device of the slave route 1 only comprises the slave route 3. Thus, the slave route 1 may perform a shutdown operation after confirming that the slave route 3 has performed the shutdown operation and successfully shutdown based on the shutdown execution code, the LAN DOWN message, and/or the heartbeat signal of the slave route 3. It will be appreciated that when the downstream devices of the slave route include a plurality of slave routes, the slave route 1 may confirm whether the plurality of downstream devices have all performed the shutdown operation and successfully shutdown based on the shutdown execution code, LAN DOWN message, and/or heartbeat signal of the plurality of downstream devices. After confirming that all downstream devices have been successfully powered down, a shutdown operation is re-performed from route 1. Otherwise, the slave route 1 does not perform a shutdown operation.
312. The slave route 1 returns a shutdown execution code to the master route.
After the slave route 1 performs the shutdown operation, the slave route 1 also returns a shutdown execution code to the master route indicating that the slave route 1 has performed the shutdown operation. In the embodiment of the application, based on the wired connection established between the master route and the slave route, after the slave route 1 is successfully powered off, the master route also generates a LAN DOWN message indicating that the slave route 1 is successfully powered off.
313. And the heartbeat signal of the slave route 1 is not received within preset time, and the master route confirms that the slave route 1 is successfully powered off.
Likewise, after receiving the shutdown execution code of slave route 1, the master route may listen for the heartbeat signal of slave route 1. If the heartbeat signal of the slave route 1 is not received within the preset time, the master route can determine that the slave route 1 has executed the shutdown operation and is successfully shutdown.
314. The main route determines that the downstream equipment is shut down, and executes a shutdown operation.
After determining whether each slave route performs a shutdown operation according to the shutdown execution code, the LAN DOWN message, and the heartbeat signal reported by each slave route, and whether the shutdown operation is successfully performed, the master route may determine whether to perform the shutdown operation. If all the slave routes of the master route have executed the shutdown operation, and after the shutdown is successful, the master route can execute the shutdown operation; otherwise, if there is a slave route that does not perform the shutdown operation or does not successfully shutdown, the master route does not perform the shutdown operation.
For example, after determining that slave route 1, slave route 2, and slave route 3 have all performed shutdown operations, and successfully shutting down, the master route may perform shutdown operations. If it is detected that the heartbeat signal of the slave route 1 and/or the slave route 2 and/or the slave route 3 is still normal, there is an unsuccessful shutdown of the slave route, and at this time, the master route will not perform a shutdown operation.
For any router of the master route, the slave route 1, the slave route 2, and the slave route 3, after confirming that there is no downstream device, or that the downstream device has performed a shutdown operation and has been successfully shutdown, the router determines whether to perform the shutdown operation according to the priority of the transaction being processed or to be processed in its own transaction queue, refer to step 306.
315. The main route returns the shutdown execution codes of all routers to the UE.
After the primary route confirms that the shutdown operation is performed, the primary route may also transmit a shutdown execution code "0" indicating that the shutdown operation has been performed to the UE. After receiving the shutdown execution code of the primary route, the UE may determine whether the primary route performs a shutdown operation according to the shutdown execution code.
In other embodiments, the master route may also send the UE a shutdown execution code of each slave route when sending its own shutdown execution code, so that the UE may determine the specific situation of each slave route.
The ue displays a one-touch power down result.
After receiving the shutdown execution code "0" of the primary route, the UE may determine that the primary route has executed a shutdown action. At the same time, the UE may also determine that all slave routes in the network 10 have performed a shutdown operation and that the shutdown was successful. At this time, the UE may display a prompt for success of the one-touch power down in the screen, indicating success for the one-touch power down.
If the shutdown execution code of the primary route is not "0", the UE may prompt the user for a one-touch shutdown failure. Further, according to the specific values of the shutdown execution codes of the master route and/or the slave route, the UE may determine the reason why the one-touch shutdown is not successfully completed. For example, when the shutdown execution code of the primary route is "100", "101", or "102", the UE may determine that the primary route is executing a high priority operation to reject shutdown. When the shutdown execution code of the master route is "103", the UE may determine that there is a slave route in the network that is not shutdown.
In the method that the master route also returns the shutdown execution code of other slave routes in the network 10 to the UE, the UE may also show that each slave route refuses to execute the shutdown operation or does not succeed in shutdown, so that the user can understand the specific situation. For example, referring to what is shown in window 251 shown in fig. 2F, the UE may prompt the user that a system upgrade operation is being performed from route 1, and that shutdown fails; the downstream equipment of the main route is not shut down, and the shutdown fails.
Fig. 4 is a flowchart of a router according to an embodiment of the present application for executing a shutdown operation according to a one-touch shutdown instruction.
The router 41 shown in fig. 4 may be a master route or a slave route in the network 10 shown in fig. 1. When router 41 is the primary route, there is no upstream device 42. When router 41 is a tail-end route, there is no downstream device 43. When router 41 is an intermediate node route, there is an upstream device 42 and a downstream device 43. Whether router 41 is the master route or any one of the slave routes in the network, router 41 may be directly connected to the UE.
Taking the network 10 shown in fig. 1 as an example, when the router 41 is the primary route, the router 41 is directly connected with the UE, and there is no upstream device 42, and the downstream device 43 includes the secondary routes 1 to 3; when the router 41 is the slave route 1, the router 41 is not directly connected with the UE, the upstream device 42 is the master route, and the downstream device 43 is the slave route 3; when the router 41 is the slave route 2, the router 41 is not directly connected with the UE, the upstream device 42 is the master route, and the downstream device 43 is not arranged; when router 41 is slave route 3, router 41 is not directly connected to the UE, and upstream device 42 is slave route 1 without downstream device 43.
The router 41 includes a shutdown processing module, a service configuration module, a kernel layer, a driver layer, and hardware.
The shutdown processing module records processing logic for implementing the one-key shutdown control method. The shutdown processing module may be configured to receive a one-key shutdown request of the UE, distribute a one-key shutdown instruction, determine whether to perform a shutdown operation, perform the shutdown operation, return a shutdown result, and so on.
The router 41 also includes a shutdown script file. The shutdown script file is used for converting a one-key shutdown request of the UE into a shutdown instruction (for short, a shutdown instruction) for controlling the router to execute a shutdown operation. The coding language used by the shutdown script file is, for example, LUA language. The embodiment of the application does not limit the coding language used by the shutdown script file.
The service configuration module may obtain the transaction queue of the router 41, determine the priority of the transaction being processed or to be processed by the router 41, and then the service configuration module may determine whether to allow the router 41 to perform a shutdown operation according to the priority of the transaction.
The driver layer may register a shutdown interface at the kernel layer. The shutdown interface corresponds to a specific pin number of the general purpose input/output, i.e. GPIO (General Purpose Input Output). This particular GPIO number may be referred to as a first pin number. And calling the shutdown interface, and enabling the shutdown processing module to pull up or pull down the corresponding hardware pin according to the GPIO number corresponding to the shutdown interface, so that the function of closing the router is realized.
In combination with the software and hardware structure of the router 41 shown in fig. 4, the specific steps of the router executing the shutdown operation according to the one-touch shutdown instruction are as follows:
in the network 10 shown in fig. 1, after receiving a one-touch shutdown request sent by a UE, a shutdown processing module of a main router may invoke a shutdown script to convert the one-touch shutdown request sent by the UE into a shutdown instruction for controlling the router to perform a shutdown operation. The shutdown processing module may then issue the shutdown instruction to the downstream device 43 of the primary route: slave routes 1-3 to control downstream device 43 to perform a shutdown operation.
It will be appreciated that when the router 41 is a slave router, the router 41 may receive a shutdown instruction sent by the upstream device 42, and need not be converted by a shutdown script. When the UE is communicated with the slave routes, the slave routes can upload one-key shutdown requests of the UE to the master routes, and the master routes call shutdown scripts to convert the one-key shutdown requests of the UE into shutdown instructions and then issue the shutdown instructions to each slave route.
After sending the shutdown instruction to the downstream device 43, the router 41 may wait for the downstream device 43 to return a shutdown execution code to confirm whether the downstream device 43 thereof performs the shutdown operation. Meanwhile, the router 41 may also determine whether the downstream device 43 is successfully powered off according to the LAN DOWN message and the heartbeat signal.
In the scenario of confirming that the downstream device 43 has performed the shutdown operation and successfully shutdown, the shutdown processing module acquires a file lock from the service configuration module, and confirms whether the router 41 can perform the shutdown operation. The file lock is a right indicating whether the router 41 can perform a shutdown operation. If the shutdown processing module can acquire the file lock from the service configuration module, the shutdown processing module can further execute shutdown operation. Otherwise, if the shutdown processing module cannot acquire the file lock from the service configuration module, the shutdown processing module cannot execute shutdown operation.
The service configuration module may determine whether to give the shutdown processing module a file lock for executing the shutdown operation according to the priority of the transaction being processed or to be processed stored in the queue. With reference to the foregoing description of the embodiments, when a high priority transaction such as a system upgrade, restart, restore factory settings, etc. is stored in the queue, the service configuration module may refuse to deliver the file lock to the shutdown processing module.
Taking the shutdown execution code "100" shown in table 1 as an example, when the transaction to be executed in the queue includes a system upgrade transaction, the service configuration module may further determine the shutdown execution code "100" when rejecting the delivery of the file lock, and send the shutdown execution code to the shutdown processing module. In this way, when the shutdown processing module returns a message for refusing shutdown to the UE, the shutdown processing module may also instruct the reason that the UE refuses shutdown to be known by the user. When there is no high priority transaction in the queue, the service configuration module may commit the file lock to the shutdown processing module and return a shutdown execution code "0" to the shutdown processing module.
After determining the shutdown execution code, the shutdown processing module may return the shutdown execution code to the upstream device 42. For example, when the shutdown processing module successfully acquires the file lock, the shutdown processing module may return a shutdown execution code of "0" to the upstream device 42; when the shutdown processing module does not acquire the file lock, the shutdown processing module may return a shutdown execution code "100", "101", or 102 "to the upstream device 42. In a scenario where it is confirmed that the downstream device 43 does not perform the shutdown operation, for example, when the shutdown execution code returned by the downstream device 43 received by the router 41 is "100", "101", "102" or "103", the shutdown processing module may confirm that the router 41 also does not perform the shutdown operation, and return the shutdown execution code "103" to the upstream device.
After the file lock is obtained, that is, after the execution of the shutdown operation is confirmed, the shutdown processing module may call a shutdown interface provided by the kernel layer. In response to the calling action, the driving layer can pull up or pull down the corresponding processor pin according to the GPIO number corresponding to the shutdown interface, so that shutdown operation is realized.
In an embodiment of the present application, in the present application,
the local area network consisting of a plurality of routers and UEs shown in fig. 1 may be referred to as a first network. The master route in the network shown in fig. 1 may be referred to as a first router, and the slave route 1, slave route 2 may be referred to as a second router.
The one-touch power-off request sent by the UE to the primary route in step 301 in the flowchart shown in fig. 3 may be referred to as a first request; the shutdown instructions sent by the master route to its downstream devices from route 1 and from route 2 may be referred to as first instructions. The shutdown executions "0" introduced in step 306 may be referred to as a first shutdown executions, and the shutdown executions "100", "101", "102" and "103" may be referred to as a second shutdown executions.
In the network shown in fig. 1, in the scenario where the slave route 1 is the second router, the slave route 3 may be referred to as a third router, the shutdown executions "0" sent from the slave route 3 to the slave route 1 may be referred to as a third shutdown executions, and the shutdown executions "100", "101", "102", and "103" sent from the slave route 3 to the slave route 1 may be referred to as fourth shutdown executions.
The user interface 23 shown in fig. 2C may be referred to as a first interface, and the buttons 229 in the user interface 23 may be referred to as first controls.
The user interfaces shown in fig. 2E-2G may be referred to as second interfaces; the shutdown result displayed in the second interface of fig. 2E indicates that all routers in the first network have been shutdown; the shutdown results displayed in the second interface depicted in fig. 2F and 2G indicate that one or more routers included in the first network are not shutdown.
Fig. 5 is a schematic structural diagram of a router 41 according to an embodiment of the present application.
Router 41 may include a processor 51, a memory 52, an interface 53, a wireless communication module 54, and a power switch 55. It will be appreciated that the architecture illustrated in the embodiments of the present application does not constitute a specific limitation on the router 41. In other embodiments of the application, router 41 may include more or fewer components than shown in FIG. 5, or may combine certain components, or split certain components, or a different arrangement of components. The components shown in fig. 5 may be implemented in hardware, software, or a combination of software and hardware.
The processor 51 may include one or more processing units, such as: the processor 51 may include an application processor (application processor, AP), a modem processor, a controller, a digital signal processor (digital signal processor, DSP), a baseband processor, etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. A memory may also be provided in the processor 51 for storing instructions and data.
In some embodiments, the processor 51 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, and/or a universal serial bus (universal serial bus, USB) interface, etc. Wherein the GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal.
In the embodiment of the present application, when the shutdown processing module of the router 41 invokes the shutdown interface to perform the shutdown operation, the shutdown processing module may acquire the GPIO code corresponding to the shutdown interface, and further set up the pull-up or pull-down of each pin of the GPIO interface according to the GPIO code, so as to implement shutdown of the router 41.
Memory 52 may include one or more random access memories (random access memory, RAM) 52A and one or more non-volatile memories (NVM) 52B.
The random access memory may include static random-access memory (SRAM), dynamic random-access memory (dynamic random access memory, DRAM), synchronous dynamic random-access memory (synchronous dynamic random access memory, SDRAM), double data rate synchronous dynamic random-access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, e.g., fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM), etc. The nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The RAM may be directly readable and writable by the processor 51, may be used for storing an operating system or other executable program (e.g., machine instructions) of a program in operation, may also be used for storing data of a user and an application program, etc. The NVM stored in the NVM may be loaded in advance into the RAM for the processor 51 to directly read and write. For example, a shutdown script file, such as that shown in FIG. 4, may be stored in the NVM. When the shutdown processing module obtains the shutdown script file, the shutdown processing module may read the shutdown script file into the processor 51.
Interface 53 includes WAN interface 53A, LAN interface 53B. Referring to the description of fig. 1, WAN interface 53A may be connected to a cat to access the internet. The LAN interface 53B may be connected to the LAN interface 53B of another router, so as to implement coverage expansion of the router by Mesh networking or other networking methods.
The wireless communication module 54 includes an antenna 56. The wireless communication module 54 may transmit and receive electromagnetic wave signals through an antenna 56. The wireless communication module 54 may provide a wireless communication solution including a wireless local area network (wireless local area networks, WLAN) applied on the router 41. In an embodiment of the present application, the slave route 2 and the master route may establish a wireless connection through the wireless communication module 54. Each router in the network may establish a connection with the UE through the function of transmitting and receiving electromagnetic wave signals provided by the wireless communication module 54, and thus communicate data with the UE.
The power switch 55 may include a switch button and a remote shutdown control circuit. The user can manually control the router to be started or shut down through the switch button. In the embodiment of the present application, the user may also control the router 41 to be turned off through the UE. In response to the shutdown processing module invoking the shutdown interface to shutdown the router 41, the remote shutdown control circuit in the power switch 55 may perform a corresponding pin pull-up or pull-down operation, thereby implementing shutdown of the router 41.
Fig. 6 is a schematic structural diagram of a UE according to an embodiment of the present application.
The UE may include a processor 61, an internal memory 63, an external memory interface 64, a display 65, a touch sensor 66, a wireless communication module 67, and the like. It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the UE. In other embodiments of the application, the UE may include more or fewer components than shown in fig. 6, or may combine certain components, or split certain components, or a different arrangement of components. The components shown in fig. 6 may be implemented in hardware, software, or a combination of software and hardware.
Processor 61 may include one or more processing units such as, for example: the processor 61 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. A memory may also be provided in the processor 61 for storing instructions and data. In some embodiments, the memory in processor 61 is a cache memory. The memory may hold instructions or data that has just been used or recycled by the processor 61. If the processor 61 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 61 is reduced, thus improving the efficiency of the system.
The wireless communication function of the UE may be implemented by a wireless communication module 67, an antenna 68, and the like. The antenna 68 is used for transmitting and receiving electromagnetic wave signals. Each antenna in the UE may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas.
The wireless communication module 67 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. for application on a UE. The wireless communication module 67 may be one or more devices integrating at least one communication processing module. The wireless communication module 67 receives electromagnetic waves via the antenna 68, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 61. The wireless communication module 67 may also receive signals to be transmitted from the processor 61, frequency modulate them, amplify them, and convert them to electromagnetic waves for radiation via the antenna 68. In the embodiment of the present application, the UE sends a one-touch shutdown instruction to the router through the wireless communication module 67, the antenna 68, and the like, and receives a shutdown execution code returned by the router.
The UE implements display functions through the GPU, the display screen 65, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 65 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 61 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 65 is for displaying images, videos, and the like. The display screen 65 includes a display panel. The display screen 65 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD). The display panel may also be manufactured using organic light-emitting diode (OLED), active-matrix organic light-emitting diode (AMOLED) or active-matrix organic light-emitting diode (active-matrix organic light emitting diode), flexible light-emitting diode (FLED), mini, micro-OLED, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device may include 1 or N display screens 65, N being a positive integer greater than 1.
In the embodiment of the present application, the UE implements a display function through the GPU, the display screen 65, and the application processor, and displays the user interfaces shown in fig. 2A to 2G.
The touch sensor 66, also referred to as a "touch device". The touch sensor 66 may be disposed on the display screen 65, and the touch sensor 66 and the display screen 65 form a touch screen, which is also called a "touch screen". The touch sensor 66 is used to detect a touch operation acting on or near it. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 65. In other embodiments, the touch sensor 66 may also be disposed on the surface of the UE at a different location than the display screen 65.
In an embodiment of the present application, in displaying the user interfaces shown in fig. 2A to 2G, the UE detects whether there is an operation acting on the user interface and an operation acting on which control in the user interface through the touch sensor 66.
The internal memory 63 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM).
The random access memory may include static random-access memory (SRAM), dynamic random-access memory (dynamic random access memory, DRAM), synchronous dynamic random-access memory (synchronous dynamic random access memory, SDRAM), double data rate synchronous dynamic random-access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, e.g., fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM), etc. The nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The RAM may be directly readable and writable by the processor 61, may be used for storing an operating system or other executable program (e.g. machine instructions) of a program in operation, may also be used for storing data of a user and an application program, etc. The NVM may also store executable programs, store data of users and applications, etc., and may be loaded into the RAM in advance for direct reading and writing by the processor 61.
In an embodiment of the present application, a first application installed on the UE that provides for remote control of router shutdown, or a browser application that provides a first web page, may be stored in NVM. When the UE runs the first application or browser application, the corresponding application code may be loaded into RAM and then sent to the processor 61 for execution.
The external memory interface 64 may be used to connect to external non-volatile memory to enable expansion of the memory capabilities of the UE. The external nonvolatile memory communicates with the processor 61 through the external memory interface 64 to realize a data storage function. The executable programs stored in the NVM, data of the user and application programs, etc. may also be stored in an external memory connected to the external memory interface 64. Also, the UE may load program code and user data of the program into the RAM while running the program.
The term "User Interface (UI)" in the description and claims of the present application and in the drawings is a media interface for interaction and information exchange between an application program or an operating system and a user, which enables conversion between an internal form of information and a form acceptable to the user. The user interface of the application program is source code written in a specific computer language such as java, extensible markup language (extensible markup language, XML) and the like, the interface source code is analyzed and rendered on the terminal equipment, and finally the interface source code is presented as content which can be identified by a user, such as a picture, characters, buttons and the like. Controls (controls), also known as parts (widgets), are basic elements of a user interface, typical controls being toolbars (toolbars), menu bars (menu bars), text boxes (text boxes), buttons (buttons), scroll bars (scrollbars), pictures and text. The properties and content of the controls in the interface are defined by labels or nodes, such as XML specifies the controls contained in the interface by nodes of < Textview >, < ImgView >, < VideoView >, etc. One node corresponds to a control or attribute in the interface, and the node is rendered into visual content for a user after being analyzed and rendered. In addition, many applications, such as the interface of a hybrid application (hybrid application), typically include web pages. A web page, also referred to as a page, is understood to be a special control embedded in an application program interface, and is source code written in a specific computer language, such as hypertext markup language (hyper text markup language, GTML), cascading style sheets (cascading style sheets, CSS), java script (JavaScript, JS), etc., and the web page source code may be loaded and displayed as user-recognizable content by a browser or web page display component similar to the browser function. The specific content contained in a web page is also defined by tags or nodes in the web page source code, such as GTML defines elements and attributes of the web page by < p >, < img >, < video >, < canvas >.
A commonly used presentation form of the user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It may be an interface element such as an icon, a window, a control, etc. displayed in a display screen of the electronic device, where the control may include a visual interface element such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, etc.
As used in the specification of the present application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this disclosure refers to and encompasses any or all possible combinations of one or more of the listed items. As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to detection …" depending on the context. Similarly, the phrase "at the time of determination …" or "if detected (a stated condition or event)" may be interpreted to mean "if determined …" or "in response to determination …" or "at the time of detection (a stated condition or event)" or "in response to detection (a stated condition or event)" depending on the context.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.

Claims (29)

1. A shutdown control method applied to a first router, the method comprising:
receiving a first request from User Equipment (UE) accessing a first network, wherein the first network is a network where the first router is located, and the first request is used for indicating all routers in the first network to execute shutdown operation;
sending a first instruction to a second router, wherein the second router is downstream equipment of the first router in the first network, and the first instruction is generated according to the first request and is used for controlling the router to execute shutdown operation;
after receiving the first shutdown execution code, executing shutdown operation; the first shutdown execution code is indication information sent by the second router and used for indicating that the second router has executed shutdown operation.
2. The method of claim 1, wherein after receiving the first shutdown execution code, the method further comprises, after executing the shutdown operation: returning a first shutdown result to the UE, wherein the first shutdown result comprises: the first router is powered off and the second router is powered off.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
after receiving the second shutdown execution code, refusing to execute the shutdown operation; the second shutdown execution code is indication information sent by the second router and used for indicating that the second router refuses to execute shutdown operation.
4. The method of claim 3, wherein after receiving the second shutdown execution code, the method further comprises, after refusing to execute the shutdown operation: and returning a second shutdown result to the UE, wherein the second shutdown result comprises: the first router is not powered off, and the second router is not powered off.
5. The method according to any one of claims 1-4, further comprising:
determining whether a first transaction exists in a first queue, wherein the first queue is a queue of executing transactions and/or to-be-executed transactions stored in the first router, and the priority of the first transaction is higher than that of the shutdown operation;
After receiving the first shutdown execution code, executing a shutdown operation, including:
after receiving a first shutdown execution code and confirming that the first transaction is absent from the first queue, a shutdown operation is performed.
6. The method of claim 5, wherein the method further comprises: after receiving a first shutdown execution code and confirming that there is the first transaction in the first queue, refusing to execute a shutdown operation.
7. The method of claim 6, wherein after receiving a first shutdown execution code and confirming that there is the first transaction in the first queue, the method further comprises, after refusing to execute a shutdown operation: returning a third shutdown result to the UE, wherein the third shutdown result comprises: the first router is not powered off, and the second router is powered off.
8. The method of any of claims 5-7, wherein the first transaction comprises one or more of: system upgrade, restart, restore factory settings.
9. The method according to any one of claims 1-8, further comprising:
confirming whether the second router is successfully powered off;
After receiving the first shutdown execution code, executing a shutdown operation, including:
and after receiving the first shutdown execution code and confirming that the second router is successfully shutdown, executing shutdown operation.
10. The method of claim 9, wherein said confirming whether the second router was successfully powered off comprises: monitoring the heartbeat signal of the second router, and confirming whether the second router is successfully powered off according to a monitoring result; and when the heartbeat signal of the second router is not monitored within the preset time, the second router is confirmed to be successfully powered off.
11. The method of claim 10, wherein the predetermined time is less than a heartbeat signal period of the second router in a normal operating state.
12. The method of claim 10, wherein the connection established by the first router with the second router is a wired connection, and wherein the confirming whether the second router was successfully powered off comprises:
monitoring the state of the wired connection, and confirming whether the second router is powered off successfully or not according to the state of the wired connection;
when the first interface is acquired to close the LAN DOWN message, the second router is confirmed to be successfully powered off; the first LAN DOWN message is a message generated when the wired connection is disconnected to indicate that the second router was successfully powered DOWN.
13. The method of any of claims 1-12, wherein the performing a shutdown operation comprises:
invoking a shutdown interface provided by a kernel layer; the shutdown interface corresponds to the first pin number;
and setting a general input/output pin according to the first pin number to finish shutdown operation.
14. A method according to claim 3, characterized in that the method further comprises:
sending the first instruction to a third router through the second router, wherein the third router is downstream equipment of the second router in the first network; the second router performs a shutdown operation after receiving a third shutdown execution code from the third router, wherein the third shutdown execution code is indication information sent by the third router and indicating that the third router has performed the shutdown operation.
15. The method of claim 14, wherein the second shutdown execution code is sent after the second router receives a fourth shutdown execution code from a third router; the fourth shutdown execution code is indication information sent by the third router and indicating that the third router refuses to execute shutdown operation.
16. The method of claim 1, wherein the UE accesses the first network through the second router, the receiving the first request comprising: and receiving a first request sent by the UE through the second router.
17. A power-off control method applied to a user equipment UE, wherein the UE accesses a first network, the first network including at least two routers, the method comprising:
displaying a first interface, wherein a first control is displayed in the first interface;
after detecting a first user operation on the first control, sending a first request to the first network; the first request is used for controlling all routers in the first network to execute shutdown operation;
and displaying a second interface, wherein the second interface displays a shutdown result of the first network.
18. The method of claim 17, wherein the shutdown result indicates: all routers in the first network have been powered off; or, one or more routers included in the first network are not powered off.
19. The method of claim 18, wherein when the shutdown result indicates that one or more routers included in the first network are not shutdown, further displaying a reason for the one or more routers not shutdown.
20. The method of claim 19, wherein the cause comprises: the router is or will process the transaction of the high priority, or the downstream equipment of the said router is not shut down; the high priority transactions include one or more of the following: system upgrade, restart, restore factory settings.
21. The method of any of claims 17-20, the first network comprising a first router and a second router, the second router being a device downstream of the first router, the UE accessing the first network through the first router, the sending the first request to the first network comprising: the first request is sent to the first router.
22. The method of claim 21, wherein the shutdown result is determined by the UE based on a shutdown execution code returned by the first router, the shutdown execution code returned by the first router including shutdown execution codes of some or all routers in the first network; the shutdown execution code of a router indicates whether the router has executed a shutdown operation.
23. The method of claim 22, wherein the shutdown executions code of a router is determined based on first information of the router, the first information including executing and/or to-be-executed transactions stored in a queue of the router and shutdown executions codes of devices downstream of the router.
24. The method of claim 23, wherein the first information further comprises a heartbeat signal of a device downstream of the router.
25. The method of claim 23, wherein the connection between the first router and the second router is a wired connection, the first information of the first router further comprising a first interface off LAN DOWN message; the first LAN DOWN message is to indicate that the second router was successfully powered DOWN.
26. The method of claim 17, wherein the first network comprises a first router and a second router, the second router being a device downstream of the first router, the UE accessing the first network through the second router, the sending the first request to the first network comprising: and sending the first request to the first router through the second router.
27. An electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, the one or more memories for storing computer program code comprising computer instructions that when executed by the one or more processors cause the method of any of claims 1-16 to be performed or the method of any of claims 17-26 to be performed.
28. A chip system for application to an electronic device, the chip system comprising one or more processors configured to invoke computer instructions to cause performance of the method of any of claims 1-16 or to perform the method of any of claims 17-26.
29. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the method of any one of claims 1-16 to be performed or the method of any one of claims 14-26 to be performed.
CN202211150759.9A 2022-09-21 2022-09-21 Shutdown control method Active CN116709475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211150759.9A CN116709475B (en) 2022-09-21 2022-09-21 Shutdown control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211150759.9A CN116709475B (en) 2022-09-21 2022-09-21 Shutdown control method

Publications (2)

Publication Number Publication Date
CN116709475A true CN116709475A (en) 2023-09-05
CN116709475B CN116709475B (en) 2024-04-12

Family

ID=87822734

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211150759.9A Active CN116709475B (en) 2022-09-21 2022-09-21 Shutdown control method

Country Status (1)

Country Link
CN (1) CN116709475B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7606241B1 (en) * 2005-08-12 2009-10-20 Juniper Networks, Inc. Extending standalone router syntax to multi-chassis routers
CN101800701A (en) * 2010-02-24 2010-08-11 北京交通大学 Multicasting route control method based on centralized control
CN106209650A (en) * 2015-05-04 2016-12-07 宇龙计算机通信科技(深圳)有限公司 The control method of a kind of wireless routing and device
CN106210296A (en) * 2016-07-04 2016-12-07 周英 A kind of router control device of wireless
CN106773870A (en) * 2017-01-12 2017-05-31 上海创米科技有限公司 A kind of method and device for automatically controlling router switch machine
CN110601979A (en) * 2018-06-13 2019-12-20 丛林网络公司 Smooth restart procedure for label switched paths with label stacks

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7606241B1 (en) * 2005-08-12 2009-10-20 Juniper Networks, Inc. Extending standalone router syntax to multi-chassis routers
CN101800701A (en) * 2010-02-24 2010-08-11 北京交通大学 Multicasting route control method based on centralized control
CN106209650A (en) * 2015-05-04 2016-12-07 宇龙计算机通信科技(深圳)有限公司 The control method of a kind of wireless routing and device
CN106210296A (en) * 2016-07-04 2016-12-07 周英 A kind of router control device of wireless
CN106773870A (en) * 2017-01-12 2017-05-31 上海创米科技有限公司 A kind of method and device for automatically controlling router switch machine
CN110601979A (en) * 2018-06-13 2019-12-20 丛林网络公司 Smooth restart procedure for label switched paths with label stacks

Also Published As

Publication number Publication date
CN116709475B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
US20220075696A1 (en) Application Exception Recovery
WO2020238425A1 (en) Application starting method and apparatus
US20170235435A1 (en) Electronic device and method of application data display therefor
JP4932842B2 (en) Network connectivity and radio conditions in the announcement area
US9760413B2 (en) Power efficient brokered communication supporting notification blocking
CN111684778B (en) Implementation method of application function and electronic equipment
US10296284B2 (en) Audio processing device and audio processing method
JP5566309B2 (en) Information processing apparatus and information processing method
US20170351531A1 (en) Information processing method and electronic apparatus thereof
KR20150025584A (en) Method for screen sharing and an electronic device
JP2010287205A (en) Electronic device, computer-implemented system, and application program display control method therefor
EP3168751B1 (en) Method for sharing application program and electronic device therefor
WO2017193926A1 (en) Data transmission method and device
US11979941B2 (en) Data transmission method and terminal
EP4318239A1 (en) Methods and apparatuses for calling application program, storage medium, and electronic device
CN110457621A (en) A kind of page display method, device and the medium of mixing application
CN113613064A (en) Video processing method, device, storage medium and terminal
US10146886B2 (en) Information processing system and method for adding additional modules
US20140043267A1 (en) Operation Method of Dual Operating Systems, Touch Sensitive Electronic Device Having Dual Operating Systems, and Computer Readable Storage Medium Having Dual Operating Systems
CN116709475B (en) Shutdown control method
WO2023088198A1 (en) Network connection method and apparatus, and electronic device
CN115421846A (en) Cross-device control method, control device, electronic device and readable storage medium
CN114666632B (en) Display device, control device and rapid wake-up method
CN116709004B (en) Image processing method and electronic equipment
CN115525187B (en) Screen splitting method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant