Fault recording and broadcasting method and device and computer equipment

By using the fault recording method in the protection board, power operation data is collected and processed, snapshot frames and exception logs are generated, and the problem of large memory usage and unstable operation when saving data in real time of the protection board is solved, achieving efficient fault location and user experience improvement.

CN119689316APending Publication Date: 2025-03-25SUZHOU JK ENERGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998074.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the new energy industry, due to limited storage devices, the protection board saves a large amount of power supply in real time, the memory occupies a large amount of operation data, is unstable and inefficient, making it difficult to effectively locate the cause of the failure.

Method used

The fault recording and broadcasting method is adopted to collect the operating data of the power supply device according to the preset acquisition cycle, generate snapshot frames, and after detecting an abnormal event, determine the target time, obtain the target snapshot frames associated with the target time, generate exception logs, reduce memory usage, and improve system real-time and stability.

Benefits of technology

It realizes fault recording with small memory footprint, stable operation and efficient operation, and can effectively locate power failures and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119689316A_ABST
    Figure CN119689316A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a fault recording and broadcasting method and device and computer equipment, and the fault recording and broadcasting method comprises the steps: collecting the operation data of a power supply device according to a preset collection period, and generating a snapshot frame based on the operation data; after the abnormal event of the power supply device is detected, determining target time corresponding to the abnormal event; and obtaining a target snapshot frame associated with the target time from the snapshot frames, and generating an abnormal log book according to the target snapshot frame. According to the invention, the memory occupation of the fault recording and broadcasting function can be reduced, and the real-time performance and stability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a fault recording and broadcasting method, device and computer equipment. Background Art

[0002] In the new energy industry, the application scenarios of mobile power supplies and household energy storage power supplies are gradually increasing, and users are putting forward higher and higher requirements on the functions and user experience of the equipment. This often leads to extremely complex strategies for protection board programs, which increases the difficulty of analyzing on-site problems. Among them, the protection board is a key component used to ensure the safe and reliable operation of the battery. Its main functions include preventing dangerous situations such as overcharging, over-discharging, overcurrent, and short circuit.

[0003] When a power failure occurs, a large amount of data is often required as support to locate the cause of the on-site failure. However, due to the limited storage devices carried by the protection board itself, it is often unrealistic to save a large amount of operating data in real time. Therefore, there is an urgent need for a protection board strategy with small memory usage, stable operation and high efficiency. Summary of the invention

[0004] In view of this, the present invention provides a fault recording method, device and computer equipment to solve the problem of large memory usage, unstable operation and low efficiency in real-time storage of operation data of a large number of power supplies.

[0005] In a first aspect, the present invention provides a fault recording method, the method comprising:

[0006] Collecting operation data of the power supply device according to a preset collection period, and generating a snapshot frame based on the operation data;

[0007] After detecting an abnormal event in the power supply device, determining a target time corresponding to the abnormal event;

[0008] A target snapshot frame associated with a target time is obtained in the snapshot frame, and an exception log is generated according to the target snapshot.

[0009] In an optional implementation, collecting the operation data of the power supply device according to a preset collection cycle includes:

[0010] Get preset monitoring items;

[0011] According to the preset collection cycle, the operation data of the power supply device matching the preset monitoring items during operation are collected.

[0012] In an embodiment of the present invention, preset monitoring items can be set in advance, and operating data of the power supply device that matches the preset monitoring items during operation can be collected according to a preset collection cycle, thereby eliminating the need to collect all operating data, further reducing the memory requirements for fault recording.

[0013] In an optional implementation, generating a data snapshot based on the operating data includes:

[0014] The snapshot frame template is filled based on the operating data to obtain the snapshot frame corresponding to the collection period of the operating data.

[0015] In an embodiment of the present invention, a snapshot frame template can be set in advance, and the snapshot frame template can be filled according to the running data to obtain a snapshot frame, thereby using the same snapshot frame format to reduce the accuracy of abnormal analysis based on the snapshot frame corresponding to the abnormal event, while improving the confidence of the obtained analysis result.

[0016] In an optional implementation, acquiring a target snapshot frame associated with a target time in a snapshot frame includes:

[0017] Determine the start time corresponding to the abnormal event based on the target time;

[0018] A time interval corresponding to the start time is determined based on a preset duration, and a snapshot frame within the time interval is determined as a target snapshot frame.

