Method for obtaining device status information after network-operated device system and device crash
By running the logic chip and device serial port in the device system on the network, and using shortcut keys to switch data lines, the collection of status information when the device crashes is realized, which solves the problem of being unable to obtain device status information in the existing technology and provides a solution to the crash. Effective analysis of causes.
Patent Information
- Application Number
- CN202111409592.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-11-25
AI Technical Summary
After the device crashes, existing technology is difficult to effectively collect device status information, especially when the CPU cannot respond to interrupts normally or perform memory/non-volatile memory write operations, and the cause of the crash cannot be obtained.
A system for running equipment on the network is adopted. Through the logic chip and the device serial port, shortcut keys are used to switch data lines. The logic chip collects device status information when the device crashes and provides it to the user through level conversion devices and protective devices to realize the device status. Collection of information.
When the device crashes, you can use shortcut keys to switch the device serial port to the logic chip to collect device status information, including power status, fan status, temperature, etc., to help problem location and analysis, and is suitable for CPUs that cannot respond to interrupts normally.
Smart Images

Figure CN114138599B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of information technology, and in particular relates to a method for obtaining device status information after a network-operated device system and a device crash. Background Art
[0002] In a microcomputer system composed of a single-chip microcomputer, the operation of the single-chip microcomputer is often interfered by external electromagnetic fields, causing data confusion in various registers and memories. Whether it is passive components such as resistors and capacitors, or active components such as IC chips, there is a certain probability of failure. Once a component fails, it may cause program pointer errors, be out of the program area, or take out wrong program instructions, etc., and it may fall into an infinite loop. The normal operation of the program is interrupted, and the system controlled by the single-chip microcomputer cannot continue to work normally, causing the entire system to fall into a stagnant state, that is, a freeze state, with unpredictable consequences.
[0003] After the device crashes, you need to locate the cause of the crash, and you need to collect some device-related information, such as power status, fan status, temperature information, chip register information, etc. Because some faults are not necessarily present and cannot be reproduced after the device is restarted, even if the device is returned to the manufacturer for analysis, it may not be possible to draw a conclusion, so collecting first-hand device information when the crash occurs is crucial for problem location analysis.
[0004] When a device crashes, device designers usually consider countermeasures, such as designing a watchdog circuit. The watchdog circuit is essentially a timer circuit, which generally has an input and an output. The input is called the dog feeder, and the output is generally connected to the reset terminal of another part, generally connected to the microcontroller. The function of the watchdog is to regularly check the internal situation of the chip and send a restart signal to the chip once an error occurs. The watchdog command has the highest priority in the interrupt of the program. The CPU continuously feeds the dog. Once a crash occurs, if the CPU cannot feed the dog, the watchdog will call to restart the device and try to restore it to normal. Before the watchdog restarts, it notifies the CPU through an interrupt signal to store the device status information in the memory or non-volatile memory such as Flash, and the CPU will read it out for analysis after the device returns to normal.
[0005] The watchdog circuit has the following problems:
[0006] 1. Before restarting the device, the CPU stores the device status information in the memory or non-volatile memory on the premise that the CPU can still respond to interrupts normally and can write to the memory or non-volatile memory. If this premise is not established, the device status information at the time of the crash cannot be collected;
[0007] 2. Currently, many CPUs are multi-core, and the CPU only uses one core to feed the watchdog. It is possible that the CPU core that feeds the watchdog is always working normally, while the CPU core used for other work has an exception. In this case, the watchdog crash will not trigger a restart of the device, and the device status information cannot be collected. Summary of the invention
[0008] The present invention aims to solve the above technical problems and provides a method for obtaining device status information after a network-operated device system and a device crash.
[0009] In order to achieve the above object, the present invention adopts the following technical solution:
[0010] A network-operated device system comprises: a CPU, a logic chip and a device serial port, wherein the logic chip comprises a device serial port data information sending end, a device serial port data information receiving end, a CPU data information sending end, a CPU data information receiving end, a serial port information processing unit and a switching switch, wherein the device serial port receives data information and sends the data information to the device serial port data information receiving end of the logic chip, wherein the logic chip receives data information and sends the data information to the CPU through the CPU data information sending end, wherein the CPU sends the data information to the CPU data information receiving end of the logic chip, wherein the logic chip receives data information and sends the data information to the device serial port through the switching switch and the device serial port data information sending end, wherein the input end of the serial port information processing unit is connected to the device serial port data information receiving end, wherein the output end of the serial port information processing unit is connected in series with the switching switch and then connected to the device serial port The switching switch is used to switch the on / off of the data line from the CPU data information receiving end to the device serial port data information sending end and the on / off of the data line from the serial port data information sending end to the device serial port data information sending end. The serial port information processing unit is used to determine whether the data information received by the device serial port is shortcut key 1. When the device is not in a dead state, shortcut key 1 will not be input. The data line from the CPU data information receiving end to the device serial port data information sending end is connected. When the device is determined to be in a dead state, the user inputs shortcut key 1 from the device serial port, and the serial port information processing unit controls the switching switch to disconnect the data line from the CPU data information receiving end to the device serial port data information sending end, and connect the data line from the serial port data information sending end to the device serial port data information sending end, and realize the device status information collection by responding to the information collection command input by the user through the logic chip.
[0011] A method for obtaining device status information after a device crashes. The network-operated device has a device serial port. The device serial port is a serial port of a CPU provided to the device through a logic chip and then through a level conversion device and a protection device. After the device is powered on, the logic chip will always be in a working state. The working logic of the logic chip is realized through programming language Verilog or VHDL coding. When the device works normally, the logic chip interconnects the device serial port with the CPU serial port to realize normal serial port functions. When the device crashes, the user can switch the device serial port to the logic chip through a shortcut key to realize the collection of device status information.
[0012] As a preferred embodiment, the logic chip performs signal analysis while sending the signal input from the device serial port to the CPU, and analyzes each received byte according to the serial port protocol and baud rate for the next step of judgment and processing; the shortcut key 1 corresponds to hexadecimal 0C. If the logic chip detects 0C, it means that the shortcut key 1 is pressed, and the device serial port is switched to the logic chip; after switching to the logic chip, the logic chip will respond as follows: analyze the byte corresponding to the device serial port input signal, and send back the device serial port output for all bytes except the enter key byte for the serial port terminal software to echo the command input by the user; if the enter key byte is detected, it means that the command input is completed, and it is analyzed according to the agreed command format, and the "line feed + enter + device status information corresponding to the user input command" is output to the device serial port in sequence for the user to view. Among them, the line feed key byte corresponds to hexadecimal 0A, and the enter key byte corresponds to hexadecimal 0D.
[0013] As a preference, define the shortcut key 2 for switching back to the CPU serial port. The shortcut key 1 switches to the logic chip in a one-way process, and the shortcut key 2 switches back to the CPU serial port. The shortcut key can be CTRL+X (X can be letters a~z), and be careful not to conflict with the shortcut keys defined by the serial terminal software. The shortcut key can also be selected in other forms as long as it does not conflict with the normally input command characters.
[0014] After adopting the above technical solution, the present invention has the following advantages:
[0015] When the device crashes, the device serial port is switched to the logic chip through a shortcut key to collect device status information. At this time, the CPU no longer responds to user input commands, and the logic chip parses and responds to user input commands and outputs the results to the user interface for the user to view. For devices that crash during network operation, an effective means is provided to collect device status information when the device crashes, which is of great help in problem location analysis. In theory, all signals connected to the logic chip can be obtained in this way, such as power supply status: whether it is in place, whether there is an alarm, power supply voltage, power supply temperature, power supply built-in fan status, etc., device fan status: whether it is in place, whether it is abnormal, fan speed value, etc., ambient temperature and hot spot temperature, reset and control signal status, watchdog status, etc.
[0016] The method for obtaining device status information after a device crashes can collect device status information when the device crashes, even for a CPU that cannot normally respond to interrupts and can perform memory or non-volatile memory write operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a structural diagram of the equipment system running on the network;
[0018] Figure 2 A flowchart of a method for obtaining device status information after a device crashes;
[0019] Figure 3 A flowchart of a working method of a logic chip;
[0020] Figure 4 Specific design for the logic to parse data according to the serial port protocol and respond to user commands. DETAILED DESCRIPTION
[0021] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0022] Users generally use a network management system to monitor the devices running on the network, and regularly collect various status information of the running devices through network protocols. The CPU of the running device supports the network protocol to respond to the regular polling commands of the network management system. If the system crashes due to an abnormality, the running device cannot respond to the command of the network management system. At this time, the user can perceive the failure of the running device on the network through the network management system, and the faulty device can also output sound and light to remind the user through the fault handling process set in advance. After the user confirms the equipment failure, if the cause of the failure is not clear, there is a need to collect various status information of the faulty device before powering off and then powering on the faulty device. At this time, information can be collected through the network running device system and the method of obtaining device status information after the device crashes adopted by the present invention.
[0023] The present invention provides an on-line running equipment system, comprising:
[0024] 1) CPU system, including CPU, RAM, ROM / Flash, power supply circuit required by the chip, clock supply circuit required by the chip, etc. The CPU system is the command center system of the network running equipment system, and all control information is processed and executed by the CPU system. The CPU reads the startup information from ROM / Flash, moves the running program to RAM for execution, and handles various requests and exceptions of the equipment in a pipeline or interrupt processing manner. The CPU system is responsible for judging the status of the equipment during operation. If an abnormal situation such as a freeze occurs, the user is informed in the form of sound, light and electricity, and the user makes the decision to make further processing.
[0025] 2) Business processing unit, including business processing chip and business port. For example, the business processing unit of a switch device is a switching chip and various user business interfaces. The switching chip schedules and processes various data of the business interface according to the set function and priority, and then searches the forwarding table / routing table in the switching chip to update the data header and check the result field. After various processing, the data is discarded or reported to the CPU system or forwarded to the user business interface. The business processing unit is generally separated from the CPU system, and the abnormal state of the CPU system does not affect the normal operation of the business processing unit.
[0026] 3) Control unit, including logic chip, device serial port, network management port, USB, etc. The control unit mainly sends various command commands of the CPU system to each chip or port in the system, collects various status information inside and outside the device and reports it to the CPU for judging the operation status of the device for further processing and issuing action command commands, collects user commands and provides them to the CPU, and then displays the CPU response information to the user through the user interface (serial port interface or network management platform system, etc.).
[0027] like Figure 1 As shown, the logic chip includes a device serial port data information sending end, a device serial port data information receiving end, a CPU data information sending end, a CPU data information receiving end, a serial port information processing unit and a switching switch. After receiving the data information, the device serial port sends the data information to the device serial port data information receiving end of the logic chip. After receiving the data information, the logic chip sends the data information to the CPU through the CPU data information sending end. The CPU sends the data information to the CPU data information receiving end of the logic chip. After receiving the data information, the logic chip passes through the switching switch and sends the data information to the device serial port through the device serial port data information sending end.
[0028] The input end of the serial port information processing unit is connected to the device serial port data information receiving end, and the output end of the serial port information processing unit is connected to the device serial port data information sending end after being connected in series with the switching switch. The switching switch is used to switch the on and off of the data line from the CPU data information receiving end to the device serial port data information sending end and the on and off of the data line from the serial port data information sending end to the device serial port data information sending end. The serial port information processing unit is used to determine whether the data information received by the device serial port is a shortcut key 1. When the device is not in a dead state, the shortcut key 1 will not be input, and the data line from the CPU data information receiving end to the device serial port data information sending end is connected. When the device is determined to be in a dead state, the user inputs the shortcut key 1 from the device serial port, and the serial port information processing unit controls the switching switch to disconnect the data line from the CPU data information receiving end to the device serial port data information sending end, and connect the data line from the serial port data information sending end to the device serial port data information sending end, and responds to the information collection command input by the user through the logic chip to realize the device status information collection.
[0029] like Figure 2 As shown, the present invention also provides a method for obtaining device status information after a device crashes. The network-operated device has a device serial port. The device serial port is the serial port of the CPU provided to the device through a logic chip and then through a level conversion device and a protection device. After the device is powered on, the logic chip will always be in a working state. The working logic of the logic chip is realized by coding in programming language Verilog or VHDL. When the device works normally, the logic chip interconnects the device serial port with the CPU serial port to realize normal serial port function. When the device crashes, the device serial port is switched to the logic chip through a shortcut key to realize the collection of device status information.
[0030] The shortcut key can be CTRL+X (X can be a letter from a to z), and it is important not to conflict with the shortcut keys defined by the serial terminal software. The shortcut key can also be selected in other forms, as long as it is guaranteed not to conflict with the normally input command characters. Because many commonly used shortcut keys have been widely used and are prone to conflict, the shortcut key 1 in this embodiment selects the rarely used CTRL+L.
[0031] A1: The logic chip is constantly analyzing the signal while sending it to the CPU. It analyzes each received byte according to the serial port protocol and baud rate to make the next judgment and processing. The shortcut key 1 corresponds to hexadecimal 0C. If the logic chip detects 0C, it means that the shortcut key 1 is pressed, and the device serial port is switched to the logic chip.
[0032] A2: After switching to the logic chip, the logic chip will respond as follows: parse the bytes corresponding to the device serial port input signal, and send back all bytes except the enter key byte to the device serial port output for the serial terminal software to echo the command input by the user; if the enter key byte is detected, it means that the command input is completed, and parse it according to the agreed command format, and output "line feed + enter + device status information corresponding to the user input command" to the device serial port in sequence for the user to view.
[0033] A3: Define the shortcut key 2 for switching back to the CPU serial port for switchback. Switchback means that after obtaining the status information of the device after the crash, the device serial port is switched back to the CPU serial port to check whether the device recovers from the abnormal state or perform other subsequent processing.
[0034] like Figure 3 , Figure 4 As shown, the logic chip works as follows:
[0035] B1: The logic chip receives the data stream after level conversion from the device serial port input, calculates the receiving sampling clock frequency according to the baud rate, and uses the clock sampling data signal to detect whether there is a low level. If there is a low level, the start bit of the serial port information of this frame is found. For reliable sampling, the 8-fold frequency clock of the data signal is generally used for sampling. In this way, there are at least 6 clock edges when the data bit actually sampled is 0 in the 8 clock cycles of the low level of the sampling start bit. Taking the middle position of the 6 clock edges as the clock edge for data sampling can ensure sufficient setup time and hold time, and can ensure accurate sampling of subsequent received data;
[0036] B2: After finding the serial port start bit, sample and receive 8 valid data bits and store them temporarily;
[0037] B3: The logic chip samples the 9th data bit for judgment. As mentioned above, this embodiment has no parity bit but 1 end bit. If the 9th data bit is at a high level, it means that this bit is the end bit; if the 9th data bit is at a low level, it means that the low level sampled by the start bit is actually not the start bit but a data bit, and the start bit needs to be re-detected and delimited;
[0038] B4: After steps B1-3, valid data is obtained and a judgment test is performed. If it is shortcut key 1, the device serial port switches to the logic chip, and the logic chip analyzes the command input by the user. If the command is valid, the status information is output;
[0039] B5: After the device serial port is switched to the logic chip, the following method is used to determine whether the user input command is valid: Step B1-3 is still used to receive the user input command characters. Every time a valid character is received, this character is sent to the device serial port and echoed to the user input interface to facilitate the user to check whether there is any input error. At the same time, the received valid characters are stored inside the logic for subsequent judgment.
[0040] After the user has collected the required information, the device serial port can be switched back to the CPU serial port by using shortcut key 2. The serial port receiving detection method is the same as step B1-3 and will not be repeated.
[0041] In this implementation, the logic parses data according to the serial port protocol and responds to user commands specifically according to the serial port baud rate of 9600, no parity check, and 1 end bit.
[0042] When the received character is a carriage return 0D, it means that the user has completed the command input. The valid characters received in the order of reception in the logic are compared according to the agreed rules. If it is a valid command, the register information that the user wants to obtain is output according to the command, and the line feed (0A) + carriage return (0D) + query result (xx) are output to the device serial port in sequence. If it is not a valid command, the stored received data is cleared, and a line feed (0A) + carriage return (0D) + "Wrong CMD" is output to the device serial port to prompt the user that the input is wrong. Considering the problem of logic resource occupation, the number of command words in the agreed rule should not be too many. If the user maliciously enters a long string, the logic will only receive and not store after receiving and storing the number of command words in the agreed rule. If the user inputs incorrectly and wants to delete it with backsapce, it is not supported in this implementation. This implementation adopts the "r cpld 0xAA" command line format. This command line represents reading the CPLD logic register 0xAA address, and r represents read; "w cpld 0xAA0xBB" is used to represent writing the CPLD logic register 0xAA address value to 0xBB.
[0043] The present invention provides an effective means for collecting device status information when a device crashes during network operation, which is of great help for problem location analysis. Theoretically, all signals connected to the logic chip can be obtained in this way, such as power supply status: whether it is in place, whether there is an alarm, power supply voltage, power supply temperature, power supply fan status, etc., fan status: whether it is in place, whether it is abnormal, fan speed value, etc., ambient temperature and hot spot temperature, reset and control signal status, watchdog status, etc. A method for obtaining device status information after a device crashes in the present invention can also collect device status information when the device crashes for a CPU that cannot respond to interrupts normally and can perform memory or non-volatile memory write operations.
[0044] In addition to the above preferred embodiments, the present invention has other implementation modes. Those skilled in the art may make various changes and modifications based on the present invention. As long as they do not depart from the spirit of the present invention, they should all fall within the scope defined by the claims attached to the present invention.
Claims
1. The equipment system is operated on the network, characterized in that: include: A CPU, a logic chip and a device serial port, wherein the logic chip comprises a device serial port data information sending end, a device serial port data information receiving end, a CPU data information sending end, a CPU data information receiving end, a serial port information processing unit and a switching switch. After receiving the data information, the device serial port sends the data information to the device serial port data information receiving end of the logic chip. After receiving the data information, the logic chip sends the data information to the CPU through the CPU data information sending end. The CPU sends the data information to the CPU data information receiving end of the logic chip. After receiving the data information, the logic chip sends the data information to the device serial port through the switching switch and through the device serial port data information sending end. The input end of the serial port information processing unit is connected to the device serial port data information receiving end. The output end of the serial port information processing unit is connected to the device serial port data information receiving end. The output end is connected in series with the switching switch and then connected to the device serial port data information sending end. The switching switch is used to switch the on and off of the data line from the CPU data information receiving end to the device serial port data information sending end and the on and off of the data line from the serial port data information sending end to the device serial port data information sending end. The serial port information processing unit is used to determine whether the device is in a dead state. When the device is not in a dead state, the data line from the CPU data information receiving end to the device serial port data information sending end is connected. When the device is determined to be in a dead state, the serial port information processing unit controls the switching switch to disconnect the data line from the CPU data information receiving end to the device serial port data information sending end, and connect the data line from the serial port data information sending end to the device serial port data information sending end, so as to realize the collection of device status information through the logic chip.
2. A method for obtaining device status information after a device crashes, the method being applied to the network-operated device system as claimed in claim 1, characterized in that: The equipment running on the network has a device serial port. The device serial port is the serial port of the CPU provided to the device through the logic chip and then through the level conversion device and the protection device. After the device is powered on, the logic chip will always be in working state. The working logic of the logic chip is realized by programming language Verilog or VHDL coding. When the device is working normally, the logic chip interconnects the device serial port with the CPU serial port to realize normal serial port function; when the device freezes, the device serial port is switched to the logic chip through a shortcut key to realize the collection of device status information.
3. The method for obtaining device status information after a device crashes as claimed in claim 2, characterized in that: The logic chip is constantly analyzing the signal while sending the signal input from the device serial port to the CPU. It analyzes each received byte according to the serial port protocol and baud rate for the next step of judgment and processing. The shortcut key 1 corresponds to hexadecimal 0C. If the logic chip detects 0C, it means that the shortcut key 1 is pressed, and the device serial port is switched to the logic chip. After switching to the logic chip, the logic chip will respond as follows: analyze the byte corresponding to the device serial port input signal, and send back all bytes except the enter key byte to the device serial port output for the serial terminal software to echo the command input by the user; if the enter key byte is detected, it means that the command input is completed, and it is parsed according to the agreed command format, and "line feed + enter + device status information corresponding to the user input command" is output to the device serial port in sequence for the user to view.
4. The method for obtaining device status information after a device crashes as claimed in claim 2 or 3, characterized in that: Define shortcut key 2 for switching back to the CPU serial port.
