CN112698870A - Startup and shutdown management method, computing device and storage medium - Google Patents

Startup and shutdown management method, computing device and storage medium Download PDF

Info

Publication number
CN112698870A
CN112698870A CN201911010002.8A CN201911010002A CN112698870A CN 112698870 A CN112698870 A CN 112698870A CN 201911010002 A CN201911010002 A CN 201911010002A CN 112698870 A CN112698870 A CN 112698870A
Authority
CN
China
Prior art keywords
instruction
power
shutdown
program
processor
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.)
Pending
Application number
CN201911010002.8A
Other languages
Chinese (zh)
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201911010002.8A priority Critical patent/CN112698870A/en
Publication of CN112698870A publication Critical patent/CN112698870A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4416Network booting; Remote initial program loading [RIPL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/442Shutdown

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The application provides a startup and shutdown management method, a computing device and a storage medium. The startup and shutdown management method comprises the following steps: receiving a first instruction by a main processor, wherein the first instruction is a shutdown instruction or a restart instruction; responding to the first instruction by the main processor, releasing the service resource and releasing the system resource, wherein the releasing the service resource comprises: closing the service program and releasing hardware resources occupied by the service program; when releasing service resources and releasing system resources are finished, the main processor sends a second instruction corresponding to the first instruction to the power management processor; analyzing the operation corresponding to the second instruction by the power management processor; when the power management processor determines that the second instruction corresponds to the shutdown operation, the power management processor performs the shutdown operation; and when the power management processor determines that the second instruction corresponds to the restarting operation, the power management processor performs the restarting operation.

Description

Startup and shutdown management method, computing device and storage medium
Technical Field
The present application relates to the field of software technologies, and in particular, to a power on/off management method, a computing device, and a storage medium.
Background
Some computing devices typically install an embedded operating system. The computing device is, for example, a Network Video Recorder (NVR), a centralized monitoring management platform (VMS), or a device with both NVR and VMS functions. The computing device may run an operating system through the host processor and run software loaded into the operating system. To enable fast power on and off operations, a computing device may deploy an out-of-band power management processor. When detecting the operation of the power key, the power management processor can directly power down or power up the mainboard where the main processor is located.
However, current direct power-up or power-down approaches are prone to data loss and operational anomalies in computing devices.
Disclosure of Invention
According to an aspect of the present application, there is provided a power on/off management method, including:
receiving a first instruction by a main processor, wherein the first instruction is a shutdown instruction or a restart instruction;
responding to the first instruction by the main processor, releasing service resources and releasing system resources, wherein the releasing service resources comprises: closing the service program and releasing hardware resources occupied by the service program;
when the releasing of the service resources and the releasing of the system resources are finished, the main processor sends a second instruction corresponding to the first instruction to a power management processor;
analyzing the operation corresponding to the second instruction by the power management processor;
when the power management processor determines that the second instruction corresponds to a shutdown operation, the power management processor performs the shutdown operation; and
and when the power management processor determines that the second instruction corresponds to a restarting operation, the power management processor performs the restarting operation.
In some embodiments, the power on/off management method further comprises: generating and sending the first instruction to the main processor by the power management processor in response to a power key operation.
In some embodiments, the power on/off management method further comprises: receiving, by the main processor, a network message regarding powering on and off, the network message including the first instruction; the receiving, by the main processor, a first instruction, comprising: obtaining, by the main processor, the first instruction from the network message.
In some embodiments, the releasing the service resource includes: closing at least one of the following business processes: the system comprises a video storage program, a network camera access program, a centralized monitoring management program and a parameter configuration program.
In some embodiments, the power on/off management method further comprises: periodically sending, by the main processor, a third instruction to the power management processor; and monitoring a third instruction sent by the main processor by the power management processor, restarting timing of a preset time length when receiving one third instruction every time, and executing the restarting operation when the timing time length exceeds the preset time length.
In some embodiments, the performing, by the power management processor, a shutdown operation comprises: the power management processor performs power-off operation on the main board where the main processor is located; performing, by the power management processor, a reboot operation comprising: and the power management processor sequentially performs power-off operation and power-on operation on the main board where the main processor is located.
In some embodiments, the power on/off management method further comprises: loading a kernel and a file system of an operating system and a kernel module for managing shutdown and restart by the main processor; wherein, the loading the kernel module for managing shutdown and restart comprises: detecting whether a shutdown program in a user mode and a restart program in the user mode which are suitable for being called by the kernel module are preset in the file system; when the file system is detected to be preset with the shutdown program and the restart program, the kernel module is enabled to subscribe a shutdown and restart notification chain; and when detecting that the shutdown program and the restart program are not preset in the file system, cancelling the loading of the kernel module.
In some embodiments, said releasing said traffic resources and releasing traffic resources by the main processor in response to said first instruction comprises: the main processor responds to the first instruction to release the service resource by managing the service process of the service program; after releasing the service resources, the service process triggers the shutdown restart notification chain; calling the kernel module by the shutdown restart notification chain; releasing, by the kernel module, the system resource.
In some embodiments, said sending, by the main processor, a second instruction corresponding to the first instruction to the power management processor when the releasing of the service resource and the releasing of the system resource are completed includes: when the first instruction is a shutdown instruction, the kernel module calls a shutdown program in a user mode, and the shutdown program is used for sending a second instruction corresponding to shutdown operation to the power management processor; and when the first instruction is a restart instruction, calling the restart program in a user mode by the kernel module, wherein the restart program is used for sending a second instruction corresponding to restart operation to the power management processor.
According to one aspect of the present application, there is provided a computing device comprising a main processor and a power management processor;
wherein the main processor is configured to: receiving a first instruction, wherein the first instruction is a shutdown instruction or a restart instruction; responding to the first instruction, releasing service resources and releasing system resources, wherein the releasing service resources comprises: closing the service program and releasing hardware resources occupied by the service program; when the releasing of the service resources and the releasing of the system resources are finished, sending a second instruction corresponding to the first instruction to the power management processor;
the power management processor is configured to: when the second instruction is determined to correspond to the shutdown operation, performing the shutdown operation; and when the second instruction is determined to correspond to the restarting operation, carrying out the restarting operation.
In some embodiments, the power management processor is further configured to: and responding to the operation of a power key, and generating and sending the first instruction to the main processor.
In some embodiments, the main processor is further configured to: receiving a network message about power on and off, wherein the network message comprises the first instruction; and acquiring the first instruction from the network message.
In some embodiments, the main processor releases traffic resources according to the following: closing at least one of the following business processes: the system comprises a video storage program, a network camera access program, a centralized monitoring management program and a parameter configuration program.
In some embodiments, the main processor is further configured to: periodically sending a third instruction to the power management processor; the power management processor is further configured to: and monitoring a third instruction sent by the main processor, restarting timing of a preset time length when receiving one third instruction every time, and executing the restarting operation when the timing time length exceeds the preset time length.
According to an aspect of the present application, there is provided a storage medium storing a program, the program comprising instructions that, when executed by a computing device, cause the computing device to perform a power on/off management method according to the present application.
In summary, according to the power on/off management scheme of the present application, an out-of-band power management processor is used to manage power on/off, so that an operation procedure (i.e., a power off operation or a power on/off operation) of the power management processor can be associated with a power off procedure (i.e., system resources and service resources are released) of a main processor, and thus, the out-of-band power management processor can be used to manage power on/off and ensure data security of a computing device (i.e., avoid data loss of a service program).
Drawings
FIG. 1 illustrates a flow diagram of a method 100 of power on and power off management according to some embodiments of the present application;
FIG. 2 illustrates a flow diagram of a method for power-up initialization of a computing device according to some embodiments of the present application;
FIG. 3 illustrates a flow diagram of a method 300 performed by a power management processor according to some embodiments of the present application;
FIG. 4 illustrates a flow diagram of a method 400 performed by a main processor according to some embodiments of the present application;
FIG. 5 illustrates a flow diagram of a method 500 of power on and power off management according to some embodiments of the present application;
FIG. 6 illustrates a schematic diagram of a computing device 600 according to some embodiments of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below by referring to the accompanying drawings and examples.
In some application scenarios, the power on and power off operations of a computing device may include power on operations, power off operations, and reboot operations. The restart operation may be considered a shutdown operation and a power-on operation after completion of shutdown. The computing device may be, for example, a Network Video Recorder (NVR), a centralized monitoring Management platform (View Management System, abbreviated as VMS), a platform storage all-in-one machine having NVR and VMS functions, a camera, and the like, which is not limited in this application. The computing device of the present application may include a main processor and an out-of-band management processor. The host processor resides in a motherboard of the computing device. The power management processor is located off the motherboard, such as in the front panel of the computing device. Here, the main processor is, for example, a Central Processing Unit (CPU), and may execute an operating system (e.g., embedded Linux, etc.) of the computing device and a service program loaded into the operating system. Here, the computing device may install various suitable business programs depending on business requirements. The service program may include, for example, a video storage program, a network camera access program, a centralized monitoring management program, a parameter configuration program, and the like. The centralized monitoring manager may, for example, centrally manage multiple cameras accessing the computing device. The parameter configuration program may configure parameters of a plurality of cameras, for example, but is not limited thereto. The power management processor is a control device such as a Microprocessor (MCU) and an FPGA. The power management processor may manage power up and power down of the motherboard.
The application provides a startup and shutdown management method which can manage shutdown and restart of computing equipment through an out-of-band power management processor, and avoid data loss and abnormal operation of the computing equipment, so that operation safety of the computing equipment is improved. The power on/off management scheme is described below with reference to fig. 1.
Fig. 1 illustrates a flow diagram of a method 100 of power on and power off management according to some embodiments of the present application. The power on/off management method 100 may be performed, for example, in a computing device.
As shown in fig. 1, in step S101, a first instruction is received by the main processor. The first instruction is a shutdown instruction or a restart instruction.
In some embodiments, the power management processor generates and sends a first instruction to the main processor in response to a power key operation. The main processor may receive a first instruction from the power management processor. For example, the power management processor may detect the length of time that the power key is pressed. Upon the detection time exceeding a threshold (e.g., 3 seconds), the power management processor may generate a first instruction indicating shutdown. Upon the detection duration being below a threshold (e.g., 3 seconds), the power management processor may generate a first instruction indicating a reboot.
In some embodiments, the main processor may receive a network message regarding power on and off. The network message may include a first instruction. In other words, the main processor may receive remote power on and off instructions over the network. The host processor may retrieve the first instruction from the network message.
In step S102, the main processor releases the service resource and releases the system resource in response to the first instruction. The releasing of the service resource may include, for example, closing the service program and releasing a hardware resource occupied by the service program. For example, the main processor may close the service programs, such as the video storage program, the network camera access program, the centralized monitoring management program, and the parameter configuration program, by managing the service processes of the service programs. In addition, the main processor can release the hardware resources (such as memory and the like) occupied by the service program. Releasing the system resource may be, for example, writing a file cache in the memory to the hard disk, but is not limited thereto.
Upon completion of releasing the traffic resources and releasing the system resources, the method 100 may perform step S103. In step S103, a second instruction corresponding to the first instruction may be transmitted to the power management processor by the main processor. For example, the first instruction is a shutdown instruction. The second command is a command to power down the motherboard after delaying the first duration (e.g., 5 seconds). For another example, the first instruction is a restart instruction. The second instruction is an instruction to power down the motherboard after delaying the first duration, and to power up the motherboard again after powering down the motherboard for a second duration (e.g., 3 seconds).
In step S104, the power management processor parses the operation corresponding to the second instruction. For example, when the second instruction is a command identifier corresponding to shutdown, the power management processor determines that the second instruction corresponds to shutdown operation. The shutdown operation is to perform a power-down operation on the motherboard where the main processor is located, for example, to power down the motherboard after delaying a first duration (i.e., to turn off the power supply of the motherboard). And when the second instruction is a command identifier corresponding to the restart, the power management processor determines that the second instruction corresponds to the restart operation. The restart operation is to sequentially perform power-down operation and power-up operation on the motherboard where the main processor is located, for example, power-down is performed on the motherboard after a first time delay, and power-up is performed on the motherboard again after a second time (for example, 3 seconds) of power failure.
When the power management processor determines that the second instruction corresponds to a shutdown operation, the power management processor may execute step S105 to perform the shutdown operation.
When the power management processor determines that the second instruction corresponds to the restart operation, the power management processor may execute step S106 to perform the restart operation.
In summary, according to the power on/off management method 100 of the present application, an out-of-band power management processor is used to manage power on/off, so as to associate an operation procedure (i.e. a power off operation or a power on/off operation) of the power management processor with a power off procedure (i.e. release of system resources and service resources) of a main processor, thereby not only using the out-of-band power management processor to manage power on/off, but also ensuring data security of a computing device (i.e. avoiding data loss of a service program).
It should be noted that, the power on/off management method 100 of the present application may improve flexibility of power on timing control of the external device of the operating system by using an out-of-band power management processor. For example, the external device includes a plurality of hard disks. Assume that the computing device does not employ a power management processor. In a power-on start stage (i.e., a stage in which the main processor loads the operating system and starts the plurality of external devices after the main board is powered on), because power consumption for simultaneously starting the plurality of hard disks is high, the computing device needs to perform time-sharing start control on the hard disks through the main processor. In other words, the main processor needs to boot the hard disk several times. Because the main processor in the power-on starting stage is a single-core single-thread, the main processor needs to spend more time to complete the time-sharing starting operation. However, after the power management processor is adopted in the embodiments of the present application, the power management processor may replace the main processor to execute a plurality of operations for starting up the hard disk, so as to improve the efficiency of power-on start-up of the main processor. In short, the power management processor may share the tasks of the main processor during the power-on startup phase, thereby improving the startup efficiency of the computing device.
In some embodiments, the method 100 may further include step S107. In step S107, a third instruction is periodically transmitted to the power management processor by the main processor. Here, the third instruction may be regarded as a heartbeat message. The transmission cycle in which the main processor transmits the third instruction is, for example, 3 minutes.
In step S108, the third instruction transmitted by the main processor is monitored by the power management processor. The power management processor may restart timing the predetermined length of time each time a third instruction is received. The predetermined period of time is, for example, 10 minutes. Here, the predetermined time period is longer than a period in which the main processor transmits the third instruction. The power management processor may perform a restart operation when the timed period exceeds a predetermined period. For example, the power management processor has a timer started. The power management processor may clear the timer and restart timing each time a third instruction is received.
In summary, when the computing device is operating normally (i.e. no abnormal condition such as a crash occurs), the main processor may normally send the third instruction according to the sending cycle. The power management processor does not affect the normal operation of the main processor (i.e., does not perform shutdown and restart operations) by restarting the timing of the predetermined length of time. And when the computing equipment is in abnormal conditions such as halt and the like, the main processor cannot send the third instruction according to the sending period. In brief, according to the power on/off management method 100 of the present application, through steps S107 and S108, the problem of the computer device crash can be automatically solved.
As described above, the power on/off management scheme of the present application may associate an operation flow (i.e., a power off operation or a power on/off operation) of the power management processor with a power off flow (i.e., release of system resources and service resources) of the main processor. In order to describe the power on/off management scheme of the present application in more detail, the program executed by the main processor is divided into modules, and the flow of power on/off is described from the perspective of the modules.
The operating system running in the computing device is, for example, an operating system such as Linux. The embodiment of the application is additionally provided with a kernel module for managing shutdown and restart on the basis of the code of a common operating system. Here, the kernel module that manages shutdown and restart is a software module that is called by the kernel of the operating system. Here, the kernel module that manages shutdown and restart may be considered as a driver module that manages shutdown and restart in the operating system. The operations performed by the kernel module are described in detail below.
FIG. 2 illustrates a flow diagram of a method for power-up initialization of a computing device according to some embodiments of the present application.
As shown in fig. 2, upon power-up of the computing device, the main processor may perform steps S201 and S202. In step S201, the kernel and the file system of the operating system are loaded by the main processor. In step S202, a kernel module for managing shutdown restart is loaded. It should be noted that the computing device may also load and manage other kernel modules besides the kernel module that is shutdown and restarted, which is not described herein again.
Step S202 may include steps S2021-S2023. In step S2021, it is detected whether the file system is preset with a shutdown program in the user mode and a restart program in the user mode, which are suitable for being called by the kernel module. Here, S2021 is a code checking section. Both the shutdown procedure and the restart procedure are software modules. The shutdown program is used for sending a second instruction corresponding to shutdown operation to the power management processor. The restart program is used for sending a second instruction corresponding to the restart operation to the power management processor.
When it is detected in step S2021 that the shutdown program and the reboot program are preset in the file system, the main processor may execute step S2022, so that the kernel module subscribes to a shutdown reboot notification chain. Here, the notification chain is a communicator between kernel subsystems of an operating system, and when a state of one subsystem changes, the notification chain mechanism informs other subsystems using (subscribing) its services so that the other subsystems take corresponding measures. When the shutdown and restart notification chain is triggered, a kernel module for managing shutdown and restart can be called.
In addition, when it is detected in step S2021 that the shutdown program and the restart program in the user mode are not preset in the file system, the main processor may execute step S2023 to cancel loading of the kernel module for managing shutdown and restart, that is, cancel initialization of the kernel module for managing shutdown and restart.
In some embodiments, the shutdown procedure is, for example, instructing the power management processor to power down the motherboard for a delay of 3 seconds. The restart procedure is, for example, instructing the power management processor to delay powering down the motherboard for 5 seconds, and powering up the motherboard again after powering down for 5 seconds. In summary, in the embodiments of the present application, the shutdown program and the restart program are deployed as the user-mode programs, so that a developer can conveniently adjust the operation logic of the shutdown program and the restart program (for example, modify the time duration of delaying power-off and modify the time duration of delaying power-on after power-off), without modifying the kernel, thereby improving the operation stability of the operating system in the computing device.
In addition, fig. 2 also shows the execution flow of the shutdown restart notification chain. As shown in fig. 2, after the shutdown restart notification chain is triggered, a kernel module for managing shutdown restart may be called. The kernel module may obtain a parameter corresponding to the first instruction. Here, the type of the parameter is a restart type or a shutdown type. The kernel module may perform step S203 to determine a type of a parameter corresponding to the first instruction. When the type of the parameter is determined to be the restart type in step S203, the kernel module may execute step S204 to call a restart program. When the type of the parameter is determined to be the shutdown type in step S203, the kernel module may execute step S205 to call a shutdown program.
FIG. 3 illustrates a flow diagram of a method 300 performed by a power management processor according to some embodiments of the present application.
As shown in fig. 3, in step S301, whether or not there is a key operation is detected. When the key operation is detected, the power management processor may execute step S302, parse the key operation, generate and send a first instruction to the main processor. After sending the first instruction, the power management processor may perform step S303, monitoring for an instruction from the main processor. Here, the power management processor and the main processor may communicate with each other through a serial port or the like. Step S303 mainly monitors the second instruction or the third instruction from the main processor. Upon receiving the instruction from the main processor, the power management processor may perform step S304, parsing the instruction from the main processor. When the instruction is the second instruction corresponding to the shutdown operation, the power management processor may execute step S305 to perform the shutdown operation. When the instruction is a second instruction corresponding to the restart operation, the power management processor may execute step S306 to perform the restart operation. When the instruction is a third instruction representing a heartbeat message, the power management processor may execute step S307 to restart the timing of the predetermined period of time. In addition, the power management processor may further execute step S308 to determine whether the timed period exceeds a predetermined period. The power management processor may perform step S306 when it is determined in step S308 that the predetermined time duration is exceeded. It is determined in step S308 that the counted time period does not exceed the predetermined time period, and the method 300 jumps to step S301 to continuously detect whether there is a key operation.
FIG. 4 illustrates a flow diagram of a method 400 performed by a host processor according to some embodiments of the present application.
As shown in fig. 4, in step S401, a third instruction is periodically transmitted to the power management processor. In step S402, it is detected whether a first instruction is received. Here, the first instruction is from, for example, a power management processor or a network message.
When the first instruction is detected, the main processor may execute step S403 to release the service resource by managing the service process of the service program. After completing releasing the service resource, the main processor may execute step S404, and invoke a system call interface by the service process according to the type of the first instruction. The system calling interfaces referred to herein are a shutdown calling interface and a restart calling interface. For example, when the first instruction is a shutdown instruction, the business process may call a shutdown call interface. And when the first instruction is a restart instruction, calling a restart calling interface by the service process. Here, the shutdown restart notification chain may be triggered by calling a shutdown call interface or a restart call interface. In this way, the shutdown restart notification chain may invoke a kernel module that manages the shutdown restart. The kernel module may perform steps S203-S205 above.
FIG. 5 illustrates a schematic diagram of a power on/off management flow according to some embodiments of the present application.
As shown in fig. 5, the program executed by the main processor may be divided into a plurality of modules. The modules executed by the main processor may include: the system comprises a service process for managing a service program, a kernel module for managing on-off, a shutdown program and a restart program.
In step S501, a first instruction is generated by the power management processor in response to a key operation. In step S502, the power management processor sends a first instruction to the business process. In step S503, the service process releases the service resource in response to the first instruction. After the operation of releasing the service resource is completed, the service process may execute step S504, and the shutdown restart notification chain is triggered to invoke the shutdown restart kernel module. In step S505, the kernel module managing shutdown and restart releases system resources. In addition, the kernel module may obtain a parameter corresponding to the first instruction. Here, the type of the parameter is a restart type or a shutdown type. The parameters are passed to the kernel when the business process makes a system interface call. After releasing the system resources is completed, the kernel module managing shutdown and restart may perform step S506 or S507 according to the parameter. When the type of the parameter is determined to be the restart type, the kernel module may execute step S506 to call the restart program. When the type of the parameter is determined to be the shutdown type, the kernel module may execute step S507 to call a shutdown program. The restart program may perform step S508, and send a second instruction corresponding to the restart operation to the power management processor. The shutdown program may execute step S509 to send a second instruction corresponding to the shutdown operation to the power management processor. The power management processor may perform step S510, parse the second instruction, and perform shutdown or restart operations.
FIG. 6 illustrates a schematic diagram of a computing device 600 according to some embodiments of the present application. Computing device 600 may include a main processor 601, a power management processor 602, a communication unit 603, a memory 604, a communication bus 605. Where main processor 601 is on the motherboard of computing device 600. The power management processor 602 is an out-of-band microprocessor that can control the power-up and power-down of the motherboard. A communication bus 605 may interconnect the component elements within the computing device 600. The communication bus 605 may comprise one or more hardware communication lines, including, for example, a serial bus or the like.
The main processor 601 may receive and transmit data through the communication unit 603 to implement network communication and/or local communication.
Memory 604 may be a high-speed random access memory such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices (i.e., hard disks), optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The memory 604 may store a set of instructions that are executed by the processor 601. For example, the memory 604 may store an operating system 606, one or more business programs 607, and the like.
Operating system 606 includes programs for handling various basic system services and for performing hardware dependent tasks. Such as, but not limited to, a Linux system.
The service program 607 may include, for example, a video storage program, a network camera access program, a centralized monitoring management program, a parameter configuration program, and the like.
In some embodiments, the host processor 601 may perform the method 400 shown in FIG. 4. The power management processor 602 may perform the method 300 shown in fig. 3, but is not so limited.
In some embodiments, the host processor is to: receiving a first instruction, wherein the first instruction is a shutdown instruction or a restart instruction; responding to the first instruction, releasing service resources and releasing system resources, wherein the releasing service resources comprises: closing the service program and releasing hardware resources occupied by the service program, wherein the releasing of the system resources comprises writing a file cache in a memory into a hard disk; when the releasing of the service resources and the releasing of the system resources are finished, sending a second instruction corresponding to the first instruction to the power management processor; the power management processor is configured to: when the second instruction is determined to correspond to the shutdown operation, performing the shutdown operation; and when the second instruction is determined to correspond to the restarting operation, carrying out the restarting operation.
In some embodiments, the power management processor is further configured to: and responding to the operation of a power key, and generating and sending the first instruction to the main processor.
In some embodiments, the main processor is further configured to: receiving a network message about power on and off, wherein the network message comprises the first instruction; and acquiring the first instruction from the network message.
In some embodiments, the main processor releases traffic resources according to the following: closing at least one of the following business processes: the system comprises a video storage program, a network camera access program, a centralized monitoring management program and a parameter configuration program.
In some embodiments, the main processor is further configured to: periodically sending a third instruction to the power management processor; the power management processor is further configured to: and monitoring a third instruction sent by the main processor, restarting timing of a preset time length when receiving one third instruction every time, and executing the restarting operation when the timing time length exceeds the preset time length.
In summary, according to the computing device of the present application, the power management processor with the out-of-band is used to manage power on and power off, so that an operation procedure (i.e., a power off operation or a power on restart operation) of the power management processor can be associated with a power off procedure (i.e., release of system resources and service resources) of the main processor, and thus, the power management processor with the out-of-band can be used to manage power on and power off, and data security of the computing device can be ensured (i.e., data loss of a service program is avoided).
In addition, each embodiment of the present application can be realized by a data processing program executable by a computing device. It is clear that the data processing program constitutes the invention. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present invention. The storage medium may use any type of recording means, such as a paper storage medium (e.g., paper tape, etc.), a magnetic storage medium (e.g., a flexible disk, a hard disk, a flash memory, etc.), an optical storage medium (e.g., a CD-ROM, etc.), a magneto-optical storage medium (e.g., an MO, etc.), and the like. The present application thus also discloses a non-volatile storage medium in which a program is stored. The program comprises instructions which, when executed by a processor, cause a computing device to perform the method 100, 200, 300, 400 or 500 according to the present application.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (15)

1. A startup and shutdown management method is characterized by comprising the following steps:
receiving a first instruction by a main processor, wherein the first instruction is a shutdown instruction or a restart instruction;
responding to the first instruction by the main processor, releasing service resources and releasing system resources, wherein the releasing service resources comprises: closing the service program and releasing hardware resources occupied by the service program;
when the releasing of the service resources and the releasing of the system resources are finished, the main processor sends a second instruction corresponding to the first instruction to a power management processor;
analyzing the operation corresponding to the second instruction by the power management processor;
when the power management processor determines that the second instruction corresponds to a shutdown operation, the power management processor performs the shutdown operation; and
and when the power management processor determines that the second instruction corresponds to a restarting operation, the power management processor performs the restarting operation.
2. The power on/off management method according to claim 1, further comprising:
generating and sending the first instruction to the main processor by the power management processor in response to a power key operation.
3. The power on/off management method according to claim 1, further comprising: receiving, by the main processor, a network message regarding powering on and off, the network message including the first instruction;
the receiving, by the main processor, a first instruction, comprising: obtaining, by the main processor, the first instruction from the network message.
4. The power on/off management method according to claim 1, wherein the releasing the service resource comprises:
closing at least one of the following business processes: the system comprises a video storage program, a network camera access program, a centralized monitoring management program and a parameter configuration program.
5. The power on/off management method according to claim 1, further comprising:
periodically sending, by the main processor, a third instruction to the power management processor;
and monitoring a third instruction sent by the main processor by the power management processor, restarting timing of a preset time length when receiving one third instruction every time, and executing the restarting operation when the timing time length exceeds the preset time length.
6. The power on/off management method as claimed in claim 1,
the performing, by the power management processor, a shutdown operation includes: the power management processor performs power-off operation on the main board where the main processor is located;
performing, by the power management processor, a reboot operation comprising: and the power management processor sequentially performs power-off operation and power-on operation on the main board where the main processor is located.
7. The power on/off management method according to claim 1, further comprising: loading a kernel and a file system of an operating system and a kernel module for managing shutdown and restart by the main processor;
wherein, the loading the kernel module for managing shutdown and restart comprises:
detecting whether a shutdown program in a user mode and a restart program in the user mode which are suitable for being called by the kernel module are preset in the file system;
when the file system is detected to be preset with the shutdown program and the restart program, the kernel module is enabled to subscribe a shutdown and restart notification chain;
and when detecting that the shutdown program and the restart program are not preset in the file system, cancelling the loading of the kernel module.
8. The power on/off management method of claim 7, wherein said releasing the service resource and releasing the service resource by the main processor in response to the first instruction comprises:
the main processor responds to the first instruction to release the service resource by managing the service process of the service program;
after releasing the service resources, the service process triggers the shutdown restart notification chain;
calling the kernel module by the shutdown restart notification chain;
releasing, by the kernel module, the system resource.
9. The power on/off management method according to claim 8, wherein the sending, by the main processor, a second instruction corresponding to the first instruction to a power management processor when the releasing of the service resource and the releasing of the system resource are completed comprises:
when the first instruction is a shutdown instruction, the kernel module calls a shutdown program in a user mode, and the shutdown program is used for sending a second instruction corresponding to shutdown operation to the power management processor;
and when the first instruction is a restart instruction, calling the restart program in a user mode by the kernel module, wherein the restart program is used for sending a second instruction corresponding to restart operation to the power management processor.
10. A computing device comprising a main processor and a power management processor;
wherein the main processor is configured to:
receiving a first instruction, wherein the first instruction is a shutdown instruction or a restart instruction;
responding to the first instruction, releasing service resources and releasing system resources, wherein the releasing service resources comprises: closing the service program and releasing hardware resources occupied by the service program;
when the releasing of the service resources and the releasing of the system resources are finished, sending a second instruction corresponding to the first instruction to the power management processor;
the power management processor is configured to:
when the second instruction is determined to correspond to the shutdown operation, performing the shutdown operation; and
and when the second instruction is determined to correspond to the restarting operation, carrying out the restarting operation.
11. The computing device of claim 10, wherein the power management processor is further to:
and responding to the operation of a power key, and generating and sending the first instruction to the main processor.
12. The computing device of claim 10, wherein the main processor is further to:
receiving a network message about power on and off, wherein the network message comprises the first instruction;
and acquiring the first instruction from the network message.
13. The computing device of claim 10, wherein the main processor releases traffic resources according to:
closing at least one of the following business processes: the system comprises a video storage program, a network camera access program, a centralized monitoring management program and a parameter configuration program.
14. The computing device of claim 10, wherein the main processor is further to: periodically sending a third instruction to the power management processor;
the power management processor is further configured to: and monitoring a third instruction sent by the main processor, restarting timing of a preset time length when receiving one third instruction every time, and executing the restarting operation when the timing time length exceeds the preset time length.
15. A storage medium storing a program comprising instructions that, when executed by a computing device, cause the computing device to perform the power on/off management method of any of claims 1-9.
CN201911010002.8A 2019-10-23 2019-10-23 Startup and shutdown management method, computing device and storage medium Pending CN112698870A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911010002.8A CN112698870A (en) 2019-10-23 2019-10-23 Startup and shutdown management method, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911010002.8A CN112698870A (en) 2019-10-23 2019-10-23 Startup and shutdown management method, computing device and storage medium

Publications (1)

Publication Number Publication Date
CN112698870A true CN112698870A (en) 2021-04-23

Family

ID=75504935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911010002.8A Pending CN112698870A (en) 2019-10-23 2019-10-23 Startup and shutdown management method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN112698870A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760276A (en) * 2016-02-19 2016-07-13 烽火通信科技股份有限公司 Method for improving reboot command restart reliability and increasing reset logs
CN106293979A (en) * 2015-06-25 2017-01-04 伊姆西公司 Detection procedure is without the method and apparatus of response
CN109669728A (en) * 2018-12-14 2019-04-23 深圳市中科亿信技术有限公司 The software closedown method and device of vxworks operating system
CN110308940A (en) * 2019-07-04 2019-10-08 北京计算机技术及应用研究所 A kind of method that simulating keyboard soft-off key realizes long-range soft-off

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293979A (en) * 2015-06-25 2017-01-04 伊姆西公司 Detection procedure is without the method and apparatus of response
CN105760276A (en) * 2016-02-19 2016-07-13 烽火通信科技股份有限公司 Method for improving reboot command restart reliability and increasing reset logs
CN109669728A (en) * 2018-12-14 2019-04-23 深圳市中科亿信技术有限公司 The software closedown method and device of vxworks operating system
CN110308940A (en) * 2019-07-04 2019-10-08 北京计算机技术及应用研究所 A kind of method that simulating keyboard soft-off key realizes long-range soft-off

Similar Documents

Publication Publication Date Title
CN109542744B (en) Method, device, storage medium and terminal for detecting abnormal starting problem of terminal
US10585755B2 (en) Electronic apparatus and method for restarting a central processing unit (CPU) in response to detecting an abnormality
CN102866903B (en) Background work and foreground work are separated to coupling
CN109522147A (en) A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN102880505B (en) For the event aggregation that background work performs
CN101814035B (en) Method and system to enable fast platform restart
KR20070108060A (en) System executing a fast boot wake-up
US9639486B2 (en) Method of controlling virtualization software on a multicore processor
US10983825B2 (en) Processing for multiple containers are deployed on the physical machine
CN103605536A (en) Starting method and starting device of embedded operating system and baseboard management controller
CN109976886B (en) Kernel remote switching method and device
CN115237644A (en) System failure processing method, central processing unit and vehicle
CN111124761B (en) Equipment restarting method, device, equipment and medium
US10649832B2 (en) Technologies for headless server manageability and autonomous logging
JP2017078998A (en) Information processor, log management method, and computer program
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
WO2023125482A1 (en) Cluster management method and device, and computing system
CN112698870A (en) Startup and shutdown management method, computing device and storage medium
CN111078452A (en) BMC firmware image recovery method and device
JP2008003735A (en) Automatic stop system of information processing system connected to uninterruptible power supply
JP2001101034A (en) Fault restoring method under inter-different kind of os control
TWI461905B (en) Computing device capable of remote crash recovery, method for remote crash recovery of computing device, and computer readable medium
CN104142832A (en) Computer and rebooting method thereof
JP7472687B2 (en) Information processing device, information processing program, and information processing method
JP7276566B2 (en) Information processing system, information processing device, management program, and management method

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210423