[0019] In the embodiment of the present invention, the time interval corresponding to the start time of the abnormal event can be determined based on the preset duration, so as to read the matching target snapshot frame in the pipeline area based on the time interval, thereby achieving stable fault recording and broadcasting.

[0020] In an optional implementation, determining the time interval corresponding to the start time based on the preset duration includes:

[0021] Determine the historical duration before the start time and the abnormal duration after the start time based on the preset duration;

[0022] Determine the time interval based on the historical duration and abnormal duration.

[0023] In the embodiment of the present invention, the time interval corresponding to the start time of the abnormal event can be determined based on the preset duration, so as to read the matching target snapshot frame in the pipeline area based on the time interval, thereby achieving stable fault recording and broadcasting.

[0024] In the embodiment of the present invention, the time interval corresponding to the start time of the abnormal event can be determined based on the preset duration, so as to read the matching target snapshot frame in the pipeline area based on the time interval, thereby achieving stable fault recording and broadcasting.

[0025] In an optional implementation, determining the snapshot frame within the time interval as the target snapshot frame includes:

[0026] Get the target frame number;

[0027] The target snapshot frames within the historical duration are acquired, and the target snapshot frames within the abnormal duration are collected in real time until the total number of target snapshot frames reaches the target number of frames.

[0028] In an embodiment of the present invention, the number of target snapshot frames collected can be monitored in real time until the total number of target snapshot frames reaches the target number of frames, thereby ensuring that the storage volume occupied by the exception log finally generated is consistent, and avoiding exception log storage failure while controlling memory usage.

[0029] In an embodiment of the present invention, the number of target snapshot frames collected can be monitored in real time until the total number of target snapshot frames reaches the target number of frames, thereby ensuring that the storage volume occupied by the exception log finally generated is consistent, and avoiding exception log storage failure while controlling memory usage.

[0030] In an optional embodiment, the method further includes:

[0031] The snapshot frames are saved to random access memory or flash memory, and the exception logs are saved to flash memory.

[0032] In the embodiment of the present invention, when setting the pipeline area, the pipeline area can be preferably set in the random access memory. If the storage space in the random access memory is small, the pipeline area can be set in the flash memory. It should be understood that since the snapshot frames in the pipeline area need to be frequently read and written, and the flash memory often has a certain erase life, if the pipeline area is set in the flash memory, a larger storage space is required for wear balance. In addition, considering that the flash memory is a non-volatile storage device that can retain the data stored therein after power failure, the fault area can be set in the flash memory.

[0033] In an optional embodiment, the method further includes:

[0034] After receiving the acquisition instruction sent by the server, determine the target log that matches the acquisition instruction in the exception log;

[0035] In response to the acquisition instruction, the target log is returned to the server, so that the server parses the target log to obtain an abnormality assessment result.

[0036] In an embodiment of the present invention, the target log can be returned to the server in response to the acquisition instruction, so that the server can parse the target log and obtain an abnormal evaluation result. Here, after determining the above abnormal evaluation result, the abnormal evaluation result can be fed back to the device user to improve the user's experience.

[0037] In a second aspect, the present invention provides a fault recording and broadcasting device, the device comprising:

[0038] A generating module, used for collecting the operation data of the power supply device according to a preset collection period, and generating a snapshot frame based on the operation data;

[0039] A determination module, used to determine a target time corresponding to an abnormal event after detecting that an abnormal event occurs in the power supply device;

[0040] The acquisition module is used to acquire a target snapshot frame associated with a target time in the snapshot frame, and generate an exception log according to the target snapshot.

[0041] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the fault recording method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0042] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the fault recording method of the first aspect or any corresponding embodiment thereof.

[0043] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the fault recording method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 is a flowchart of a fault recording and broadcasting method according to an embodiment of the present invention;

[0046] Figure 2 is a flow chart of another fault recording and broadcasting method according to an embodiment of the present invention;

[0047] Figure 3 is a flowchart of another fault recording and broadcasting method according to an embodiment of the present invention;

[0048] Figure 4 is a schematic diagram of reading a target snapshot frame according to an embodiment of the present invention

[0049] Figure 5 is a schematic diagram of another method for reading a target snapshot frame according to an embodiment of the present invention

[0050] Figure 6 is a flowchart of another fault recording and broadcasting method according to an embodiment of the present invention;

[0051] Figure 7 is a structural block diagram of a fault recording and broadcasting device according to an embodiment of the present invention;

