CN110928591B - Method, system, equipment and storage medium for analyzing on-off state - Google Patents

Method, system, equipment and storage medium for analyzing on-off state Download PDF

Info

Publication number
CN110928591B
CN110928591B CN201911159410.XA CN201911159410A CN110928591B CN 110928591 B CN110928591 B CN 110928591B CN 201911159410 A CN201911159410 A CN 201911159410A CN 110928591 B CN110928591 B CN 110928591B
Authority
CN
China
Prior art keywords
switching
information
storage structure
recorded
structure partition
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.)
Active
Application number
CN201911159410.XA
Other languages
Chinese (zh)
Other versions
CN110928591A (en
Inventor
史继前
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongguan ELF Education Software Co Ltd
Original Assignee
Dongguan ELF Education Software 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 Dongguan ELF Education Software Co Ltd filed Critical Dongguan ELF Education Software Co Ltd
Priority to CN201911159410.XA priority Critical patent/CN110928591B/en
Publication of CN110928591A publication Critical patent/CN110928591A/en
Application granted granted Critical
Publication of CN110928591B publication Critical patent/CN110928591B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/442Shutdown
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention provides a method, a system, equipment and a storage medium for analyzing a startup and shutdown state, which comprises the following steps: dividing a special storage structure partition, and presetting switching-on and switching-off information to be recorded and switching-on and switching-off state times to be recorded; after the U-Boot is started, the startup and shutdown information of corresponding times is recorded; and writing the recorded switching on/off information of corresponding times into the special storage structure partition according to the preset switching on/off state times. The invention can set and store a certain amount of switching-on and switching-off information according to the use requirement of engineers so as to ensure that the latest switching-on and switching-off information stored in a special storage structure partition is the latest switching-on and switching-off information for a plurality of times, so that the problems that the engineers know the latest switching-on and switching-off information for a plurality of times, record the current switching-on and switching-off information for the first times, record the abnormal switching-on and switching-off for the first times, and cannot know the cause of the abnormal switching-on and switching-off of equipment are avoided.

Description

Method, system, equipment and storage medium for analyzing on-off state
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a system, an apparatus, and a storage medium for analyzing a startup and shutdown state.
Background
At present, each platform generally records a basic on/off reason in a switching-on/off process, and after the next switching-on, the system reads related register information in a switching-on stage and outputs the information to a system log for display so as to be convenient for engineers to review.
However, the register can only record a single power-on/off state, and for the conditions of multiple times, accidents, dead halt, repeated restarting and the like, the system cannot keep the normal reasons, and even if the system is started normally, the log cannot record and cannot analyze the relevant state reasons normally because the space for storing the log is insufficient. Such situations often occur during normal development and with equipment used by market users, which can be troublesome for engineers to analyze low-probability anomaly problems.
Disclosure of Invention
The invention aims to provide a method, a system, equipment and a storage medium for analyzing a startup and shutdown state, which can set and store a certain amount of startup and shutdown information according to the use requirement of an engineer so as to ensure that the latest startup and shutdown information stored in a special storage structure partition is stored for a plurality of times, and enable the engineer to know the latest startup and shutdown information for a plurality of times.
The technical scheme provided by the invention is as follows:
the invention provides a method for analyzing a startup and shutdown state, which comprises the following steps:
s100, dividing a special storage structure partition, and presetting switching on/off information to be recorded and the switching on/off state times to be recorded.
S200, after the U-Boot is started, the startup and shutdown information of corresponding times is recorded.
And S300, writing the recorded switching-on/off information of corresponding times into the special storage structure partition according to the preset switching-on/off state times.
Further, after the step S300 of writing the recorded switching on/off information of the corresponding number of times into the dedicated storage structure partition according to the preset switching on/off state number, the method includes the steps of:
and S400, displaying the switching on/off information written into the special storage structure partition when the power-on is normally started.
Further, after the step S300 of writing the recorded switching on/off information of the corresponding number of times into the dedicated storage structure partition according to the preset switching on/off state number, the method further includes the steps of:
and S500, when the power-on cannot be started normally, reading back the power-on and power-off information written into the special storage structure partition for a plurality of times, and analyzing and checking the state.
Further, in the step S300, writing the recorded switching on/off information of the corresponding times into the dedicated storage structure partition according to the preset switching on/off state times specifically includes the steps of:
s310, judging whether the number of times of the on-off states stored in the special storage structure partition is smaller than the preset number of times of the on-off states.
And S320, when the switching-on/off times stored in the special storage structure partition are smaller than the preset switching-on/off state times, writing the recorded switching-on/off information of the corresponding times into the special storage structure partition.
Further, after the step S310 of determining whether the number of times of the on/off states stored in the dedicated storage structure partition is less than the preset number of times of the on/off states, the method further includes the steps of:
s330, when the switching-on/off information stored in the special storage structure partition is equal to the preset switching-on/off state times, the earliest switching-on/off information stored in the special storage structure partition is deleted.
And S340, after the earliest switching on/off information stored in the special storage structure partition is deleted, writing the recorded switching on/off information with corresponding times into the special storage structure partition.
Further, the on-off information includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
The invention also provides a system for analyzing the on-off state, which comprises:
the dividing module is used for dividing the special storage structure partition;
the preset module is connected with the dividing module and used for presetting the switching-on information to be recorded and the switching-on state times to be recorded;
the recording module is connected with the preset module and is used for recording startup and shutdown information of corresponding times after the U-Boot is started;
the writing module is connected with the recording module and used for writing the recorded switching on/off information of corresponding times into the special storage structure partition according to the preset switching on/off state times.
Further, the display module is connected with the writing module and displays the switching-on and switching-off information written into the special storage structure partition when the power is normally started;
the read-back module is connected with the writing module, and is used for reading back the switching-on and switching-off information written into the special storage structure partition for a plurality of times when the normal starting-up is impossible, and analyzing and checking the state;
further, the analysis module is connected with the recording module and is used for judging whether the number of times of the on-off states stored in the special storage structure partition is smaller than the preset number of times of the on-off states;
and the deleting module is connected with the analysis module and is used for deleting the earliest switching on/off information stored in the special storage structure partition when the switching on/off information stored in the special storage structure partition is equal to the preset switching on/off state times.
And the writing module is further connected with the analysis module and is further used for writing the recorded switching on/off information of corresponding times into the special storage structure partition when the switching on/off times stored in the special storage structure partition are smaller than the preset switching on/off state times.
And the writing module is further connected with the deleting module and is also used for writing the recorded switching on/off information of corresponding times into the special storage structure partition after the earliest switching on/off information stored in the special storage structure partition is deleted.
The invention provides a storage medium, wherein a computer program is stored on the storage medium, and the computer program is executed by a processor to realize the method for analyzing the on-off state.
The invention provides equipment for analyzing the on-off state, which comprises a memory and a processor, wherein the memory stores a computer program running on the processor.
According to the method, the system, the equipment and the storage medium for analyzing the startup and shutdown state, a certain amount of startup and shutdown information can be set and stored according to the use requirement of an engineer, so that the latest startup and shutdown information stored in a special storage structure partition is ensured, the engineer knows the latest startup and shutdown information for several times, and the problems that only the current startup and shutdown information is recorded, but the former times are not recorded for abnormal startup and shutdown of the equipment and the reason for the abnormal startup and shutdown of the equipment cannot be known are avoided.
Drawings
The above features, technical features, advantages and implementation manners of a method, system, device and storage medium for analyzing a power on/off state will be further described with reference to the accompanying drawings in a clear and understandable manner.
FIG. 1 is a flow chart of one embodiment of a method of analyzing an on/off state of the present invention;
FIG. 2 is a schematic diagram illustrating a method for analyzing power on/off status according to an embodiment of the present invention;
FIG. 3 is a flow chart of yet another embodiment of a method of analyzing power on/off status of the present invention;
FIG. 4 is a flow chart of another embodiment of a method of analyzing power on/off status of the present invention;
FIG. 5 is a flow chart of yet another embodiment of a method of analyzing power on/off status of the present invention;
FIG. 6 is a flow chart of one embodiment of a method of analyzing an on/off state of the present invention;
FIG. 7 is a schematic diagram illustrating a method for analyzing power on/off status according to an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating the configuration of one embodiment of a system for analyzing on/off status according to the present invention;
fig. 9 is a schematic structural view of an embodiment of an apparatus for analyzing on/off states according to the present invention.
Reference numerals illustrate: 1. dividing the module; 2. a preset module; 3. a recording module; 4. a write module; 5. a display module; 6. a readback module; 7. an analysis module; 8. deleting the module; 10. a memory; 11. a computer program; 12. a processor.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will explain the specific embodiments of the present invention with reference to the accompanying drawings. It is evident that the drawings in the following description are only examples of the invention, from which other drawings and other embodiments can be obtained by a person skilled in the art without inventive effort.
For the sake of simplicity of the drawing, the parts relevant to the present invention are shown only schematically in the figures, which do not represent the actual structure thereof as a product. Additionally, in order to simplify the drawing for ease of understanding, components having the same structure or function in some of the drawings are shown schematically with only one of them, or only one of them is labeled. Herein, "a" means not only "only this one" but also "more than one" case.
In one embodiment of the present invention, as shown in fig. 1 and 2, a method for analyzing an on/off state is provided, including:
s100, dividing a special storage structure partition, and presetting switching on/off information to be recorded and the switching on/off state times to be recorded.
Preferably, the on-off information includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, the starting reasons include restarting and OTA upgrading.
Specifically, the shutdown reasons include restart, download, OTA upgrade, and crash.
Specifically, the special storage structure partition is used for storing the switching on/off information, and is divided according to the size of the switching on/off information to be stored. The on-off information to be recorded, such as the on-off times, the on-off time, the on-off reason, the off-off reason, the on-off system, etc., is preset according to the use requirement of the engineer, and the on-off state times are recorded according to the use requirement of the engineer, wherein in the embodiment, the time from one on to one off is defined as one time.
Specifically, in this embodiment, the number of times of recording the on/off state is preset to be 4, and the on/off information is recorded for 4 times.
It should be noted that the above power-on/off information is not limited to the power-on times, the power-on time, the power-on reason, the power-off reason, and the power-on system, and may include different power-on/off information in different application scenarios.
In addition, it should be noted that the number of times of the on-off state can be defined according to the common use and the use requirements of different applications and the size of the partition of the special storage structure, and the specific numerical value is not limited.
S200, after the U-Boot is started, the startup and shutdown information of corresponding times is recorded.
Specifically, U-Boot, under full scale Universal Boot Loader, is an open source item that complies with the terms of GPL. The U-Boot function is system Boot. The U-Boot not only supports the booting of the embedded Linux system, but also supports NetBSD, vxWorks, QNX, RTEMS, ARTOS, lynxOS, android embedded operating system. The currently primary support target operating system is OpenBSD, netBSD, freeBSD,4.4BSD,Linux,SVR4,Esix,Solaris,Irix,SCO,Dell,NCR,VxWorks,LynxOS,pSOS,QNX,RTEMS,ARTOS,android. The U-Boot working modes include a Boot loading mode and a downloading mode. The boot loading mode is a normal working mode of the Bootloader, when the embedded product is released, the Bootloader must work in the mode, and the Bootloader loads the embedded operating system from FLASH to SDRAM for running, and the whole process is automatic. The downloading mode is that the Bootloader downloads the kernel image or the root file system image and the like from the PC to the FLASH of the target board through some communication means. The user can complete the operation wanted by himself by using some command interfaces provided by Bootloader.
Specifically, in the present embodiment, as shown in fig. 2, 4 times of switching on/off information is recorded according to the preset number of times of switching on/off states to be recorded.
Note that, the record of the on-off information may be recorded in the form of a system log, or may be recorded in a special on-off information record table.
And S300, writing the recorded switching-on/off information of corresponding times into the special storage structure partition according to the preset switching-on/off state times.
Specifically, 4 switching on/off information is recorded according to a preset value, and the 4 switching on/off information is written into the divided storage structure partitions.
Preferably, in this embodiment, the recorded 4 times of on-off information is the last 4 times of on-off information, that is, when 4 times of on-off information are stored in the special storage structure partition, and when the power on occurs again, the earliest on-off information stored in the special storage structure partition is deleted, and the current on-off information is written in.
Specifically, the embodiment can also keep the required startup and shutdown information according to the use requirement of an engineer.
In this embodiment, a specific storage structure partition with a certain size is divided according to the use requirement of an engineer, the on-off information to be recorded and the on-off state times to be recorded are preset, when the U-boot is started, the latest on-off information with corresponding times is recorded and is written into the specific storage structure partition for storage, and when the equipment is abnormal in on-off, the engineer can know the reason of the multiple on-off abnormality by inquiring the recorded latest on-off information with multiple times.
In yet another embodiment of the present invention, as shown in fig. 2 and 3, a method for analyzing an on/off state is provided, including:
s100, dividing a special storage structure partition, and presetting switching on/off information to be recorded and the switching on/off state times to be recorded.
Preferably, the on-off information includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, the starting reasons include restarting and OTA upgrading.
Specifically, the shutdown reasons include restart, download, OTA upgrade, and crash.
Specifically, the special storage structure partition is used for storing the switching on/off information, and is divided according to the size of the switching on/off information to be stored. The on-off information to be recorded, such as the on-off times, the on-off time, the on-off reason, the off-off reason, the on-off system, etc., is preset according to the use requirement of the engineer, and the on-off state times are recorded according to the use requirement of the engineer, wherein in the embodiment, the time from one on to one off is defined as one time.
Specifically, in this embodiment, the number of times of recording the on/off state is preset to be 4, and the on/off information is recorded for 4 times.
It should be noted that the above power-on/off information is not limited to the power-on times, the power-on time, the power-on reason, the power-off reason, and the power-on system, and may include different power-on/off information in different application scenarios.
In addition, it should be noted that the number of times of the on-off state can be defined according to the common use and the use requirements of different applications and the size of the partition of the special storage structure, and the specific numerical value is not limited.
S200, after the U-Boot is started, the startup and shutdown information of corresponding times is recorded.
Specifically, in the present embodiment, as shown in fig. 2, 4 times of switching on/off information is recorded according to the preset number of times of switching on/off states to be recorded.
Note that, the record of the on-off information may be recorded in the form of a system log, or may be recorded in a special on-off information record table.
And S300, writing the recorded switching-on/off information of corresponding times into the special storage structure partition according to the preset switching-on/off state times.
Specifically, 4 switching on/off information is recorded according to a preset value, and the 4 switching on/off information is written into the divided storage structure partitions.
Preferably, in this embodiment, the recorded 4 times of on-off information is the last 4 times of on-off information, that is, when 4 times of on-off information are stored in the special storage structure partition, and when the power on occurs again, the earliest on-off information stored in the special storage structure partition is deleted, and the current on-off information is written in.
Specifically, after the step S300 of writing the recorded switching on/off information of the corresponding number of times into the dedicated storage structure partition according to the preset switching on/off state number of times, the method includes the steps of:
and S400, displaying the switching on/off information written into the special storage structure partition when the power-on is normally started.
Specifically, the on-off information described in this embodiment includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, when the device is normally started, the on-off information written into the special storage structure partition is displayed, in this embodiment, 4 on-off states are preset and recorded, so that 4 on-off information is recorded, 4 on-off information is written into the special storage structure partition, and when the device is normally started, 4 on-off information is displayed.
Specifically, after the step S300 of writing the recorded switching on/off information of the corresponding times into the dedicated storage structure partition according to the preset switching on/off state times, the method further includes the steps of:
and S500, when the power-on cannot be started normally, reading back the power-on and power-off information written into the special storage structure partition for a plurality of times, and analyzing and checking the state.
Specifically, when the device cannot be started normally, the on-off information cannot be checked through the device, and at the moment, if the reason of abnormal starting of the device is required to be known, the on-off information written into the special storage structure partition for a plurality of times can be read back through a tool such as a USB external device, and the analysis and check state are performed.
In this embodiment, a specific storage structure partition with a certain size is divided according to the use requirement of an engineer, the switching on/off information to be recorded and the switching on/off state times to be recorded are preset, when the U-boot is started, the latest switching on/off information with corresponding times is recorded and is written into the specific storage structure partition for storage, when the equipment is normally started, the latest switching on/off information with a plurality of times can be displayed, when the equipment cannot be normally started, the tool can read back the switching on/off information with the latest switching on/off information with a plurality of times written into the specific storage structure partition, and the engineer can know the reason of the switching on/off abnormality by checking the switching on/off information with the latest switching on/off information with a plurality of times in the specific storage structure partition, so that maintenance is timely performed.
In another embodiment of the present invention, as shown in fig. 2 and 4, a method for analyzing an on/off state is provided, including:
s100, dividing a special storage structure partition, and presetting switching on/off information to be recorded and the switching on/off state times to be recorded.
Preferably, the on-off information includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, the starting reasons include restarting and OTA upgrading.
Specifically, the shutdown reasons include restart, download, OTA upgrade, and crash.
Specifically, the special storage structure partition is used for storing the switching on/off information, and is divided according to the size of the switching on/off information to be stored. The on-off information to be recorded, such as the on-off times, the on-off time, the on-off reason, the off-off reason, the on-off system, etc., is preset according to the use requirement of the engineer, and the on-off state times are recorded according to the use requirement of the engineer, wherein in the embodiment, the time from one on to one off is defined as one time.
Specifically, in this embodiment, the number of times of recording the on/off state is preset to be 4, and the on/off information is recorded for 4 times.
It should be noted that the above power-on/off information is not limited to the power-on times, the power-on time, the power-on reason, the power-off reason, and the power-on system, and may include different power-on/off information in different application scenarios.
In addition, it should be noted that the number of times of the on-off state can be defined according to the common use and the use requirements of different applications and the size of the partition of the special storage structure, and the specific numerical value is not limited.
S200, after the U-Boot is started, the startup and shutdown information of corresponding times is recorded.
Specifically, in the present embodiment, as shown in fig. 2, 4 times of switching on/off information is recorded according to the preset number of times of switching on/off states to be recorded.
Note that, the record of the on-off information may be recorded in the form of a system log, or may be recorded in a special on-off information record table.
And S300, writing the recorded switching-on/off information of corresponding times into the special storage structure partition according to the preset switching-on/off state times.
Specifically, 4 switching on/off information is recorded according to a preset value, and the 4 switching on/off information is written into the divided storage structure partitions.
Preferably, in this embodiment, the recorded 4 times of on-off information is the last 4 times of on-off information, that is, when 4 times of on-off information are stored in the special storage structure partition, and when the power on occurs again, the earliest on-off information stored in the special storage structure partition is deleted, and the current on-off information is written in.
Specifically, in the step S300, writing the recorded switching on/off information of the corresponding times into the dedicated storage structure partition according to the preset switching on/off state times specifically includes the steps of:
s310, judging whether the number of times of the on-off states stored in the special storage structure partition is smaller than the preset number of times of the on-off states.
Specifically, when the memory of the dedicated storage structure partition has the on-off information, in order to ensure that the memory is stored as the latest on-off information for several times, the on-off state number and the preset on-off state number stored in the dedicated storage structure partition need to be judged.
And S320, when the switching-on/off times stored in the special storage structure partition are smaller than the preset switching-on/off state times, writing the recorded switching-on/off information of the corresponding times into the special storage structure partition.
Specifically, when the number of switching on/off times stored in the special storage structure partition is smaller than the preset number of switching on/off states, the fact that the special storage structure partition is not full is indicated, and the recorded switching on/off information of corresponding times is written into the special storage structure partition. For example, 3 times of on-off information is stored in the special storage structure partition, the number of on-off states recorded in advance is set to be 4 times, at this time, the number of on-off times of the 3 times stored in the special storage structure partition is smaller than the number of times of the preset 4 times of on-off states, and then the current on-off information is written into the special storage structure partition.
Specifically, after the step S300 of writing the recorded switching on/off information of the corresponding number of times into the dedicated storage structure partition according to the preset switching on/off state number of times, the method includes the steps of:
and S400, displaying the switching on/off information written into the special storage structure partition when the power-on is normally started.
Specifically, the on-off information described in this embodiment includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, when the device is normally started, the on-off information written into the special storage structure partition is displayed, in this embodiment, 4 on-off states are preset and recorded, so that 4 on-off information is recorded, 4 on-off information is written into the special storage structure partition, and when the device is normally started, 4 on-off information is displayed.
Specifically, after the step S300 of writing the recorded switching on/off information of the corresponding times into the dedicated storage structure partition according to the preset switching on/off state times, the method further includes the steps of:
and S500, when the power-on cannot be started normally, reading back the power-on and power-off information written into the special storage structure partition for a plurality of times, and analyzing and checking the state.
Specifically, when the device cannot be started normally, the on-off information cannot be checked through the device, and at the moment, if the reason of abnormal starting of the device is required to be known, the on-off information written into the special storage structure partition for a plurality of times can be read back through a tool such as a USB external device, and the analysis and check state are performed.
In still another embodiment of the present invention, as shown in fig. 2 and 5, a method for analyzing an on/off state is provided, including:
s100, dividing a special storage structure partition, and presetting switching on/off information to be recorded and the switching on/off state times to be recorded.
Preferably, the on-off information includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, the starting reasons include restarting and OTA upgrading.
Specifically, the shutdown reasons include restart, download, OTA upgrade, and crash.
Specifically, the special storage structure partition is used for storing the switching on/off information, and is divided according to the size of the switching on/off information to be stored. The on-off information to be recorded, such as the on-off times, the on-off time, the on-off reason, the off-off reason, the on-off system, etc., is preset according to the use requirement of the engineer, and the on-off state times are recorded according to the use requirement of the engineer, wherein in the embodiment, the time from one on to one off is defined as one time.
Specifically, in this embodiment, the number of times of recording the on/off state is preset to be 4, and the on/off information is recorded for 4 times.
It should be noted that the above power-on/off information is not limited to the power-on times, the power-on time, the power-on reason, the power-off reason, and the power-on system, and may include different power-on/off information in different application scenarios.
In addition, it should be noted that the number of times of the on-off state can be defined according to the common use and the use requirements of different applications and the size of the partition of the special storage structure, and the specific numerical value is not limited.
S200, after the U-Boot is started, the startup and shutdown information of corresponding times is recorded.
Specifically, in the present embodiment, as shown in fig. 2, 4 times of switching on/off information is recorded according to the preset number of times of switching on/off states to be recorded.
Note that, the record of the on-off information may be recorded in the form of a system log, or may be recorded in a special on-off information record table.
And S300, writing the recorded switching-on/off information of corresponding times into the special storage structure partition according to the preset switching-on/off state times.
Specifically, 4 switching on/off information is recorded according to a preset value, and the 4 switching on/off information is written into the divided storage structure partitions.
Preferably, in this embodiment, the recorded 4 times of on-off information is the last 4 times of on-off information, that is, when 4 times of on-off information are stored in the special storage structure partition, and when the power on occurs again, the earliest on-off information stored in the special storage structure partition is deleted, and the current on-off information is written in.
Specifically, in the step S300, writing the recorded switching on/off information of the corresponding times into the dedicated storage structure partition according to the preset switching on/off state times specifically includes the steps of:
s310, judging whether the number of times of the on-off states stored in the special storage structure partition is smaller than the preset number of times of the on-off states.
Specifically, when the memory of the dedicated storage structure partition has the on-off information, in order to ensure that the memory is stored as the latest on-off information for several times, the on-off state number and the preset on-off state number stored in the dedicated storage structure partition need to be judged.
Specifically, after the step S310 of determining whether the number of times of the on/off states stored in the dedicated storage structure partition is less than the preset number of times of the on/off states, the method further includes the steps of:
s330, when the switching-on/off information stored in the special storage structure partition is equal to the preset switching-on/off state times, the earliest switching-on/off information stored in the special storage structure partition is deleted.
Specifically, when the switching on/off information stored in the special storage structure partition is equal to the preset switching on/off state times, the switching on/off information required to be recorded is described as being fully stored in the special storage structure partition, and in order to ensure that the switching on/off information stored in the special storage structure partition is the latest switching on/off information for a plurality of times, the earliest switching on/off information stored in the special storage structure partition is deleted. For example, when the number of times of switching on/off states stored in the storage mechanism partition is 4 times, the number of times of switching on/off states which are preset and required to be recorded is also 5 times, at this time, the switching on/off information written into the special storage mechanism partition for the earliest time, namely the 1 st time, is deleted.
And S340, after the earliest switching on/off information stored in the special storage structure partition is deleted, writing the recorded switching on/off information with corresponding times into the special storage structure partition.
Specifically, after the earliest switching on/off information stored in the special storage structure partition is deleted, the current switching on/off information is written into the special storage structure partition. For example, when the number of times of switching on/off states of the preset required record is 5 times, the switching on/off information written into the special storage structure partition for the first time, i.e. the 1 st time, is deleted, and the switching on/off information required to be recorded at present is written into the special storage structure partition.
Specifically, after the step S300 of writing the recorded switching on/off information of the corresponding number of times into the dedicated storage structure partition according to the preset switching on/off state number of times, the method includes the steps of:
and S400, displaying the switching on/off information written into the special storage structure partition when the power-on is normally started.
Specifically, the on-off information described in this embodiment includes: the method comprises the steps of starting times, starting time, starting reasons, shutdown reasons and a starting system.
Specifically, when the device is normally started, the on-off information written into the special storage structure partition is displayed, in this embodiment, 4 on-off states are preset and recorded, so that 4 on-off information is recorded, 4 on-off information is written into the special storage structure partition, and when the device is normally started, 4 on-off information is displayed.
Specifically, after the step S300 of writing the recorded switching on/off information of the corresponding times into the dedicated storage structure partition according to the preset switching on/off state times, the method further includes the steps of:
and S500, when the power-on cannot be started normally, reading back the power-on and power-off information written into the special storage structure partition for a plurality of times, and analyzing and checking the state.
Specifically, when the device cannot be started normally, the on-off information cannot be checked through the device, and at the moment, if the reason of abnormal starting of the device is required to be known, the on-off information written into the special storage structure partition for a plurality of times can be read back through a tool such as a USB external device, and the analysis and check state are performed.
In this embodiment, the number of on/off states stored in the dedicated storage structure partition is compared with the number of preset on/off states, when the number of on/off states stored in the dedicated storage structure partition is equal to the number of preset on/off states, the earliest on/off information stored in the dedicated storage structure partition is deleted, and the on/off information to be recorded currently is written into the dedicated storage structure partition, so as to ensure that the latest on/off information stored in the dedicated storage structure partition is acquired, so that an engineer knows the latest on/off information, and the problem that only the current on/off information is recorded, but the previous on/off information is not recorded, and the cause of the abnormal on/off of the equipment cannot be known is avoided.
In one embodiment of the present invention, as shown in fig. 6 and 7, a method for analyzing an on/off state is provided, including:
the power on reason, the power off reason, etc. are recorded at the time of uboot start as shown in fig. 6.
The relevant reasons for the record are written to the dedicated storage structure partition at uboot start-up as shown in fig. 6.
The latest 5 times are recorded and stored at the time of uboot startup as shown in fig. 7, and the corresponding startup times are recorded.
And displaying the historical startup and shutdown information recorded in uboot after starting.
If the power-on cannot be started normally, the data of the written special storage partition can be read back through the tool and the analysis and the state check can be carried out.
The invention is based on the design and use of a high-pass platform, can be used on various platforms, and has universality.
Compared with the traditional method, the invention has the following advantages:
can be used on various platforms and has portability.
And data is collected and dedicated to the storage partition in the starting-up stage, so that the data can be ensured not to be lost.
The on-off state can be recorded continuously for a plurality of times.
If the machine can not be started normally, the relevant storage partition can be read back and analyzed actively.
In one embodiment of the present invention, as shown in fig. 8, a system for analyzing an on-off state is provided, including:
the division module 1 is used for dividing the special storage structure partition.
The presetting module 2 is connected with the dividing module 1 and is used for presetting the switching on/off information to be recorded and the switching on/off state times to be recorded.
The recording module 3 is connected with the preset module 2 and is used for recording the startup and shutdown information of corresponding times after the U-Boot is started.
The writing module 4 is connected with the recording module 3 and is used for writing the recorded switching on/off information of corresponding times into the special storage structure partition according to the preset switching on/off state times.
Specifically, the method further comprises the following steps:
and the display module 5 is connected with the writing module 4 and displays the switching-on and switching-off information written into the special storage structure partition when the power-on is normally started.
And the read-back module 6 is connected with the writing module 4, and is used for reading back the switching-on and switching-off information written into the special storage structure partition for a plurality of times when the normal starting-up is impossible, and analyzing and checking the state.
The analysis module 7 is connected with the recording module 3 and is used for judging whether the number of times of the on-off states stored in the special storage structure partition is smaller than the preset number of times of the on-off states.
And the deleting module 8 is connected with the analyzing module 7 and is used for deleting the earliest switching on/off information stored in the special storage structure partition when the switching on/off information stored in the special storage structure partition is equal to the preset switching on/off state times.
Specifically, the writing module 4 is connected to the analysis module 7, and is further configured to write the recorded switching on/off information of the corresponding number of times into the dedicated storage structure partition when the switching on/off times stored in the dedicated storage structure partition are less than the preset switching on/off state times.
Specifically, the writing module 4 is connected to the deleting module 8, and is further configured to write the recorded switching on/off information corresponding to the number of times into the dedicated storage structure partition after the earliest switching on/off information stored in the dedicated storage structure partition is deleted.
An embodiment of the invention provides a storage medium having stored thereon a computer program 11, which computer program 11, when executed by a processor 12, implements all or part of the method steps of the above-described embodiments.
The present invention may be implemented by implementing all or part of the above-described embodiment method, or by implementing the relevant hardware by means of a computer program 11, where the computer program 11 may be stored in a storage medium, and where the computer program 11, when executed by a processor 12, may implement the steps of the above-described method embodiments. Wherein the computer program 11 comprises computer program code which may be in the form of source code, object code, executable files or in some intermediate form, etc. The storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
An embodiment of the present invention further provides an apparatus for analyzing a power on/off state, as shown in fig. 9, including a memory 10 and a processor 12, where the memory 10 stores a computer program 11 running on the processor 12, and all or part of the method steps in the first embodiment are implemented when the processor 12 executes the computer program 11.
The processor 12 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is a control center of the computer device, connecting various parts of the overall computer device using various interfaces and lines.
The memory 10 may be used to store the computer programs and/or modules, and the processor 12 may perform various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory 10, and invoking data stored in the memory 10. The memory 10 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. The storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc. In addition, memory 10 may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The invention has the beneficial effects that: the method comprises the steps of dividing a special storage structure partition with a certain size according to the use requirement of an engineer, presetting the on-off information to be recorded and the on-off state times to be recorded, recording the latest on-off information of corresponding times when a U-boot is started, writing the latest on-off information into the special storage structure partition for storage, displaying the latest on-off information for a plurality of times when equipment is started normally, reading the on-off information written into the special storage structure partition for a plurality of times through a tool when the equipment cannot be started normally, comparing the on-off state times stored in the special storage structure partition with the preset on-off state times, writing the current on-off information into the special storage structure partition when the on-off state times stored in the special storage structure partition are smaller than the preset on-off state times, deleting the latest on-off information stored in the special storage structure partition when the on-off state times stored in the special storage structure partition are equal to the preset on-off state times, writing the current on-off information to the special storage structure partition for a plurality of times, and ensuring that the latest on-off information stored in the special storage structure partition is not known for a plurality of times when the on-off information stored in the special storage structure partition is not the latest on-off information, and the switching on-off information stored for a plurality of times is not known for a plurality of times when the latest on-off information stored in the special storage partition is not known, and the switching on-off information is recorded for a problem is not known for a switch when the latest on the switch is stored for a switch.
It should be noted that the above embodiments can be freely combined as needed. The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (3)

1. A method of analyzing a power on/off state, comprising the steps of:
dividing a special storage structure partition, and presetting switching on and off information to be recorded and switching on and off state times to be recorded, wherein one switching on and off state comprises one switching on and one switching off, and the switching on and off information comprises: the system comprises a starting frequency, a starting time, a starting reason, a shutdown reason and a starting system, wherein the starting reason comprises: restarting and OTA upgrading, wherein the shutdown reasons comprise: restarting, downloading, OTA upgrading and crashing;
after the U-Boot is started, the startup and shutdown information of corresponding times is recorded;
writing the recorded switching on/off information of corresponding times into the special storage structure partition according to the preset switching on/off state times, wherein,
when the switching-on/off information stored in the special storage structure partition is equal to the preset switching-on/off state times, deleting the earliest switching-on/off information stored in the special storage structure partition, and writing the recorded switching-on/off information with corresponding times into the special storage structure partition;
when the switching-on/off times stored in the special storage structure partition are smaller than the preset switching-on/off state times, writing the recorded switching-on/off information of corresponding times into the special storage structure partition;
when the power is normally turned on, displaying the power on/off information written into the special storage structure partition;
and when the power-on cannot be started normally, reading back the power-on and power-off information written into the special storage structure partition for a plurality of times, and analyzing and checking the state.
2. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the method of claim 1.
3. An apparatus for analyzing a power on/off state, comprising:
the special storage structure partition is used for storing preset switching on and off information to be recorded and switching on and off state times to be recorded, wherein one switching on and off state comprises one switching on and one switching off, and the switching on and off information comprises: the system comprises a starting frequency, a starting time, a starting reason, a shutdown reason and a starting system, wherein the starting reason comprises: restarting and OTA upgrading, wherein the shutdown reasons comprise: restarting, downloading, OTA upgrading and crashing;
the processor is used for recording the switching-on/off information of corresponding times after the U-Boot is started, writing the recorded switching-on/off information of corresponding times into the special storage structure partition according to the preset switching-on/off state times, wherein,
when the switching-on/off information stored in the special storage structure partition is equal to the preset switching-on/off state times, deleting the earliest switching-on/off information stored in the special storage structure partition, and writing the recorded switching-on/off information with corresponding times into the special storage structure partition;
when the switching-on/off times stored in the special storage structure partition are smaller than the preset switching-on/off state times, writing the recorded switching-on/off information of corresponding times into the special storage structure partition;
when the power-on cannot be started normally, the power-on and power-off information written into the special storage structure partition for a plurality of times is read back, and analysis and checking are carried out;
further comprises:
and the display unit is used for displaying the switching on/off information written into the special storage structure partition when the power-on is normally started.
CN201911159410.XA 2019-11-22 2019-11-22 Method, system, equipment and storage medium for analyzing on-off state Active CN110928591B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911159410.XA CN110928591B (en) 2019-11-22 2019-11-22 Method, system, equipment and storage medium for analyzing on-off state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911159410.XA CN110928591B (en) 2019-11-22 2019-11-22 Method, system, equipment and storage medium for analyzing on-off state

Publications (2)

Publication Number Publication Date
CN110928591A CN110928591A (en) 2020-03-27
CN110928591B true CN110928591B (en) 2024-02-20

Family

ID=69851837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911159410.XA Active CN110928591B (en) 2019-11-22 2019-11-22 Method, system, equipment and storage medium for analyzing on-off state

Country Status (1)

Country Link
CN (1) CN110928591B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112348995A (en) * 2020-11-10 2021-02-09 天津津航计算技术研究所 Data recorder based on power-on times
CN112348994A (en) * 2020-11-10 2021-02-09 天津津航计算技术研究所 Data recording method based on power-on times

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665095A (en) * 2012-04-12 2012-09-12 青岛海信电器股份有限公司 Method and system for locating random on-off failure of television
CN103425556A (en) * 2012-05-22 2013-12-04 鸿富锦精密工业(深圳)有限公司 Method and system used for recording shutdown information of notebook computer
CN108363477A (en) * 2018-03-02 2018-08-03 郑州云海信息技术有限公司 Server power-up state monitors system and method, computer storage and equipment
CN108959051A (en) * 2018-06-29 2018-12-07 深圳市同泰怡信息技术有限公司 System log collection method
CN109522147A (en) * 2018-11-15 2019-03-26 Oppo广东移动通信有限公司 A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN109783149A (en) * 2019-01-17 2019-05-21 Oppo广东移动通信有限公司 Start-up control method, device, mobile terminal and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9032194B2 (en) * 2010-12-06 2015-05-12 Microsoft Technology Licensing, Llc Fast computer startup

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665095A (en) * 2012-04-12 2012-09-12 青岛海信电器股份有限公司 Method and system for locating random on-off failure of television
CN103425556A (en) * 2012-05-22 2013-12-04 鸿富锦精密工业(深圳)有限公司 Method and system used for recording shutdown information of notebook computer
CN108363477A (en) * 2018-03-02 2018-08-03 郑州云海信息技术有限公司 Server power-up state monitors system and method, computer storage and equipment
CN108959051A (en) * 2018-06-29 2018-12-07 深圳市同泰怡信息技术有限公司 System log collection method
CN109522147A (en) * 2018-11-15 2019-03-26 Oppo广东移动通信有限公司 A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN109783149A (en) * 2019-01-17 2019-05-21 Oppo广东移动通信有限公司 Start-up control method, device, mobile terminal and storage medium

Also Published As

Publication number Publication date
CN110928591A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
US9558016B2 (en) Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product
US7085957B2 (en) Upgrading of firmware with tolerance to failures
CN106844136B (en) Method and system for collecting program crash information
US20030221092A1 (en) Method and system of switching between two or more images of firmware on a host device
CN110928591B (en) Method, system, equipment and storage medium for analyzing on-off state
US20070038801A1 (en) Control circuit, electronic device using the same, and firmware update method
US20080182668A1 (en) Information processor
CN104123153A (en) Apparatus and method for firmware upgrade using USB
US20100312541A1 (en) Program test device and program
US10809996B2 (en) Method and device for creating images of different installation and download software units
CN111158987A (en) Health check method and device of micro-service architecture
KR20100050098A (en) Image processing apparatus and control method thereof
EP1710697A1 (en) Method and apparatus for executing application in system having NAND flash memory
CN114510375A (en) Flash chip data area dynamic sharing system and method
CN112148376A (en) Terminal starting method and device
CN110913417A (en) Method, system, equipment and storage medium for protecting radio frequency parameters
KR100673999B1 (en) Method for booting of mobile
CN112905217B (en) Program updating method, terminal, system and storage medium of embedded program
CN111158733A (en) BMC upgrading method, device, equipment and computer readable storage medium
CN115904820B (en) Recovery method and system for failed hard disk
JP2012194675A (en) Information apparatus and emergency access method for information apparatus
CN115344313B (en) Android system partition mounting method, electronic equipment and machine-readable storage medium
CN110531944B (en) Method for controlling operation of printing consumable adapter based on intelligent terminal system, computer device and computer readable storage medium
CN110389844B (en) Go language-based message processing method and device and storage medium
CN118051240A (en) Method, device, equipment, medium and product for installing computer operating system

Legal Events

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