Remote switch-on detection method, apparatus, device and medium
The remote power-on/off detection method using the PS/2 interface utilizes a microprocessor to simulate a PS/2 device, solving the problems of misoperation and status awareness in remote PC power-on/off detection, and realizing real-time and reliable remote power-on/off detection and feedback.
Patent Information
- Application Number
- CN202410049905.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-12
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-01-12
AI Technical Summary
Existing technologies cannot detect the successful power-on and power-off of remote PCs, and there are risks of misoperation and system malfunctions, making it impossible to perceive the operating status of the PC.
By using the PS/2 interface and employing a microprocessor to simulate a PS/2 device, PS/2 interface commands can be sent and received to monitor the PC's status information, enabling remote power on/off detection.
It enables successful power-on/off detection of remote PCs, reduces the risk of misoperation, provides real-time status feedback and reliable system interactivity, and simplifies user operation.
Smart Images

Figure CN118796281B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a remote startup / shutdown detection method and device, equipment and medium. BACKGROUND
[0002] Remote startup / shutdown refers to a method of remotely waking up / closing a personal computer (PC). With the development of society, the PC has become an indispensable device for entertainment, learning and work. Usually, the PC is turned off after use for safety and energy saving. Many times, when on the way to work or school, it is necessary to access the PC at home or in a remote office to retrieve data. If no one is available to turn on the PC, the remote startup method is needed to start the PC.
[0003] The prior art usually sends a broadcast message of a specific format in the local area network where the PC is located. After the PC network card listens to the wake-up message, the mainboard is notified to start the computer. However, this method can only start the PC, but cannot remotely turn off the PC, cannot perceive whether the PC has started successfully, and cannot perceive whether the PC is currently running normally. SUMMARY
[0004] The remote startup / shutdown detection method, device, equipment and medium provided by the present application can detect whether the to-be-controlled device has started successfully or turned off successfully.
[0005] In a first aspect, the present application provides a remote startup / shutdown detection method, applied to a startup device, the startup device being set on a to-be-controlled device through a PS / 2 interface of the to-be-controlled device, and the method comprising:
[0006] receiving a control instruction sent by a user terminal, the control instruction being a startup instruction or a shutdown instruction;
[0007] based on the instruction type of the control instruction, converting the control instruction into an interface instruction of a preset data type, the to-be-controlled device being able to recognize the preset data type, and the interface instruction being used to control the to-be-controlled device to start up or shut down;
[0008] sending the interface instruction to the to-be-controlled device;
[0009] obtaining state information generated by the to-be-controlled device in executing the interface instruction;
[0010] analyzing the state information to obtain a control result of the to-be-controlled device, the control result being used to indicate whether the to-be-controlled device has started up or shut down successfully.
[0011] In a second aspect, the application provides a remote power-on / off detection device, applied to a power-on device, the power-on device being arranged on a to-be-controlled device through a PS / 2 interface of the to-be-controlled device, and the device comprising:
[0012] a receiving module configured to receive a control instruction sent by a user terminal, the control instruction being a power-on instruction or a power-off instruction;
[0013] a conversion module configured to convert the control instruction into an interface instruction of a preset data type based on a type of the control instruction, the to-be-controlled device being able to recognize the preset data type, and the interface instruction being used to control the to-be-controlled device to power on or power off;
[0014] a sending module configured to send the interface instruction to the to-be-controlled device;
[0015] an obtaining module configured to obtain state information generated by the to-be-controlled device in response to the interface instruction;
[0016] an analyzing module configured to analyze the state information to obtain a control result of the to-be-controlled device, the control result being used to indicate whether the to-be-controlled device successfully powers on or powers off.
[0017] In a third aspect, an electronic device is provided, and the electronic device comprises a processor and a memory storing computer program instructions;
[0018] The processor implements the remote power-on / off detection method in any one of the embodiments of the first aspect when executing the computer program instructions.
[0019] In a fourth aspect, a computer storage medium is provided, and the computer storage medium stores computer program instructions, and the computer program instructions are executed by a processor to implement the remote power-on / off detection method in any one of the embodiments of the first aspect.
[0020] In a fifth aspect, a computer program product is provided, and instructions in the computer program product are executed by a processor of an electronic device to cause the electronic device to implement the remote power-on / off detection method in any one of the embodiments of the first aspect.
[0021] In the remote switch-on / off detection method, device and medium provided by the embodiment of the present application, a control instruction is received, the control instruction being a switch-on instruction or a switch-off instruction; the control instruction is converted into an interface instruction of a preset data type based on the instruction type of the control instruction, the interface instruction being used to control a to-be-controlled device to switch on or switch off, the to-be-controlled device being capable of identifying the preset data type; the interface instruction is sent to the to-be-controlled device; state information generated by the to-be-controlled device in executing the interface instruction is acquired; and the state information is analyzed to obtain a control result of the to-be-controlled device, the control result being used to indicate whether the to-be-controlled device successfully switches on or switches off. In the above manner, the on-off device can detect whether the to-be-controlled device successfully executes the switch-on or switch-off instruction by analyzing the state information, thereby realizing the detection function of remote switch-on / off. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0023] Figure 1 FIG. 1 is a flowchart of a remote switch-on detection method provided by an embodiment of the present application;
[0024] Figure 2 FIG. 3 is a schematic diagram of a communication connection among an on-on APP, an on-on device and a PC provided by an embodiment of the present application;
[0025] Figure 3 FIG. 5 is a structural schematic diagram of a PS / 2 interface provided by an embodiment of the present application;
[0026] Figure 4 FIG. 9 is a flowchart of a remote switch-off detection method provided by an embodiment of the present application;
[0027] Figure 5 FIG. 11 is a flowchart of a remote switch-off detection method provided by an embodiment of the present application;
[0028] Figure 6 FIG. 13 is a structural schematic diagram of a remote switch-on / off detection device provided by an embodiment of the present application;
[0029] Figure 7 FIG. 15 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable a more clear understanding of the above-mentioned objects, features and advantages of the present disclosure, the schemes of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0031] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other manners different from those described herein; it is apparent that the embodiments described in the specification are only a part of the embodiments of the present disclosure, and not all the embodiments.
[0032] It should be noted that, in this document, relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", "includes", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a... " does not exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0033] Currently, the following technical solutions are mainly used to realize remote startup:
[0034] 1) Remote wake-up (Wake-On-LAN, WOL): network wake-up, a specific format broadcast message is sent in the local area network where the PC is located, and the PC network card listens to the wake-up message and notifies the motherboard to start the computer. This method can only start the PC, but cannot realize remote PC shutdown, cannot perceive whether the PC has started successfully, and cannot perceive whether the PC is currently running normally.
[0035] 2) Power-on wake-up: the power module of the PC detects the 220V AC input state, and if the 220V AC changes from 0V to 220V, the motherboard is notified to start the computer. This method can realize PC startup and shutdown, but the PC shutdown adopts the power-off mode, which is easy to cause file loss or system exception, and the shutdown mode cannot be accepted by the user; this method cannot perceive whether the PC has started successfully or is running, and this method needs to cut off the power supply before starting, and then turn on the power supply to start, if the PC is currently running, it is easy to cause PC file loss or system exception due to the inability to perceive the PC running state.
[0036] 3) Remote control PC switch circuit: the switch circuit of the PC is modified, the PC is remotely connected to the remote control switch or mechanical device, and the start-up is simulated by manually clicking the PC switch to realize the start-up. This method can realize the start-up and shutdown of the PC, but the shutdown adopts the mode of simulating long-press power button to force shutdown, which also has the risk of causing system abnormality to some extent; this method cannot perceive whether the start-up is successful and the current running state of the PC, and has the risk of misoperation.
[0037] 4) Peripheral Component Interconnect (PCI) start-up board: add a PCI start-up device on the system mainboard, notify the mainboard to start the PC after receiving the start-up instruction, and send the shutdown instruction to the PCI drive software in the operating system to realize the shutdown. This method can start up and shut down the PC in a normal way and can perceive the current running state of the PC, but this method is difficult to use, requires the user to open the case and plug in the device on the mainboard, and install the drive software, which has the risk of damaging the PC during the installation process.
[0038] And in the prior art, most PC mainboards support Personal System / 2 (PS / 2) interface start-up, by sending PS / 2 instructions to the mainboard, the mainboard checks that the received instructions are completely consistent with the preset instructions, and then the PC is started. However, the PS / 2 interface does not provide a shutdown instruction, and needs to rely on the operating system instruction to complete, and the PS / 2 device cannot directly feedback the running state of the PC. PS / 2 refers to a computer interface standard used to connect a keyboard and a mouse.
[0039] In order to solve the problems in the prior art, the embodiments of the present application provide a remote start and shutdown detection method, device, equipment and medium.
[0040] The embodiments of the present application provide a remote start and shutdown detection method, device, equipment and medium. First, the remote start and shutdown detection method provided by the embodiments of the present application is introduced. As shown in the figure, Figure 1 The method is applied to a start-up device, the start-up device is set on a to-be-controlled device through a PS / 2 interface of the to-be-controlled device, and the method specifically includes the following steps:
[0041] S100, receiving a control instruction sent by a user terminal, the control instruction being a start-up instruction or a shutdown instruction.
[0042] Optionally, in the embodiments of the present application, the start-up device is simulated as a PS / 2 device through a microcontroller unit (MCU), and is mounted on the PC (i.e. the to-be-controlled device) through the PS / 2 interface.
[0043] Optionally, in one possible implementation of the present application, a plug-in card supporting serial communication can be added at the hardware level, which communicates with the user terminal through a serial port. The serial port card is connected to the user terminal through a serial port line, so that the control instructions sent by the user terminal can be received.
[0044] At the software level, a serial port driver program can be written to communicate with the serial port card. The driver program needs to be able to receive data sent from the user terminal. A command analysis program is developed to analyze the control instructions sent from the user terminal. The program needs to be able to identify the power-on and power-off instructions.
[0045] In these optional embodiments, the specific implementation may vary depending on the hardware and software platforms. The hardware has high expansibility, so the appropriate serial port card and interface method can be selected according to the specific system configuration. The software aspect needs to write the corresponding driver program and control instruction analysis program according to the instruction set and operating system of the system.
[0046] Optionally, in one possible implementation of the present application, the boot device and the user terminal can communicate through cloud services. For example, the boot instruction can be transmitted through cloud services, and the boot device is connected to the same cloud service for communication, so that remote communication can be realized without being in the same network.
[0047] S200, based on the instruction type of the control instruction, converting the control instruction into an interface instruction of a preset data type, the interface instruction being used to control the to-be-controlled device to be powered on or powered off, the to-be-controlled device being able to identify the preset data type;
[0048] S300, sending the interface instruction to the to-be-controlled device.
[0049] Optionally, in the embodiment of the present application, when the user terminal controls the power on / off, the boot device can receive the instruction sent by the boot application (Application, App) (i.e., the user terminal) through the instruction receiving module, and hand it over to the MCU microprocessor for processing. After processing, the MCU processor converts the boot instruction into a standard PS / 2 interface instruction recognizable by the PC, and sends it to the PC through the PS / 2 interface.
[0050] Optionally, in a possible implementation of the present application, the first booting device needs to parse the received control instruction, and determine whether it is a booting instruction or a shutting down instruction. Then, according to the type of the parsed control instruction, a preset data format and instruction type are formulated to ensure that the data is understood and executed by the to-be-controlled device. For example, a data format can be formulated for the booting instruction, and another data format can be formulated for the shutting down instruction. Then, the parsed control instruction is converted into an interface instruction of the preset data type. Specifically, the data field of the control instruction can be assembled and encoded to generate an interface instruction conforming to the preset data type. Finally, the generated interface instruction is sent to the to-be-controlled device through a communication link. The PS / 2 interface can be used for transmission.
[0051] S400, obtaining state information generated by the to-be-controlled device executing the interface instruction;
[0052] S500, analyzing the state information to obtain a control result of the to-be-controlled device, the control result being used to indicate whether the to-be-controlled device is successfully booted or shut down.
[0053] Optionally, in an example, as shown in Figure 2 the terminal device is taken as a booting APP, and the to-be-controlled device is taken as a PC.
[0054] 1) Booting App: used for human-computer interaction, capable of sending a booting / shutting down instruction through a communication link, and obtaining an execution result, and presenting the result to a user.
[0055] 2) Booting device: the booting device is simulated as a PS / 2 device through an MCU microprocessor, and is mounted on the PC through a PS / 2 interface. When booting or shutting down, the booting device receives an instruction sent by the booting App through an instruction receiving module, and gives the instruction to the MCU microprocessor for processing. After processing, the MCU processor converts the booting instruction into a standard PS / 2 interface instruction recognizable by the PC, and sends the instruction to the PC through the PS / 2 interface. Then, the booting device monitors a PS / 2 instruction sent by the PC and a clock pin level state in the PS / 2 interface, recognizes a command execution result through a specific algorithm, and sends the result to the booting App through the instruction receiving module.
[0056] 3) PC: a PC with a PS / 2 interface, used for being booted or shut down.
[0057] In the embodiments of the present application, the PS / 2 interface instruction is used to realize the start-up / shut-down of the PC. A device compatible with the PS / 2 interface accesses the PS / 2 interface of the PC, the user connects the device using the App and sends the start-up / shut-down instruction, the device converts the start-up / shut-down instruction into the PS / 2 protocol instruction to start up / shut down the PC, and the device can determine whether the start-up is successful according to the PS / 2 clock bus state, can accurately and timely feedback the execution result to the user, and prevents misoperation.
[0058] Optionally, in a feasible implementation manner of the present application, the acquisition and analysis of the state information need to be realized in the MCU program. For example, a protocol can be designed to ensure that the state information can be reliably transmitted to the start-up device. For another example, code can be written in the MCU program to analyze the state information transmitted back from the device to be controlled.
[0059] Specifically, the state information acquired from the device to be controlled can be analyzed in the MCU program first. Specifically, the binary or other form of state information can be converted into understandable data. For another example, an algorithm or logic can be designed to determine whether the analyzed state information indicates that the device to be controlled is successfully started up or shut down, which specifically involves checking a specific state code or state flag. Finally, the control result of the determination can be fed back to the start-up App. This can be achieved by sending the result information to the start-up App through the communication link, so that the user can know the state of the device to be controlled.
[0060] In the remote start-up / shut-down detection method provided in the embodiments of the present application, a control instruction is received, the control instruction being a start-up instruction or a shut-down instruction; the control instruction is converted into an interface instruction of a preset data type based on the instruction type of the control instruction, the device to be controlled can recognize the preset data type, and the interface instruction is used to control the device to be controlled to start up or shut down; the interface instruction is sent to the device to be controlled; state information generated by the device to be controlled in executing the interface instruction is acquired; and the state information is analyzed to obtain a control result of the device to be controlled, the control result being used to indicate whether the device to be controlled is successfully started up or shut down. In the above manner, the start-up device can detect whether the device to be controlled successfully executes the start-up or shut-down instruction by analyzing the state information, and the detection function of the remote start-up / shut-down is realized.
[0061] In an embodiment, the control instruction is a start-up instruction; and the step 200 can be specifically implemented as follows:
[0062] S210, the start-up instruction is analyzed by the microprocessor of the start-up device based on a preset analysis algorithm to obtain a first PS / 2 keyboard instruction code, and the first PS / 2 keyboard instruction code is used to control a preset fast start-up key of the device to be controlled.
[0063] Optionally, in the embodiments of the present application, asFigure 3 As shown, the PS / 2 interface has 5 pins, the 4th and 5th pins are used to supply power to the PS / 2 device from the PC; the 3rd pin is idle and has no specific use; the 1st pin is used to generate a data synchronization clock; the 2nd pin is a data transmission pin; once the clock pin changes from high to low, the PC and the PS / 2 device can exchange 1 bit of data through the data transmission pin.
[0064] In these optional embodiments, the first PS / 2 keyboard instruction code is obtained by analyzing the power-on instruction based on a preset analysis algorithm, and this instruction code is specifically used to simulate the fast power-on key on the device to be controlled. In this way, the power-on device can send the instruction of simulating the key to the device to be controlled through the PS / 2 interface, thereby achieving the effect of fast power-on.
[0065] In an embodiment, the step 300 can specifically perform the following steps:
[0066] S310, sending the first PS / 2 keyboard instruction code to the device to be controlled through the clock pin and the data pin of the PS / 2 interface.
[0067] In these optional embodiments, the first PS / 2 keyboard instruction code is sent to the device to be controlled using the clock pin and the data pin of the PS / 2 interface. This direct physical connection method is more reliable, avoiding message loss or distortion that may occur in the communication link. Moreover, the characteristics of the PS / 2 interface allow for hardware communication with strong real-time performance. Through synchronous transmission of the clock pin and the data pin, the timely delivery of the instruction can be ensured, the communication delay is reduced, and the real-time performance of the control is improved. Since the PS / 2 interface is used, no additional hardware modification is needed for the device to be controlled. This helps to maintain the original state of the device to be controlled, reducing unnecessary complexity and risk.
[0068] In an embodiment, the step 400 can specifically perform the following steps:
[0069] S410, monitoring the first instruction sent by the device to be controlled and received by the clock pin and the data pin, the first instruction being generated by the device to be controlled based on the first PS / 2 keyboard instruction code, and the first instruction being used to control the power-on device.
[0070] In an embodiment, after the step 410, the method can further specifically perform the following steps:
[0071] S411, in the case of monitoring the first instruction, sending reply information to the device to be controlled.
[0072] In these optional embodiments, by monitoring the first instruction sent by the to-be-controlled device, the starting device can perceive the state and feedback of the to-be-controlled device in real time. This helps to maintain the real-time nature of the communication link and ensures the timely delivery of control and state information.
[0073] In the case of monitoring the first instruction, reply information is sent back to the to-be-controlled device. In this way, the starting device can confirm the receipt of the instruction to the to-be-controlled device and provide a feedback to the to-be-controlled device to know the execution of the instruction. Such two-way communication helps to improve the reliability and interactivity of the system.
[0074] Through the reply information, the to-be-controlled device can deliver the execution result of the instruction to the starting device. This helps the starting device to obtain information about the state of the to-be-controlled device, such as whether the starting instruction is successfully executed. Such feedback information is visible to the user, improving the user's perception of the system state. In general, the steps S410 and S411 form a real-time monitoring and response mechanism, ensuring the reliability of communication, the correct execution of instructions, and providing two-way information delivery, enhancing the interactivity and user experience of the system.
[0075] In an embodiment, the above step 500 can be specifically implemented as follows:
[0076] S510, in the case of the first instruction being a disable instruction, determining the disable identifier of the starting device as the first identifier;
[0077] S520, in the case of the first instruction being an enable instruction, determining the disable identifier as the second identifier;
[0078] S530, in the case of the first instruction being a reset instruction, if the disable identifier is the second identifier, obtaining the number of times of receiving the first instruction;
[0079] S540, in the case of the number of times of receiving being greater than or equal to the first preset number of times, determining the control result as the first result, the first result being used to indicate that the to-be-controlled device is successfully started.
[0080] Optionally, in a specific implementation manner of the present application, as shown in Figure 4 the control device is started, and the specific process of monitoring whether the device is successfully started is as follows:
[0081] 1) Boot App: Boot App sends a boot request to PS / 2 boot device through a communication link. After the boot request is sent successfully, a timeout timer is started (the timer timeout time can be manually set according to the operating system startup time). If the boot result from the PS / 2 boot device is received by the Boot App before the timer expires, the specific boot result is displayed; if the boot result from the PS / 2 boot device is not received by the Boot App until the timer expires, a boot abnormality is displayed.
[0082] 2) Booted PC: A standard PC is used, and no circuit modification is made on the PC, nor does the PC run auxiliary software.
[0083] 3) PS / 2 boot device: After receiving the boot request, the boot device analyzes and converts the boot request into PS / 2 keyboard instruction code, and then sends the instruction to the PC through the CLK (clock) pin and the Data (data) pin of the MCU microprocessor operating the PS / 2 interface. After the instruction is sent, the PS / 2 boot device will always monitor the CLK (clock) pin and the Data (data) pin of the PS / 2 interface and identify the control instruction sent by the PC for reply, which is mainly to deceive the PC and make the PC identify the PS / 2 boot device as a keyboard device. At the same time, the PS / 2 boot device will save and process the received instruction, and the PS / 2 boot device focuses on the following three instructions sent by the PC: device reset (FF) instruction, device disable (F5) instruction, and device enable (F4) instruction. The PC motherboard will identify and initialize the keyboard during the startup of the Basic Input / Output System (BIOS) and the operating system, respectively. Therefore, the PS / 2 boot device only needs to record the number of reset instructions received to identify the current PC startup stage. During the boot process, the PC will disable the input device to prevent false input, and will re-enable it after the startup is completed. Therefore, the algorithm also needs to further exclude the interference of invalid reset commands according to whether the device is disabled when the reset instruction is received. The PS / 2 device will send the identification result to the Boot App in real time for display to the user.
[0084] In these optional embodiments, by using a timeout timer, the Boot App can listen to the feedback of the PS / 2 boot device in real time after sending the boot request. If the boot result is received before the timer expires, the user can immediately obtain specific boot information; otherwise, after the timer expires, the Boot App displays a boot abnormality, providing the user with the opportunity to handle the abnormality in a timely manner, enhancing the reliability and user experience of the system.
[0085] The standard PC is used without circuit modification or auxiliary software running on the PC, which helps the wide application of the scheme. The user does not need to make additional hardware or software settings on the PC, which simplifies the deployment and use process.
[0086] By cheating the PC, the PS / 2 boot device makes the PC identify it as a keyboard device, successfully simulates the working principle of the keyboard, and realizes a clever remote boot method.
[0087] By recording the number of reset instructions and monitoring whether the device is disabled, the PS / 2 boot device can accurately determine the stage and state of the PC startup. This helps to improve the perception of the PC state, eliminate abnormal situations, and send the identification results to the boot App in real time, providing detailed boot information for the user. In general, the scheme is characterized by real-time, simplicity, and reliability. Through the physical connection of the PS / 2 interface and the communication of the PS / 2 protocol, remote boot is realized, and the working principle of the PS / 2 boot device provides the beneficial effects of real-time feedback, abnormal handling, and state identification.
[0088] In an embodiment, the control instruction is a shutdown instruction; and the step 200 can specifically execute the following steps:
[0089] S220, based on a preset analysis algorithm, the microprocessor of the boot device analyzes the shutdown instruction to obtain a second PS / 2 keyboard instruction code, and the second PS / 2 keyboard instruction code is used to control a preset quick shutdown key of the device to be controlled;
[0090] In an embodiment, the step 300 can specifically execute the following steps:
[0091] S320, the second PS / 2 keyboard instruction code is sent to the device to be controlled through the clock pin and the data pin of the PS / 2 interface.
[0092] In an embodiment, the step 400 can specifically execute the following steps:
[0093] S420, every target time interval, the level state of the clock pin of the PS / 2 interface is obtained;
[0094] In an embodiment, the step 500 can specifically execute the following steps:
[0095] S550, in the case where the level state is a first state, after a preset time, a test instruction is sent to the device to be controlled, the test instruction is used to simulate a keyboard start instruction, and the first state is used to indicate that the voltage of the clock pin is less than a first preset threshold;
[0096] S560, in the case where the level state is the second state, obtaining a continuous number of times that the level state continuously is the second state, the second state being used for indicating that the voltage of the clock pin is greater than a second preset threshold value;
[0097] S570, in the case where the continuous number of times is greater than a second preset number of times, determining the control result as a second result, the second result being used for indicating that the to-be-controlled device is successfully powered off.
[0098] Optionally, in the specific implementation manner of the present application, as shown in Figure 5 the specific process of controlling the device to be powered off and monitoring whether the device is successfully powered off is as follows:
[0099] 1) Boot App: the Boot App sends a power-off request to the PS / 2 boot device through a communication link. After the Boot App successfully sends the power-off request, a timeout timer is started (the timer timeout time can be manually set according to the operating system shutdown time), if the Boot App receives the power-off result sent by the PS / 2 boot device before the timer times out, the specific power-off result is displayed; if the Boot App does not receive the power-off result fed back by the PS / 2 boot device until the timer times out, a power-off exception is displayed.
[0100] 2) PC to be powered off: a standard PC is used, and no circuit modification is made on the PC, and no auxiliary software is run on the PC.
[0101] 3) PS / 2 boot device: after the boot device receives the power-off request, the power-off request is analyzed and converted into a PS / 2 keyboard instruction code, and then the instruction is sent to the PC through the CLK (clock) pin and the Data (data) pin of the MCU microprocessor operating the PS / 2 interface. When the PC is running, the CLK (clock) pin is set to low to suppress the PS / 2 device from sending instructions to interfere with the processing of the PC during this period, and after the PC finishes processing the command, the CLK (clock) pin is released to be pulled low. Because there is a pull-up resistor on the CLK (clock) pin, the CLK level will automatically become high. Using this feature, after sending the power-off instruction, the PS / 2 boot device will send a test instruction every few seconds and continuously monitor the CLK (clock) pin level of the PS / 2 interface to see if there is any change. If the CLK level is still pulled low to suppress the instruction action, it means that the PC is still powered on and running; if the CLK level no longer has a pull-down suppression instruction action, it means that the PC has stopped running. In order to ensure reliability, the algorithm considers that the PC has been turned off only when the CLK pin is not pulled low by the PC for three consecutive times. The PS / 2 device simultaneously sends the identification result to the Boot App in real time for display to the user.
[0102] In these alternative embodiments, the PS / 2 power-on device utilizes the characteristics of the PC's clock pin when receiving and processing PS / 2 commands, enabling real-time status detection by monitoring changes in the CLK pin level. This method eliminates the need for the PC to actively report its status. Instead, by passively detecting changes in the CLK pin level, it provides more timely insight into the PC's operating status. This is particularly important for remote shutdown scenarios, as it allows users to determine whether the PC has been successfully shut down in the shortest possible time.
[0103] The algorithm cleverly exploits the fact that after a PC completes command processing, the CLK pin releases its voltage. Due to the pull-up resistor on the CLK pin, the CLK level automatically rises to a high level. This level characteristic enables the PS / 2 power-on device to accurately determine the PC's operating status by detecting the voltage change on the CLK pin. This hardware-based design is not only efficient but also stable and reliable.
[0104] To ensure the reliability of the shutdown state, the algorithm incorporates the requirement that the CLK pin not be pulled low by the PC for three consecutive times as a judgment condition, thereby eliminating the possibility of misjudgment due to short-term level changes. This multiple detection strategy enhances the robustness of the system's shutdown state judgment and improves detection reliability.
[0105] The PS / 2 power-on device sends the recognition results to the power-on app in real time for display to the user. This real-time feedback mechanism ensures that the user can promptly learn the shutdown status of the PC, allowing them to quickly take further actions or adjustments. This has a positive effect on user experience and operational convenience. In summary, this embodiment implements a real-time and reliable PC shutdown status perception and feedback mechanism by cleverly designing the status detection of the PS / 2 interface and utilizing the level characteristics, providing users with a better user experience.
[0106] In one embodiment, after step 500, the method may further specifically perform the following steps:
[0107] S510, sending status information to the user terminal;
[0108] In one embodiment, the above step 510 may specifically perform the following steps:
[0109] S511: When the timer of the user terminal exceeds the target time threshold, the sending of status information is stopped, and the timer starts timing when the user terminal sends a control instruction.
[0110] Optionally, in the embodiment of the present application, the start-up App starts a timeout timer after sending the start-up request successfully (the timeout time of the timer can be set manually according to the start-up time of the operating system), and if the start-up App receives the start-up result sent by the PS / 2 start-up device before the timeout of the timer, the specific start-up result is displayed; if the start-up App does not receive the start-up result fed back by the PS / 2 start-up device until the timeout of the timer, the start-up abnormality is displayed. The shutdown request is the same, which is not described in detail here.
[0111] Optionally, in the embodiment of the present application, the PS / 2 physical interface is directly connected to the PC, and the signal transmission is more reliable. The present application detects the instructions and level states transmitted by the PS / 2 interface physical connection line connected to the PC directly, and the PC running result is more accurate and rapid. Moreover, the PS / 2 protocol used by the present application belongs to a kind of serial protocol, and only a low-performance single-chip microcomputer MCU is needed to realize it, which is simple and convenient to realize.
[0112] Figure 6 The structure schematic diagram of the remote start-up and shutdown detection device provided by another embodiment of the present application is shown, and only the parts related to the embodiments of the present application are shown for the convenience of description.
[0113] Referring to Figure 6 , the remote start-up and shutdown detection device is applied to a start-up device, the start-up device is arranged on a to-be-controlled device through the PS / 2 interface of the to-be-controlled device, and the remote start-up and shutdown detection device can include:
[0114] The receiving module 601 is configured to receive the control instruction sent by the user terminal, the control instruction being a start-up instruction or a shutdown instruction.
[0115] The conversion module 602 is configured to convert the control instruction into an interface instruction of a preset data type based on the instruction type of the control instruction, the to-be-controlled device being capable of identifying the preset data type, and the interface instruction being used to control the to-be-controlled device to start up or shut down.
[0116] The sending module 603 is configured to send the interface instruction to the to-be-controlled device.
[0117] The obtaining module 604 is configured to obtain the state information generated by the to-be-controlled device executing the interface instruction.
[0118] The analysis module 605 is configured to analyze the state information to obtain the control result of the to-be-controlled device, the control result being used to indicate whether the to-be-controlled device starts up or shuts down successfully.
[0119] In an embodiment, the control instruction is a start-up instruction; and the conversion module 602 can include:
[0120] The first analysis submodule is configured to analyze the booting instruction based on a preset analysis algorithm by using the microprocessor of the booting device, and obtain a first PS / 2 keyboard instruction code, which is used to control a preset quick booting key of the to-be-controlled device.
[0121] In an embodiment, the sending module 603 can include:
[0122] The first sending submodule is configured to send the first PS / 2 keyboard instruction code to the to-be-controlled device through the clock pin and the data pin of the PS / 2 interface.
[0123] In an embodiment, the obtaining module 604 can include:
[0124] The first monitoring submodule is configured to monitor the first instruction sent by the to-be-controlled device and received by the clock pin and the data pin, the first instruction being generated by the to-be-controlled device based on the first PS / 2 keyboard instruction code, and the first instruction being used to control the booting device.
[0125] In an embodiment, the first monitoring submodule can include:
[0126] The first sending unit is configured to send reply information to the to-be-controlled device in the case where the first instruction is monitored.
[0127] In an embodiment, the analysis module 605 can include:
[0128] The first determining submodule is configured to determine the disable identifier of the booting device as the first identifier in the case where the first instruction is the disable instruction.
[0129] The second determining submodule is configured to determine the disable identifier as the second identifier in the case where the first instruction is the enable instruction.
[0130] The first obtaining submodule is configured to obtain the number of times of receiving the first instruction in the case where the first instruction is the reset instruction, if the disable identifier is the second identifier.
[0131] The third determining submodule is configured to determine the control result as the first result in the case where the number of times of receiving is greater than or equal to a first preset number of times, the first result being used to indicate that the to-be-controlled device is successfully booted.
[0132] In an embodiment, the control instruction is a shutdown instruction; and the conversion module 602 can further include:
[0133] The second analysis submodule is configured to analyze the shutdown instruction based on a preset analysis algorithm by using the microprocessor of the booting device, and obtain a second PS / 2 keyboard instruction code, which is used to control a preset quick shutdown key of the to-be-controlled device.
[0134] In an embodiment, the sending module 603 can further include:
[0135] The second sending sub-module is configured to send the second PS / 2 keyboard instruction code to the device to be controlled through the clock pin and the data pin of the PS / 2 interface.
[0136] In an embodiment, the obtaining module 604 can further include:
[0137] The second obtaining sub-module is configured to obtain the level state of the clock pin of the PS / 2 interface every target time interval.
[0138] In an embodiment, the analyzing module 605 can further include:
[0139] The third sending sub-module is configured to send a test instruction to the device to be controlled after a preset time when the level state is a first state, the test instruction being used to simulate a keyboard opening instruction, and the first state being used to indicate that the voltage of the clock pin is less than a first preset threshold.
[0140] The third obtaining sub-module is configured to obtain a continuous number of times that the level state is continuously in a second state when the level state is the second state, the second state being used to indicate that the voltage of the clock pin is greater than a second preset threshold.
[0141] The fourth determining sub-module is configured to determine the control result as a second result when the continuous number of times is greater than a second preset number of times, the second result being used to indicate that the device to be controlled is successfully powered off.
[0142] In an embodiment, the remote power-on / off detection apparatus can further include:
[0143] The second sending module is configured to send the state information to the user terminal.
[0144] In an embodiment, the second sending module can include:
[0145] The stopping sub-module is configured to stop sending the state information when the timing time of the timer of the user terminal exceeds a target time threshold, the timer starting timing when the user terminal sends a control instruction.
[0146] It should be noted that the information interaction, execution process, and the like between the above apparatuses / units are based on the same concept as the battery thermal runaway early warning method, and the above-described battery thermal runaway early warning method corresponds to the apparatus, and all implementation manners in the above method embodiments are applicable to the embodiments of the apparatus, specific functions and technical effects brought by the implementation manners can be referred to the method embodiments part, and details are not described herein.
[0147] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above described functions. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for convenient distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0148] Figure 7 A hardware structure schematic diagram of an electronic device provided by an embodiment of the present application is shown.
[0149] The device can include a processor 701 and a memory 702 storing program instructions.
[0150] The processor 701 executes the program to implement the steps in any of the above method embodiments.
[0151] For example, the program can be divided into one or more modules / units, one or more modules / units are stored in the memory 702 and executed by the processor 701 to complete the present application. One or more modules / units can be a series of program instruction segments that can complete a specific function, which is used to describe the execution process of the program in the device.
[0152] Specifically, the above processor 701 can include a central processing unit (CPU), or a specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement one or more embodiments of the present application.
[0153] The memory 702 can include mass storage for data or instructions. As an example and not by way of limitation, the memory 702 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a solid-state drive (SSD), a USB drive, or a combination of two or more of these. Where appropriate, the memory 702 can include removable or non-removable (or fixed) media. Where appropriate, the memory 702 can be internal or external to the integrated gateway disaster recovery appliance. In particular embodiments, the memory 702 is non-volatile, solid-state memory.
[0154] The memory can include read-only memory (ROM), random-access memory (RAM), magnetic disk storage mediums, optical storage mediums, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software that, when executed (by one or more processors), is operable to access the data and / or instructions as described with reference to the methods according to the aspects of the present disclosure.
[0155] The processor 701 implements any of the above-described methods by reading and executing program instructions stored in the memory 702.
[0156] In one example, the electronic device also includes a communication interface 703 and a bus 710. The processor 701, the memory 702, and the communication interface 703 are connected through the bus 710 and accomplish communication therebetween.
[0157] The communication interface 703 is mainly used to realize the communication between various modules, devices, units, and / or equipment in the embodiments of the present application.
[0158] Bus 710 includes a hardware, software, or both that couples components of the online data traffic metering device to each other. As an example but not a limitation, bus can include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 710 can include one or more buses. Although this application describes and shows a particular bus, this application contemplates any suitable bus or interconnect.
[0159] In addition, the method in the above-mentioned embodiments can be implemented by a storage medium. The storage medium stores program instructions. The program instructions are executed by a processor to implement any of the above-mentioned methods.
[0160] The embodiments of the present application further provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to execute programs or instructions to implement various processes of the above-mentioned method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0161] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip.
[0162] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement various processes of the above-mentioned method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0163] It should be understood that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of well-known methods are omitted herein. In the above-mentioned embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps, after understanding the spirit of the present application.
[0164] The functional modules shown in the structural block diagram above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine-readable medium" can include any medium that can store or transfer information. Examples of the machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy diskette, a CD-ROM, an optical disk, a hard disk, a fiber optic medium, a radio frequency (RF) link, and the like. The code segments can be downloaded via a computer network, such as the Internet, an intranet, and the like.
[0165] It should also be noted that the example embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.
[0166] The above describes aspects of the present disclosure with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and program products according to embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams and combinations of blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus enable the implementation of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. The processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It should also be understood that each block in the block diagrams and / or flowcharts and combinations of blocks in the block diagrams and / or flowcharts can also be implemented by special-purpose hardware to perform the specified functions or acts, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0167] The above is only a specific embodiment of the present application, and those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, modules and units can refer to the corresponding processes in the foregoing method embodiments, which will not be described here. It should be understood that the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A remote power-on / off detection method, characterized in that, The method is applied to a boot device, the boot device is arranged on a to-be-controlled device through a PS / 2 interface of the to-be-controlled device, and the method comprises the following steps: Receiving a control instruction sent by a user terminal, the control instruction being a boot instruction or a shutdown instruction; Converting the control instruction into an interface instruction of a preset data type based on the instruction type of the control instruction, the to-be-controlled device being capable of identifying the preset data type, the interface instruction being used for controlling the to-be-controlled device to boot or shut down; Sending the interface instruction to the to-be-controlled device; Obtaining state information generated by the to-be-controlled device in executing the interface instruction; Analyzing the state information to obtain a control result of the to-be-controlled device, the control result being used for indicating whether the to-be-controlled device successfully boots or shuts down.
2. The method of claim 1, wherein, The control instruction is the boot instruction; The step of converting the control instruction into an interface instruction of a preset data type based on the instruction type of the control instruction comprises the following steps: Analyzing the boot instruction by a microprocessor of the boot device based on a preset analysis algorithm to obtain a first PS / 2 keyboard instruction code, the first PS / 2 keyboard instruction code being used for controlling a preset quick boot key of the to-be-controlled device; The step of sending the interface instruction to the to-be-controlled device comprises the following steps: Sending the first PS / 2 keyboard instruction code to the to-be-controlled device through a clock pin and a data pin of the PS / 2 interface.
3. The method of claim 2, wherein, The step of obtaining state information generated by the to-be-controlled device in executing the interface instruction comprises the following steps: Monitoring a first instruction sent by the to-be-controlled device and received by the clock pin and the data pin, the first instruction being an instruction generated by the to-be-controlled device based on the first PS / 2 keyboard instruction code, the first instruction being used for controlling the boot device; After monitoring the first instruction sent by the to-be-controlled device and received by the clock pin and the data pin, the method further comprises the following steps: In the case that the first instruction is monitored, sending reply information to the to-be-controlled device.
4. The method of claim 3, wherein, The step of analyzing the state information to obtain a control result of the to-be-controlled device comprises the following steps: In the case that the first instruction is a disable instruction, determining a disable identifier of the boot device as a first identifier; In the case that the first instruction is an enable instruction, determining the disable identifier as a second identifier; In the case that the first instruction is a reset instruction, if the disable identifier is the second identifier, obtaining a receiving frequency of the first instruction; In the case that the receiving frequency is greater than or equal to a first preset frequency, determining the control result as a first result, the first result being used for indicating that the to-be-controlled device successfully boots.
5. The method of claim 1, wherein, The control instruction is the shutdown instruction; The step of converting the control instruction into an interface instruction of a preset data type based on the instruction type of the control instruction comprises the following steps: Analyzing the shutdown instruction by a microprocessor of the boot device based on a preset analysis algorithm to obtain a second PS / 2 keyboard instruction code, the second PS / 2 keyboard instruction code being used for controlling a preset quick shutdown key of the to-be-controlled device; The sending of the interface instruction to the device to be controlled comprises: The second PS / 2 keyboard instruction code is sent to the device to be controlled through the clock pin and the data pin of the PS / 2 interface.
6. The method of claim 5, wherein, The obtaining of the state information generated by the device to be controlled in executing the interface instruction comprises: Every target time interval, the level state of the clock pin of the PS / 2 interface is obtained; The analysis of the state information to obtain the control result of the device to be controlled comprises: In the case that the level state is a first state, a test instruction is sent to the device to be controlled after a preset time, the test instruction is used to simulate a keyboard opening instruction, and the first state is used to indicate that the voltage of the clock pin is less than a first preset threshold; In the case that the level state is a second state, the continuous number of times that the level state is continuously in the second state is obtained, the second state is used to indicate that the voltage of the clock pin is greater than a second preset threshold; In the case that the continuous number of times is greater than a second preset number of times, the control result is determined as a second result, and the second result is used to indicate that the device to be controlled is successfully powered off.
7. The method according to any one of claims 1 to 6, characterized in that, After the state information generated by the device to be controlled in executing the interface instruction is obtained, the method further comprises: The state information is sent to the user terminal; The sending of the state information to the user terminal comprises: In the case that the timing time of a timer of the user terminal exceeds a target time threshold, the sending of the state information is stopped, and the timer starts timing in the case that the user terminal sends the control instruction.
8. A remote power-on detection apparatus, characterized by comprising: The device is applied to a starting device, the starting device is set on a device to be controlled through a PS / 2 interface of the device to be controlled, and the device comprises: A receiving module is configured to receive a control instruction sent by a user terminal, the control instruction being a starting instruction or a shutdown instruction; A conversion module is configured to convert the control instruction into an interface instruction of a preset data type based on the instruction type of the control instruction, the device to be controlled being capable of recognizing the preset data type, and the interface instruction being used to control the device to be controlled to start or shut down; A sending module is configured to send the interface instruction to the device to be controlled; An obtaining module is configured to obtain state information generated by the device to be controlled in executing the interface instruction; An analysis module is configured to analyze the state information to obtain a control result of the device to be controlled, the control result being used to indicate whether the device to be controlled is successfully started or shut down.
9. An electronic device, comprising: The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the remote starting and shutting down detection method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer program instructions are stored on the computer readable storage medium, and the computer program instructions are executed by the processor to implement the remote starting and shutting down detection method in any one of claims 1 to 7.
Citation Information
Patent Citations
Method, device and system for remote startup and shutdown
CN103412629A
Remote startup method, device and system
CN113326071A