[0052] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0054] In combination with the application scenarios on which the execution of the fault recording and broadcasting method depends, the application scenarios are described here.

[0055] In the new energy industry, the application scenarios of mobile power supplies and household energy storage power supplies are gradually increasing, and users are putting forward higher and higher requirements on the functions and user experience of the equipment. This often leads to extremely complex strategies for protection board programs, which increases the difficulty of analyzing on-site problems. Among them, the protection board is a key component used to ensure the safe and reliable operation of the battery. Its main functions include preventing dangerous situations such as overcharging, over-discharging, overcurrent, and short circuit.

[0056] When a power failure occurs, a large amount of data is often required as support to locate the cause of the on-site failure. However, due to the limited storage devices carried by the protection board itself, it is often unrealistic to save a large amount of operating data in real time. Therefore, there is an urgent need for a protection board strategy with small memory usage, stable operation and high efficiency.

[0057] In the relevant protection board program, a fault recording function can be added to save the operation logs for a period of time before and after the fault occurs, and the logs of normal operation of the equipment are not saved. However, in embedded systems, due to higher requirements for real-time and stability, the fault recording function needs to occupy less memory, and the efficiency of saving and transmitting log information needs to be higher.

[0058] Based on this, an embodiment of the present invention provides a fault recording method, which can first collect the operating data of the power supply device according to a preset collection cycle, and generate a snapshot frame based on the operating data. Next, after detecting that an abnormal event occurs in the power supply device, the target time corresponding to the abnormal event can be determined. Then, a target snapshot frame associated with the target time is obtained in the snapshot frame, and an abnormal log is generated according to the target snapshot, thereby reducing the memory usage of the fault recording function and improving the real-time performance and stability of the system.

[0059] According to an embodiment of the present invention, an embodiment of a fault recording method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0060] In this embodiment, a fault recording method is provided, which can be used for devices including embedded systems, such as smart home appliances, medical equipment, communication equipment, etc. Figure 1 is a flow chart of a fault recording and broadcasting method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0061] Step S101 : collecting operating data of a power supply device according to a preset collection cycle, and generating a snapshot frame based on the operating data.

[0062] In an embodiment of the present invention, the power supply device may be a device including the device functions of an embedded system. The operation data may be a series of key parameters of the power supply device during operation, which reflect the performance and stability of the power supply, such as input voltage and current, output voltage and current, conversion efficiency, actual power, etc. The snapshot frame is used to record the operation data of each acquisition time node to record the current operation status of the power supply device. For example, if the preset acquisition period is 1s, a snapshot frame of the operation data corresponding to a frame of the power supply device may be generated every 1 second.

[0063] Specifically, the preset collection period can be set according to actual business needs. For example, in actual usage scenarios, if the data iteration frequency of the device is fast and higher stability requirements are required, the preset collection period can be set shorter, such as 1 second; if the data iteration frequency of the device is slow and the operation is more stable, the preset collection period can be set longer, such as 15 seconds.

[0064] Step S102, after detecting that an abnormal event occurs in the power supply device, determining a target time corresponding to the abnormal event.

[0065] In the embodiment of the present invention, the abnormal event may be a power failure pre-written in the embedded system, such as power overvoltage, power undervoltage, etc. It should be understood that the abnormal event may be perceptible or imperceptible, wherein a perceptible abnormal event may cause the device to have a fault that can be perceived by the user, and an imperceptible abnormal event may cause the device to have a fault that is not perceived by the user. The target time may be the period of time when the abnormal event occurs.

[0066] During the operation of the equipment, the embedded system can detect faults occurring in the power supply device in real time, and then match the fault parameters with the preset fault parameters to obtain a fault that matches the preset abnormal event, and record the target time when the fault is detected.

[0067] Step S103: acquiring a target snapshot frame associated with a target time in the snapshot frame, and generating an abnormality log according to the target snapshot.

[0068] In the embodiment of the present invention, the target snapshot frame may be a snapshot frame within 1 minute before and after the target time, and the abnormal log may be a fault log including the target snapshot frame.

[0069] Here, a pipeline area and a fault area may be respectively set in the memory of the embedded system, wherein the pipeline area is used to store snapshot frames generated in the embedded system, and the fault area is used to store fault logs generated by target snapshot frames.

[0070] It should be understood that the pipeline area can be a circular queue, which periodically saves the system status in units of snapshots. The saving period can be freely set, and when it is full, it returns to the head of the queue for overwriting and saving. Similarly, the fault area can also be a circular queue, which saves data in units of abnormal events, wherein the storage areas of the abnormal logs corresponding to each abnormal event are independent of each other and do not overlap, so as to improve the accuracy of the abnormal logs obtained by the host computer, thereby improving the accuracy of the determined abnormal causes.

[0071] It can be seen from the above description that in an embodiment of the present invention, first, the operation data of the power supply device can be collected according to a preset collection cycle, and a snapshot frame can be generated based on the operation data. Next, after detecting that an abnormal event has occurred in the power supply device, the target time corresponding to the abnormal event can be determined. Then, a target snapshot frame associated with the target time is obtained in the snapshot frame, and an abnormal log is generated according to the target snapshot, thereby reducing the memory usage of the fault recording function and improving the real-time performance and stability of the system.

[0072] In this embodiment, another fault recording method is provided, which can be used for devices including embedded systems, such as smart home appliances, medical equipment, communication equipment, etc. Figure 2 FIG. 1 is a flow chart of another fault recording and broadcasting method according to an embodiment of the present invention. Figure 2As shown, the process includes the following steps:

[0073] Step S201 : collecting operating data of the power supply device according to a preset collection cycle, and generating a snapshot frame based on the operating data.

[0074] Specifically, the above step S201 includes:

[0075] Step S2011, obtaining preset monitoring items.

[0076] Step S2012: collecting operation data of the power supply device that matches the preset monitoring items during operation according to the preset collection cycle.

[0077] In an embodiment of the present invention, associated preset monitoring items can be set according to the battery type and the type of preset abnormal event, wherein the preset monitoring items may include time, HVB (Highest Voltage of Battery Cells), HVP (Highest Temperature Point), current, SOC (State of Charge), SOH (State of Health), highest fault level, fault byte, Mos (Metal-Oxide-Semiconductor State), highest cell, lowest cell, average cell, highest temperature, lowest temperature, etc.

[0078] Specifically, time is used to indicate the specific time node for collecting the current operation data, HVB represents the highest voltage of the battery pack, which usually refers to the maximum value of the voltage of all single cells in the battery pack, HVP represents the highest temperature point of the battery pack, that is, the temperature of the point with the highest temperature in the battery pack, current is used to indicate the current when collecting the current operation data, SOC means battery state of charge, which is used to indicate the ratio of the current remaining charge of the battery to the rated charge, and is often used to reflect the remaining capacity of the battery, SOH means battery health status, which is used to reflect the current health status or performance level of the battery, including factors such as battery aging degree and internal resistance change, fault byte can be used to indicate the type of fault occurring in the current operation data, the highest fault level can be used to indicate the highest level of fault occurring in the operation data, MOS state usually refers to the state of the power tube, such as whether it is in the on (ON) or off (OFF) state, the highest single cell, the lowest single cell and the average single cell are used to indicate the highest value, the lowest value and the average value of the voltage or temperature of all single cells in the battery pack, the highest temperature and the lowest temperature. The highest temperature is used to indicate the highest temperature and the lowest temperature of the power supply device when collecting the current operation data.

[0079] Step S202: after detecting that an abnormal event has occurred in the power supply device, determine the target time corresponding to the abnormal event. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0080] Step S203: Obtain a target snapshot frame associated with the target time in the snapshot frame, and generate an exception log according to the target snapshot. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0081] In an embodiment of the present invention, preset monitoring items can be set in advance, and operating data of the power supply device that matches the preset monitoring items during operation can be collected according to a preset collection cycle, thereby eliminating the need to collect all operating data, further reducing the memory requirements for fault recording.

[0082] In some optional implementations, the above step S101, generating a data snapshot based on the operating data, includes:

[0083] The snapshot frame template is filled based on the operating data to obtain the snapshot frame corresponding to the collection period of the operating data.

[0084] In the embodiment of the present invention, the snapshot frame template may include the above preset monitoring items. When setting the snapshot template frame, the number and byte number corresponding to each preset monitoring item may be set, and the total byte number of the snapshot frame may be set.

[0085] For example, the numbers corresponding to the preset monitoring items may include 1-22, and the preset monitoring items include: time, HVB, HVP, current, SOC, SOH, highest fault level, fault byte 1, fault byte 2, fault byte 3, fault byte 4, Mos state, highest cell, lowest cell, average cell, highest temperature, lowest temperature. In addition, numbers 18-21 may be reserved items for adding preset monitoring items.

[0086] In addition, the total number of bytes of the snapshot frame can be set to 32 bytes. In the preset monitoring items, the number of bytes corresponding to time can be 6, the number of bytes corresponding to HVB can be 2, the number of bytes corresponding to HVP can be 2, the number of bytes corresponding to current can be 2, the number of bytes corresponding to HVP can be 2, the number of bytes corresponding to SOC can be 2, the number of bytes corresponding to HVP can be 1, the number of bytes corresponding to SOH can be 1, the number of bytes corresponding to HVP can be 2, the number of bytes corresponding to the highest fault level can be 1, the number of bytes corresponding to fault byte 1 can be 1, the number of bytes corresponding to fault byte 2 can be 1, the number of bytes corresponding to fault byte 3 can be 1, the number of bytes corresponding to fault byte 4 can be 1, the number of bytes corresponding to Mos state can be 1, the number of bytes corresponding to the highest monomer can be 2, the number of bytes corresponding to the lowest monomer can be 2, the number of bytes corresponding to the average monomer can be 2, the number of bytes corresponding to the highest temperature can be 1, the number of bytes corresponding to the lowest temperature can be 1, and the number of bytes corresponding to the reserved items can be 1.

[0087] In an embodiment of the present invention, a snapshot frame template can be set in advance, and the snapshot frame template can be filled according to the running data to obtain a snapshot frame, thereby using the same snapshot frame format to reduce the accuracy of abnormal analysis based on the snapshot frame corresponding to the abnormal event, while improving the confidence of the obtained analysis result.

[0088] In this embodiment, another fault recording method is provided, which can be used for devices including embedded systems, such as smart home appliances, medical equipment, communication equipment, etc. Figure 3 FIG. 1 is a flowchart of another fault recording and broadcasting method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0089] Step S301, collect the operation data of the power supply device according to the preset collection cycle, and generate a snapshot frame based on the operation data. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0090] Step S302: after detecting that an abnormal event has occurred in the power supply device, determine the target time corresponding to the abnormal event. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0091] Step S303: acquiring a target snapshot frame associated with a target time in the snapshot frame, and generating an abnormality log according to the target snapshot.

[0092] Specifically, the above step S303 includes:

[0093] Step S3031, determining the start time corresponding to the abnormal event based on the target time.

[0094] Step S3032: determining a time interval corresponding to the start time based on a preset duration, and determining a snapshot frame within the time interval as a target snapshot frame.

[0095] In the embodiment of the present invention, considering that the abnormal event of the power supply device can be continuous, for example, for ten minutes, the target time can be the start time when the abnormal event occurs. The time interval can include a preset time length before the start time and a preset time length after the start time, that is, the time interval is fixed to two preset time lengths.

[0096] Specifically, the above step S2032, determining the time interval corresponding to the start time based on the preset duration, includes:

[0097] Step a1, determining the historical duration before the start time and the abnormal duration after the start time based on the preset duration.

[0098] Step a2, determining the time interval according to the historical duration and the abnormal duration.

[0099] In the embodiment of the present invention, generally speaking, the historical duration before the start time and the abnormal duration after the start time are both preset durations. However, when the historical duration does not meet the preset duration, the abnormal duration needs to be recalculated based on the preset duration.

[0100] For example, if the preset duration is 1 minute, and the start time of the abnormal event is 30 seconds after power-on, then the historical duration can be determined as 30 seconds, and the duration that does not meet the preset duration can be added to the abnormal duration, that is, the abnormal duration can be 1 minute and 30 seconds.

[0101] After determining the time interval, the target snapshot frame can be located in the pipeline area based on the time interval. Specifically, the target snapshot frame within the historical duration can be directly read in the pipeline area, and the target snapshot frame within the abnormal duration can be read in real time in the pipeline area.

[0102] Here, if Figure 4 The figure shows a schematic diagram of reading a target snapshot frame, wherein the time intervals corresponding to abnormal event 1 and abnormal event 2 do not overlap, and therefore, the target snapshot frame collection 1 corresponding to abnormal event 1 and the target snapshot frame collection 2 corresponding to abnormal event 2 do not overlap.

[0103] After obtaining the target snapshot frame collection 1 and the target snapshot frame collection 2, an abnormal log 1 corresponding to abnormal event 1 can be generated based on the target snapshot frame collection 1, and an abnormal log 2 corresponding to abnormal event 2 can be generated based on the target snapshot frame collection 2. Then, the abnormal log 1 and the abnormal log 2 can be stored in the fault area respectively.

[0104] In addition, such as Figure 5Another schematic diagram of reading target snapshot frames is shown, in which the time intervals corresponding to abnormal event 1 and abnormal event 2 overlap, that is, the time interval between abnormal event 1 and abnormal event 2 does not exceed the preset time length. Here, target snapshot frame collection 1 corresponding to abnormal event 1 and target snapshot frame collection 2 corresponding to abnormal event 2 can be obtained respectively, in which some snapshot frames overlap between target snapshot frame collection 1 and target snapshot frame collection 2.

[0105] After obtaining the target snapshot frame collection 1 and the target snapshot frame collection 2, an abnormal log 1 corresponding to abnormal event 1 can be generated based on the target snapshot frame collection 1, and an abnormal log 2 corresponding to abnormal event 2 can be generated based on the target snapshot frame collection 2. Then, the abnormal log 1 and the abnormal log 2 can be stored in the fault area respectively.

[0106] In the embodiment of the present invention, the time interval corresponding to the start time of the abnormal event can be determined based on the preset duration, so as to read the matching target snapshot frame in the pipeline area based on the time interval, thereby achieving stable fault recording and broadcasting.

[0107] In some optional implementations, the above step S2032, determining the snapshot frame within the time interval as the target snapshot frame, includes:

[0108] Step b1, obtaining the target frame number.

[0109] Step b2 obtains the target snapshot frames within the historical duration, and collects the target snapshot frames within the abnormal duration in real time until the total number of target snapshot frames reaches the target number of frames.

[0110] In an embodiment of the present invention, the target number of frames to be acquired within the above time interval can be calculated based on a preset acquisition cycle. For example, if the time interval is 2 minutes and the preset acquisition frequency is 1 second, the target number of frames can be the ratio between the time interval and the preset acquisition frequency, i.e., 120 frames.

[0111] Here, when the target snapshot frames within the abnormal time period are collected in real time, it can be monitored whether the total number of collected target snapshot frames reaches the target frame number, and when the target frame number is reached, all the collected target snapshot frames are determined as abnormal logs.

[0112] In an embodiment of the present invention, the number of target snapshot frames collected can be monitored in real time until the total number of target snapshot frames reaches the target number of frames, thereby ensuring that the storage volume occupied by the exception log finally generated is consistent, and avoiding exception log storage failure while controlling memory usage.

[0113] In some optional embodiments, the above Figure 1 The corresponding embodiments also include:

[0114] The snapshot frames are saved to random access memory or flash memory, and the exception logs are saved to flash memory.

[0115] As can be seen from the above, the snapshot frame can be stored in the pipeline area, and the abnormal log can be stored in the fault area. Specifically, the pipeline area can be set in the machine access memory RAM or flash memory flash, and the fault area can be set in flash. It should be understood that there is no overlap between the storage areas of the pipeline area and the fault area.

[0116] In the embodiment of the present invention, when setting the pipeline area, the pipeline area can be preferably set in the RAM. If the storage space in the RAM is small, the pipeline area can be set in the flash. It should be understood that since the snapshot frames in the pipeline area need to be frequently read and written, and the flash often has a certain erase life, if the pipeline area is set in the flash, a larger storage space is required for wear balance. In addition, considering that the flash is a non-volatile storage device that can retain the data stored therein after power failure, the fault area can be set in the flash.

[0117] In some optional embodiments, the above Figure 1 The corresponding embodiments also include:

[0118] Step S11, after receiving the acquisition instruction sent by the server, determine the target log matching the acquisition instruction in the abnormal log.

[0119] Step S12, in response to the acquisition instruction, returns the target log to the server, so that the server parses the target log to obtain an abnormality assessment result.

[0120] In an embodiment of the present invention, the server can be a host computer of the above device, which can collect data in the device to implement abnormal analysis of the power supply device. Here, the host computer can set an acquisition instruction based on the time period in which the abnormality needs to be analyzed to obtain the target log.

[0121] For example, an abnormality assessment period may be preset, and after the abnormality assessment period is reached, an acquisition instruction is generated to acquire a target log within the abnormality assessment period. For example, the abnormality assessment period may be one week.

[0122] For another example, when receiving device failure feedback from a device user, the failure period that needs to be analyzed can be determined based on the failure occurrence node reported by the user, and an acquisition instruction can be generated based on the failure period to obtain a target log containing the content of the failure period.

[0123] Here, after obtaining the target log, the server can analyze the target snapshot frame in the target log to obtain the abnormal cause of the abnormal event, and generate a corresponding abnormal evaluation result according to the abnormal cause.

[0124] Specifically, a target item matching the preset monitoring item corresponding to the abnormal event can be identified in the target snapshot frame. For example, when the abnormal event is power undervoltage, the target item can be a voltage-related item in the preset monitoring item. Then, a comprehensive consideration can be made based on the operating data corresponding to the target item in each frame of the target snapshot frame to obtain the cause of the abnormality.

[0125] In an embodiment of the present invention, the target log can be returned to the server in response to the acquisition instruction, so that the server can parse the target log and obtain an abnormal evaluation result. Here, after determining the above abnormal evaluation result, the abnormal evaluation result can be fed back to the device user to improve the user's experience.

[0126] In this embodiment, another fault recording method is provided, which can be used for devices including embedded systems, such as smart home appliances, medical equipment, communication equipment, etc. Figure 6 FIG. 1 is a flowchart of another fault recording and broadcasting method according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:

[0127] Step S601: Power on the device.

[0128] Step S602: Initialize the clock in the embedded system of the device.

[0129] Step S603: collecting operating data of the power supply device according to a preset collection period, and generating a snapshot frame based on the operating data.

[0130] Step S604, saving the snapshot frame to the pipeline area.

[0131] In the embodiment of the present invention, the pipeline area can be set in the above-mentioned random access memory or flash memory.

[0132] Step S605, determining whether the time without clock synchronization reaches 24 hours, if so, executing step S606, if not, executing step S603.

[0133] Step S606: perform a clock synchronization.

[0134] In the embodiment of the present invention, the clock is the RTC (Real-Time Clock) in the embedded system. Considering that the accuracy of the RTC clock is not high, it usually shifts by several seconds every 24 hours. Therefore, the RTC clock can be synchronized once every 24 hours to keep the RTC in the embedded system consistent with the above-mentioned server.

[0135] Step S607, reading the parameter area.

[0136] In the embodiment of the present invention, the parameter area may be a parameter of the fault area, which may include a flag bit 0×2233, the number of snapshot frames saved by each faulty sector, the total number of snapshot frames, the sector number of the target snapshot frame currently written, and the number of the target snapshot frame currently written. Here, if there is no flag bit 0×2233, the parameter may be initialized to 0.

[0137] Step S608, determining whether a serious fault occurs or the target snapshot frame acquisition is not completed, if so, executing step S610, if not, executing step S609.

[0138] Step S609: clear the count of the target snapshot frame.

[0139] Step S610, determining whether the number of target snapshot frames reaches the target frame number, if so, executing step S608, if not, executing step S611.

[0140] Step S611, copying the target snapshot frame within the historical duration to the fault area.

[0141] Step S612: based on the abnormal duration, a target snapshot frame is acquired according to a preset acquisition cycle.

[0142] Step S613, updating the parameter area.

[0143] In summary, in the embodiment of the present invention, the operation data of the power supply device can be first collected according to the preset collection cycle, and a snapshot frame can be generated based on the operation data. Next, after detecting that an abnormal event occurs in the power supply device, the target time corresponding to the abnormal event can be determined. Then, a target snapshot frame associated with the target time is obtained in the snapshot frame, and an abnormal log is generated according to the target snapshot, thereby reducing the memory usage of the fault recording function and improving the real-time performance and stability of the system.

[0144] In this embodiment, a fault recording and broadcasting device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0145] This embodiment provides a fault recording and broadcasting device, such as Figure 7 As shown, including:

[0146] A generating module 701, configured to collect operating data of the power supply device according to a preset collection cycle, and generate a snapshot frame based on the operating data;

[0147] A determination module 702 is used to determine a target time corresponding to the abnormal event after detecting that an abnormal event occurs in the power supply device;

[0148] The acquisition module 703 is used to acquire a target snapshot frame associated with a target time in the snapshot frame, and generate an abnormal log according to the target snapshot.

[0149] In some optional implementations, the generating module 701 is further used to:

[0150] Get preset monitoring items;

[0151] According to the preset collection cycle, the operation data of the power supply device matching the preset monitoring items during operation are collected.

[0152] In some optional implementations, the generating module 701 is further used to:

[0153] The snapshot frame template is filled based on the operating data to obtain the snapshot frame corresponding to the collection period of the operating data.

[0154] In some optional implementations, the acquisition module 703 is further used to:

[0155] Determine the start time corresponding to the abnormal event based on the target time;

[0156] A time interval corresponding to the start time is determined based on a preset duration, and a snapshot frame within the time interval is determined as a target snapshot frame.

[0157] In some optional implementations, the acquisition module 703 is further used to:

[0158] Determine the historical duration before the start time and the abnormal duration after the start time based on the preset duration;

[0159] Determine the time interval based on the historical duration and abnormal duration.

[0160] In some optional implementations, the acquisition module 703 is further used to:

[0161] Get the target frame number;

[0162] The target snapshot frames within the historical duration are acquired, and the target snapshot frames within the abnormal duration are collected in real time until the total number of target snapshot frames reaches the target number of frames.

[0163] In some optional embodiments, the device is also used for:

[0164] The snapshot frames are saved to random access memory or flash memory, and the exception logs are saved to flash memory.

[0165] In some optional embodiments, the device is also used for:

[0166] After receiving the acquisition instruction sent by the server, determine the target log that matches the acquisition instruction in the exception log;

[0167] In response to the acquisition instruction, the target log is returned to the server, so that the server parses the target log to obtain an abnormality assessment result.

[0168] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0169] The fault recording and broadcasting device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0170] The embodiment of the present invention also provides a computer device having the above Figure 7 The faulty recording and broadcasting device shown.

[0171] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.

[0172] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0173] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0174] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0175] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0176] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0177] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0178] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0179] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A fault recording method, characterized in that: The method comprises: Collecting operation data of the power supply device according to a preset collection period, and generating a snapshot frame based on the operation data; After detecting that an abnormal event occurs in the power supply device, determining a target time corresponding to the abnormal event; A target snapshot frame associated with the target time is acquired in the snapshot frame, and an exception log is generated according to the target snapshot.

2. The method according to claim 1, characterized in that The collecting of the operation data of the power supply device according to the preset collection cycle includes: Get preset monitoring items; According to the preset collection cycle, the operation data of the power supply device during operation that matches the preset monitoring items are collected.

3. The method according to claim 1, characterized in that The generating a data snapshot based on the operation data comprises: A snapshot frame template is filled based on the operation data to obtain a snapshot frame corresponding to a collection period of the operation data.

4. The method according to claim 1, characterized in that: The step of acquiring a target snapshot frame associated with the target time in the snapshot frame comprises: Determine a start time corresponding to the abnormal event based on the target time; A time interval corresponding to the start time is determined based on a preset duration, and a snapshot frame within the time interval is determined as the target snapshot frame.

5. The method according to claim 4, characterized in that The determining the time interval corresponding to the start time based on the preset duration includes: Determine the historical duration before the start time and the abnormal duration after the start time based on the preset duration; The time interval is determined according to the historical duration and the abnormal duration.

6. The method according to claim 5, characterized in that The step of determining the snapshot frame within the time interval as the target snapshot frame includes: Get the target frame number; The target snapshot frames within the historical duration are acquired, and the target snapshot frames within the abnormal duration are collected in real time until the total number of the target snapshot frames reaches the target number of frames.

7. The method according to claim 1, characterized in that The method further comprises: The snapshot frame is saved in a random access memory or a flash memory, and the abnormal log is saved in the flash memory.

8. The method according to claim 1, characterized in that The method further comprises: After receiving the acquisition instruction sent by the server, determining a target log matching the acquisition instruction in the abnormal log; In response to the acquisition instruction, the target log is returned to the server, so that the server parses the target log to obtain an abnormality assessment result.

9. A fault recording and broadcasting device, characterized in that: The device comprises: A generating module, used for collecting operating data of the power supply device according to a preset collecting cycle, and generating a snapshot frame based on the operating data; A determination module, configured to determine a target time corresponding to an abnormal event after detecting that an abnormal event occurs in the power supply device; The acquisition module is used to acquire a target snapshot frame associated with the target time in the snapshot frame, and generate an abnormal log according to the target snapshot.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the fault recording method according to any one of claims 1 to 8 by executing the computer instructions.