Intelligent instrument operation log monitoring method and device, equipment and medium
By configuring timers and storing event logs and timestamps in smart instruments, the problem of inaccurate recording of event time in the prior art is solved, and the fault diagnosis and maintenance efficiency is improved.
Patent Information
- Application Number
- CN202411521559.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-25
AI Technical Summary
Existing smart meters cannot accurately record the specific time of events, limiting the effectiveness of fault analysis and event tracking.
By configuring a timer inside the instrument, setting a fixed time interval counting mechanism, recording the time count value when the state changes occur as a timestamp, and storing the event log and timestamp in memory.
It realizes continuous monitoring of instrument operation status and accurate time recording of events, improving the efficiency and accuracy of fault diagnosis and maintenance work.
Smart Images

Figure CN119512859A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent technology, and in particular to a method, device, equipment and medium for monitoring operation logs of intelligent instruments. Background Art
[0002] As the level of automation in process industries continues to improve, the market demand for the functions of smart instruments has also increased. At present, the instruments widely used in industrial sites have integrated a variety of intelligent features, such as fault recording, intelligent display, diagnostic functions, multivariable detection and compensation, etc. These advanced functions not only improve the controllability of the production process, but also play an indispensable role in troubleshooting. However, although most of the existing smart instruments can detect and report various faults (including but not limited to software reset, alarm, etc.) and important events (such as parameter adjustment, user login records, etc.), they generally lack the ability to record the specific time when these events occur. This lack has limited the effectiveness of the instrument in practical applications to a certain extent, especially when accurate time reference is required for fault analysis or event tracking. Summary of the invention
[0003] In view of the above-mentioned shortcomings of the prior art, the present application provides a smart meter operation log monitoring method, device, equipment and medium to solve the above-mentioned technical problems.
[0004] The present application provides a method for monitoring the operation log of an intelligent instrument, the method comprising: configuring a counting mechanism with a fixed time interval based on an internal clock or timer of the instrument, so that after the startup initialization of the instrument is completed, the time count is increased each time the set time interval is reached; monitoring the input and output port status of the instrument, and if a state change is detected, recording it as an event, and generating an event log containing state information; recording the time count value when the state change occurs as a timestamp, and storing the event log and the timestamp in a first memory; and displaying the log record in the first memory on the display interface of the instrument.
[0005] In one embodiment of the present application, after the event log and timestamp are temporarily stored in the first memory, it also includes: performing a fault analysis on the events recorded in the first memory, the fault analysis at least including: checking whether the event conforms to a predefined fault mode, verifying whether the event exceeds a preset normal operating range, and evaluating whether the event causes instrument performance degradation or abnormality; if the analysis result shows that the event constitutes a fault, the event log and timestamp corresponding to the event constituting the fault are transferred and stored in the second memory.
[0006] In one embodiment of the present application, the method further includes: after the instrument experiences a power outage and restarts, restoring key parameters from the second memory and continuing to accumulate total operating time; the key parameters include at least the instrument's accumulated operating time, fault records, instrument configuration information, and user set values.
[0007] In one embodiment of the present application, the method also includes dividing events into fault events, function check events and other routine events; allocating an independent storage area for each type of event, and using a circular list structure to manage their respective storage spaces; in each independent storage area, the latest event record is inserted to the front of the list; when the storage capacity reaches the upper limit, the oldest event record is overwritten in a first-in-first-out manner.
[0008] In one embodiment of the present application, a circular list structure is used to manage storage space, including: creating a fixed-size buffer for storing the latest event records; when a new event is generated, adding the new event to the end of the buffer; if the buffer is full, removing the first element of the buffer and adding the new event record to the end of the buffer; tracking the latest event record position in the buffer through an index mechanism to ensure that new events are always stored in the latest position of the buffer; and adopting the first-in-first-out principle, when the storage capacity reaches the upper limit, overwriting the oldest event record to ensure that the latest events are stored first.
[0009] In one embodiment of the present application, the log records in the first memory are displayed on the display interface of the instrument, including: displaying the log records from the first memory in chronological order on the instrument display interface, wherein the log records at least contain data of fault events, function check events, and other important events; converting the total operating time of the instrument into a preset standard format, and presenting it to the user on the display interface.
[0010] The present application provides an intelligent instrument operation log monitoring device, the device comprising: a fixed time counting module, configured with a timer, for increasing the value of the counter at fixed time intervals after the instrument startup initialization is completed; a storage module, for storing event records and timestamps, and restoring key parameters after power failure and restart; an event recording module, for detecting state changes of the instrument input and output ports, and recording at least one group of events, and allowing a user to select different event types for recording; a circular list storage module, for cyclically storing the event records according to the first-in-first-out principle, ensuring that the latest events are stored first; a display processing module, for converting the value of the counter into a preset standard format time format, and displaying the log records in chronological order on the instrument display interface.
[0011] In one embodiment of the present application, the storage module includes a first storage module and a second storage module. The first storage module is used to temporarily store event records and their corresponding timestamps, and is implemented using a volatile storage medium; the second storage module is used to long-term store event records determined to be faults and their corresponding timestamps, and to restore key parameters after the instrument is powered off and restarted, and is implemented using a non-volatile storage medium.
[0012] The present application provides an electronic device, comprising a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the smart meter operation log monitoring method as described above.
[0013] The present application provides a computer-readable storage medium on which a computer program is stored. The computer program is used to enable a computer to execute the smart meter operation log monitoring method as described above.
[0014] Beneficial effects of the present application: The intelligent instrument operation log monitoring method in the present application, by using the clock or timer inside the instrument to set a fixed counting cycle, can automatically start time counting after the instrument startup initialization is completed, and update the count value every time the preset time interval is reached. This method ensures continuous monitoring of the instrument operation status. When the state of the input and output ports of the instrument is detected to have changed, the system will automatically record the change and generate an event log containing detailed status information. In addition, the system also records the time count value when the state change occurs as a timestamp, and stores it in the first memory of the instrument together with the event log, thereby providing the exact time of each event, making up for the deficiency of the inability to record the event time in the prior art. Finally, all stored log records can be intuitively presented through the display interface of the instrument, which is convenient for users or maintenance personnel to check at any time, greatly improving the efficiency and accuracy of fault diagnosis and maintenance work. In summary, the present application not only improves the intelligence level of the instrument, but also provides a more reliable basis for the use and maintenance of the instrument.
[0015] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0017] Figure 1It is a schematic diagram of an implementation environment of a smart meter operation log monitoring method shown in an exemplary embodiment of the present application;
[0018] Figure 2 is a flow chart of a method for monitoring operation logs of a smart meter shown in an exemplary embodiment of the present application;
[0019] Figure 3 It is a schematic diagram of the overall steps of a method for monitoring operation logs of a smart meter shown in an exemplary embodiment of the present application;
[0020] Figure 4 is a block diagram of a smart meter operation log monitoring device shown in an exemplary embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.
[0023] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0024] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0025] First of all, it should be noted that in the smart instrument operation log monitoring method proposed in this application, a real-time clock chip is not used. Instead, the internal clock or timer of the chip is used to realize the time management log function of the intelligent instrument, and the instrument operation time is used instead of the real-time time, and the event recording function is realized in a circular array manner.
[0026] Figure 1 It is a schematic diagram of an implementation environment of a smart meter operation log monitoring method shown in an exemplary embodiment of the present application.
[0027] like Figure 1 As shown, the implementation environment of the intelligent instrument operation log monitoring method includes a data acquisition module 101 and a computer device 102. Among them, the data acquisition module 101 is responsible for collecting the status data and environmental information of the instrument during operation. These data include but are not limited to the working status of the instrument, the state changes of the input and output ports, the temperature inside the instrument, the stability of the power supply voltage, the intensity of ambient light, etc. The working status information can be directly read from the sensor inside the instrument; the state changes of the input and output ports are obtained by monitoring the port activities; the environmental information such as the temperature and power supply voltage stability inside the instrument can be collected by built-in or external sensors; the ambient light intensity can be detected by photosensitive elements installed around the instrument. Therefore, the data acquisition module can be various sensors integrated in the instrument (such as temperature sensors, voltage detection circuits, photoresistors, etc.), or it can be an external monitoring device connected to the instrument by wire or wireless means. This application does not impose any restrictions on the specific implementation form of the data acquisition module.
[0028] In addition, the computer device 102 is used to process the data collected by the data acquisition module 101, specifically including: by acquiring and analyzing the current operating status and environmental information of the instrument in real time, an event log can be intelligently generated based on this information. Based on the current operating status and environmental information of the instrument, the computer device can record the time count value when the state change occurs as a timestamp, and generate a comprehensive event log in combination with the state information. Subsequently, these event logs are stored together with the timestamp in the first memory of the instrument, and corresponding display instructions are generated to ensure that the instrument can clearly display the log records on the display interface, thereby providing users or maintenance personnel with a comprehensive and detailed history of the instrument's operating status. Therefore, the computer device 102 can be a high-performance processor, a dedicated embedded computing platform, or a microcontroller integrated on the instrument, etc. This application also does not limit the specific type of computer equipment.
[0029] Figure 2 It is a flow chart of a method for monitoring operation logs of a smart meter shown in an exemplary embodiment of the present application.
[0030] like Figure 2 As shown, in an exemplary embodiment, the smart meter operation log monitoring method includes at least steps S210 to S240, which are described in detail as follows:
[0031] Step S210, configuring a counting mechanism of a fixed time interval based on the internal clock or timer of the meter, so that after the meter is started and initialized, the time count is increased every time the set time interval is reached.
[0032] In one embodiment of the present application, a clock or timer inside the meter is used as a time reference. If there are multiple clock sources inside the meter (such as RTC real-time clock, CPU clock, etc.), a clock with high precision and stability is selected as the basis for counting. A reasonable time interval is set according to the actual application scenario and requirements of the meter. Considering that the accuracy of the second level is usually not required, the time interval can be set to 1 minute at a time. Then, after the meter is started and initialized, a global variable TimeCount is initialized to record the time count. The variable should be of sufficient length to prevent overflow during the expected service life of the meter, and an interrupt service routine (ISR) or a timed task is written to ensure that every time the set time interval (such as 1 minute) is reached, an interrupt is performed and the operation of TimeCount++ is executed in the ISR or timed task to increase the count. In addition, considering the long-term operation of the meter, an overflow protection mechanism must be added to the design. A cyclic counter or a data type with a larger bit width can be used to extend the overflow time, or the counter is reset when overflowing and the number of resets is recorded.
[0033] In one embodiment, TimeCount will continue to increase throughout the life of the meter until it reaches the set maximum value. If a cyclic counter is used, then after the counter overflows, it will restart counting from zero. At this time, the total time can be tracked by recording the number of resets. When it is necessary to record the time when an event occurs, the current TimeCount value can be read as part of the timestamp and combined with other relevant information to generate an event log. The value of TimeCount is checked regularly and updated on the meter's display interface so that users or maintenance personnel can understand the operating status of the meter at any time.
[0034] It can be understood that according to the solution proposed in this embodiment, a fixed time interval counting mechanism based on the internal clock or timer configuration of the instrument can be effectively implemented to ensure that the instrument can accurately record the time after startup and use it for subsequent logging and status monitoring.
[0035] Step S220, monitoring the input and output port status of the instrument, if a status change is detected, it is recorded as an event, and an event log containing status information is generated.
[0036] In one embodiment of the present application, according to the functional planning of the instrument, all relevant events that the instrument can detect are defined. These events should be possible for the instrument to occur in normal operation or abnormal state, such as alarm, warning, parameter modification, etc. Taking into account the needs of actual operation, the events are further defined in pairs. For example, if an upper limit alarm event is defined, an event for canceling the upper limit alarm should also be defined. This can ensure the integrity and symmetry of the log record, which is convenient for subsequent analysis and troubleshooting. Then, a monitoring logic is implemented in the software of the instrument to regularly check the status of the input and output ports. The inspection method can use a polling method to regularly query the port status, or set a port status change interrupt to respond to the state change in real time. Specifically, the port status detected by the current query or interrupt is compared with the state of the last record to detect whether there is a state change. If it is detected that the port state has changed, the state change is recorded as an event, and the content of the record should include the type of event, state information, and occurrence time (i.e., the current value of the time counter).
[0037] In addition, a standard log format needs to be defined to ensure that all recorded events follow the same format for unified processing. The log format should at least contain event identifiers, status information, time, and possible other auxiliary information. When a state change is detected and recorded as an event, a log entry containing the above information is generated, and the generated event log entry is stored in the first memory of the instrument. The log records can be managed using a file system, or directly stored in memory and periodically persisted to non-volatile memory through some mechanism. In addition, for events that appear in pairs, the position of its paired event should be reserved or marked while recording an event, and completed when the paired event occurs. For example, when recording an upper limit alarm, the position information of canceling the upper limit alarm is retained until the latter occurs.
[0038] It can be understood that according to the scheme proposed in this embodiment, the input and output port status of the instrument can be effectively monitored, and when a status change is detected, it can be recorded as an event, and an event log containing status information is generated, thereby helping users or maintenance personnel to better understand and analyze the operating status of the instrument.
[0039] Step S230, recording the time count value when the state change occurs as a timestamp, and storing the event log and the timestamp in a first memory.
[0040] In one embodiment of the present application, before storing the event log and the timestamp in the first memory, it also includes: dividing the events into fault events, function check events and other routine events; allocating independent storage areas for each type of event, and using a circular list structure to manage the respective storage spaces; in each independent storage area, the latest event record is inserted at the front of the list; when the storage capacity reaches the upper limit, the oldest event record is overwritten in a first-in-first-out manner. Wherein, using a circular list structure to manage storage space includes: creating a fixed-size buffer for storing the latest event records; when a new event is generated, adding the new event to the end of the buffer; if the buffer is full, removing the first element of the buffer and adding the new event record to the end of the buffer; tracking the latest event record position in the buffer through an index mechanism to ensure that new events are always stored in the latest position of the buffer; and using the first-in-first-out principle, when the storage capacity reaches the upper limit, overwriting the oldest event record to ensure that the latest event is stored first.
[0041] In one embodiment of the present application, the events in the log are first divided into three categories: fault-related events, function check-related events, and other routine events, and the user, after-sales, and technical personnel are allowed to select trigger records of different event types in the local settings according to their respective focuses, and display the corresponding time and event type code. Then, an independent storage area is allocated for each type of event, and a circular list structure is used to manage the respective storage spaces.
[0042] Specifically: create a fixed-size buffer for each type of event to store the latest event records. For example, assuming that the upper limit of the loop count is 5, create a buffer of size 5 for each type of event. When a new event is generated, add the new event to the end of the buffer of the corresponding type. If the buffer is full, remove the first element of the buffer (that is, the oldest event record) and add the new event record to the end of the buffer. In addition, the position of the latest event record in the buffer is tracked through an index mechanism to ensure that new events are always stored in the latest position of the buffer. When the storage capacity reaches the upper limit, the oldest event record is overwritten in a first-in-first-out manner to ensure that the latest events are stored first.
[0043] According to the aforementioned classified storage space, in each independent storage area, the latest event record is inserted at the front of the list. For example, assuming that the upper limit of the loop count is 5, initially, the following are recorded in chronological order: event 1-event 2-event 3-event 4-event 5. When subsequent events 6 and 7 are triggered, according to the first-in-first-out principle, the earliest recorded event in the event list is directly overwritten, and the record is: event 6-event 7-event 3-event 4-event 5. It should be noted that through the circular list structure, even when the storage space is limited, the latest and most important event records can be retained, while ensuring the effective use of the storage space.
[0044] In addition, the specific implementation process also includes initialization, event processing and time retrieval. Specifically, initialization means creating a corresponding fixed-size buffer for each type of event and setting the corresponding index when the system is initialized. Event processing means recording the event in the corresponding buffer according to the event type when an event is detected, and updating the index to point to the latest record location. Event retrieval means quickly locating and reading the latest event record according to the index when the event record needs to be retrieved.
[0045] It can be understood that according to the solution proposed in this embodiment, the limited storage space inside the meter can be effectively managed and utilized, ensuring that important event information is retained and convenient for users or maintenance personnel to view and analyze.
[0046] In one embodiment of the present application, after temporarily storing the event log and timestamp in the first memory, it also includes: performing a fault analysis on the events recorded in the first memory, the fault analysis at least including: checking whether the event conforms to a predefined fault mode, verifying whether the event exceeds a preset normal operating range, and evaluating whether the event causes instrument performance degradation or abnormality; if the analysis result shows that the event constitutes a fault, the event log and timestamp corresponding to the event constituting the fault are transferred and stored in the second memory.
[0047] In a specific embodiment of the present application, when the input and output port states of the instrument are detected to change and recorded as an event, the log record of the event and the corresponding timestamp are temporarily stored in the first memory of the instrument. Then, the recorded event log and its timestamp are loaded from the first memory, and each event log is analyzed to check whether it conforms to the predefined fault mode, verify whether the event exceeds the preset normal operating range, and evaluate whether the event causes the performance degradation or abnormal behavior of the instrument. Among them, the fault mode refers to a series of pre-set rules or templates to identify the behavior or state changes that may cause the instrument to fail. The verification operation range includes but is not limited to checking whether the sensor reading exceeds the safety threshold, whether the communication delay exceeds the maximum allowed value, etc. Performance degradation or abnormal behavior includes but is not limited to extended response time, data loss, etc. If the result of the fault analysis shows that a certain event constitutes a fault, the event is confirmed as a fault event, and then the event log and timestamp corresponding to the event constituting the fault are migrated from the first memory to the second memory. Its second memory can be a non-volatile memory specifically used to store fault information to ensure that the fault data will not be lost even in the case of power failure.
[0048] It should be noted that before implementation, it is necessary to clarify which behaviors or state changes are considered failure modes and incorporate them into the system's fault detection algorithm; set the normal operating range of each parameter according to the specific operating characteristics and safety requirements of the instrument, and any situation outside these ranges is considered a potential failure; in addition, it is necessary to continuously monitor the key performance indicators of the instrument to promptly detect any performance degradation and record relevant data; at the same time, a reasonable storage strategy should be designed to ensure that the fault data can be transferred to the second memory in a timely manner without affecting the normal use of the first memory. However, this application does not impose any restrictions on the specific setting method and value of these related values.
[0049] In one embodiment of the present application, the smart meter operation log monitoring method also includes, after the meter experiences a power outage and restarts, restoring key parameters from the second memory and continuing to accumulate the total operation time; the key parameters include at least the meter's accumulated operation time, fault records, meter configuration information, and user set values.
[0050] In a specific embodiment of the present application, in order to realize the function of restoring key parameters from the second memory and continuing to accumulate the total running time after the meter is powered off and restarted in the operation log monitoring method of the intelligent meter. First, during the normal operation of the meter, the time count TimeCount is regularly stored in a non-volatile memory (such as EEPROM). Considering the read and write times limit of the EEPROM, the storage time interval can be appropriately adjusted according to the application of the meter. Since the accuracy requirement of the meter's running time is not high, the storage frequency can also be relaxed to reduce the wear on the EEPROM. In addition to the time count TimeCount, key parameters need to be stored in the second memory. These key parameters include at least the accumulated running time of the meter, fault records, meter configuration information, and user settings.
[0051] In a specific case, before the meter is about to be powered off, ensure that the latest TimeCount value and other key parameters are saved in the second memory, so that the integrity of the key parameters can be maintained by relying on the data in the second memory at the next startup. That is, when the meter restarts, the last saved key parameters are read from the second memory, including the accumulated running time, fault records, meter configuration information, and user settings. Among them, time accumulation is to read the last saved time count TimeCount from the EEPROM, and calculate the total running time of the meter based on the time difference before and after the power failure, and continue to accumulate the total running time after the meter restarts, to ensure the continuity and accuracy of time statistics.
[0052] In a specific embodiment, during the normal operation of the instrument, TimeCount is periodically stored in the EEPROM, and key parameters are saved in the second memory. When the instrument is about to be powered off, the latest TimeCount and key parameters are saved in the second memory, and the second memory keeps the data unchanged while the instrument is in the power-off state. Then, after the instrument is restarted, the key parameters are restored from the second memory. According to the time count TimeCount before the power failure and the running time after the power failure, the total running time of the instrument is accumulated and calculated, and finally the instrument can continue to operate normally, and the TimeCount and key parameters are updated.
[0053] It can be understood that according to the solution proposed in the above embodiment, the function of restoring key parameters from the second memory and continuing to accumulate the total operating time of the smart meter after power failure and restart can be effectively realized, thereby ensuring the continuity and reliability of the meter operation data.
[0054] Step S240: displaying the log records in the first memory on the display interface of the instrument.
[0055] In one embodiment of the present application, the log records in the first memory are displayed on the display interface of the instrument, including: displaying the log records from the first memory in chronological order on the instrument display interface, wherein the log records at least contain data of fault events, function check events, and other important events; converting the total operating time of the instrument into a preset standard format, and presenting it to the user on the display interface.
[0056] In a specific embodiment of the present application, in order to realize the log record display function on the instrument display interface, the total running time of the instrument is converted into an easy-to-understand standard format and presented to the user. First, on the display interface of the instrument, the log records from the first memory are displayed in chronological order, and the log records contain at least data of fault events, function check events and other important events, and the user can choose to view event records of different categories in order to pay attention to specific types of events. Then, the total running time of the instrument is converted into a preset standard format for display. The specific conversion rule is: 60 minutes equals 1 hour, 24 hours equals 1 day, 30 days equals 1 month, and 12 months equals 1 year. The total running time is converted into the format of "year (Y)-month (M)-day (D)-hour (H)-minute (m)" and presented to the user on the display interface. Finally, on the display interface of the instrument, the log records are displayed one by one in chronological order, and the specific display method can also use the form of a scrolling list so that the user can view all records one by one. And in the last item of the log record, the custom event type is displayed. At the same time, the total running time of the instrument is displayed in a simplified time format on the main interface of the instrument or a separate time display page.
[0057] The specific implementation process is as follows: first, read the latest log record from the first memory, and sort the read log records in chronological order; then, convert the total operating time of the instrument into a simplified time format, and display the sorted log records in sequence on the display interface of the instrument, and display the total operating time in the time format at a designated location; in addition, allow the user to select different event categories through the interface, and view the latest log records, and refresh the display interface regularly to ensure the timeliness of the information.
[0058] Figure 3 It is a schematic diagram of the overall steps of a method for monitoring operation logs of a smart meter shown in an exemplary embodiment of the present application.
[0059] like Figure 3As shown, in the implementation process of the intelligent instrument operation log monitoring method proposed in this application, the system first starts to monitor the input and output status of the instrument. This monitoring step helps to capture any state changes during the operation of the instrument in a timely manner, ensuring that the system can respond quickly and record the events that occur at this time, and generate corresponding event logs. At the same time, the system tracks the changes in time through the configured time interval counting mechanism and generates a timestamp at each time point. The generation of timestamps enables each event log to accurately mark the time of occurrence, improving the accuracy of log records.
[0060] Next, these events and their corresponding timestamps are stored in the first memory. The first memory (usually RAM) can achieve fast data access and ensure that the event log can be recorded immediately, which is especially important for scenarios that require immediate feedback. Next, it is further checked whether these recorded events involve faults. If so, the relevant information of the fault and other key data are stored in the second memory. The second memory (such as EEPROM) is non-volatile and can save data even in the case of power failure, which ensures that important fault information will not be lost due to power failure.
[0061] In addition, the system also has a power failure judgment function. Once the instrument is powered off, the system can restore the operating information based on the data in the second memory when it is powered on next time, thereby maintaining the continuity of the instrument's operating data and avoiding data discontinuity caused by power failure. Finally, all recorded event logs will be presented on the instrument's display interface for users to view. This function not only makes it convenient for users to understand the instrument's working status at any time, but also facilitates technicians to perform fault diagnosis and maintenance work.
[0062] It is understandable that if Figure 3 The implementation method shown ensures real-time monitoring of the instrument's working status and maintains data integrity in the event of a power outage, thereby enhancing system reliability and user experience.
[0063] Finally, based on the contents of all the above embodiments, it is also necessary to emphasize that the intelligent instrument operation log monitoring method proposed in this application has the following beneficial effects: Real-time monitoring and response: By continuously monitoring the input and output status of the instrument, the system can respond to any state changes immediately, ensuring that key events can be quickly recorded, and improving the response speed and efficiency of the system. Accurate time stamp: With the help of the timestamp generated by the time interval counting mechanism, each event log is given an accurate occurrence time, which provides an accurate time reference for subsequent analysis, which is conducive to fault location and historical data query. Efficient data management: A two-layer storage strategy is adopted, that is, the event log is temporarily stored in the first memory with fast access, and the key fault information is stored in the non-volatile second memory, which ensures the security and persistence of the data and also improves the speed of data processing. Power-off protection mechanism: The built-in power-off judgment function allows the system to restore the operation information after power failure, ensuring the continuity and integrity of the data and reducing the risk of data loss caused by power failure. User-friendly interface: All recorded event logs can be intuitively presented to the user on the display interface of the instrument, which is convenient for the user to view the status of the instrument in real time, while simplifying the process of troubleshooting and technical support.
[0064] In summary, the smart meter operation log monitoring method proposed in this application effectively improves the stability and reliability of the instrument system and improves the user experience through functions such as real-time monitoring, accurate recording, efficient storage, and power failure recovery.
[0065] Figure 4 is a block diagram of an intelligent meter operation log monitoring device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device may also be applicable to other exemplary implementation environments and specifically configured in other devices, and this embodiment does not limit the implementation environment to which the device is applicable.
[0066] like Figure 4 As shown, the exemplary smart meter operation log monitoring device includes: a fixed time counting module 410 , a storage module 420 , an event recording module 430 , a cycle list storage module 440 , and a display processing module 450 .
[0067] Among them, the fixed time counting module 410 is configured with a timer, which is used to increase the value of the counter at fixed time intervals after the instrument startup initialization is completed; the storage module 420 is used to store event records and timestamps, and restore key parameters after power failure and restart; the event recording module 430 is used to detect the state changes of the instrument input and output ports, and record at least one group of events, and allow the user to select different event types for recording; the circular list storage module 440 is used to cyclically store the event records according to the first-in-first-out principle to ensure that the latest events are stored first; the display processing module 450 is used to convert the value of the counter into a preset standard format time format, and display the log records in chronological order on the instrument display interface.
[0068] In one embodiment of the present application, the storage module includes a first storage module and a second storage module. The first storage module is used to temporarily store event records and their corresponding timestamps, and is implemented using a volatile storage medium; the second storage module is used to long-term store event records determined to be faults and their corresponding timestamps, and to restore key parameters after the instrument is powered off and restarted, and is implemented using a non-volatile storage medium.
[0069] In a specific embodiment of the present application, the first memory uses RAM (random access memory) and the second memory uses EEPROM (electrically erasable programmable read-only memory).
[0070] It should be noted that the intelligent meter operation log monitoring device provided in the above embodiment and the intelligent meter operation log monitoring method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In actual application, the intelligent meter operation log monitoring device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0071] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the smart meter operation log monitoring method provided in the above-mentioned embodiments.
[0072] Figure 5 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0073] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method described in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0074] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0075] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.
[0076] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0077] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0078] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0079] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the above-mentioned smart meter operation log monitoring method. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0080] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the smart meter operation log monitoring method provided in each of the above embodiments.
[0081] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for monitoring the operation log of an intelligent instrument, characterized in that: The method comprises: A counting mechanism for a fixed time interval is configured based on the internal clock or timer of the meter, so that after the meter is started and initialized, the time count is increased every time the set time interval is reached; Monitor the status of the input and output ports of the instrument. If a status change is detected, it will be recorded as an event and an event log containing status information will be generated; Recording a time count value when a state change occurs as a timestamp, and storing the event log and the timestamp in a first memory; The log records in the first memory are displayed on the display interface of the instrument.
2. The method for monitoring the operation log of an intelligent instrument according to claim 1, characterized in that: After temporarily storing the event log and the timestamp in the first memory, the method further includes: Performing fault analysis on the events recorded in the first memory, the fault analysis at least comprising: checking whether the events conform to a predefined fault mode, verifying whether the events exceed a preset normal operating range, and evaluating whether the events cause instrument performance degradation or abnormality; If the analysis result shows that the event constitutes a fault, the event log and timestamp corresponding to the event constituting the fault are transferred and stored in the second memory.
3. The method for monitoring the operation log of an intelligent instrument according to claim 1, characterized in that: The method further comprises: After the meter is powered off and restarted, the key parameters are restored from the second memory and the total operating time continues to be accumulated; The key parameters include at least the instrument's cumulative operating time, fault records, instrument configuration information, and user settings.
4. The method for monitoring the operation log of an intelligent instrument according to claim 1, characterized in that: The method further comprises, Classify events into fault events, function check events, and other routine events; Allocate independent storage areas for each type of event, and use circular list structures to manage their respective storage spaces; In each independent storage area, the latest event record is inserted at the front of the list; When the storage capacity reaches the upper limit, the oldest event record is overwritten in a first-in-first-out manner.
5. The method for monitoring the operation log of an intelligent instrument according to claim 4, characterized in that: Use a circular list structure to manage storage space, including: Create a fixed-size buffer to store the latest event records; When a new event is generated, the new event is added to the end of the buffer; If the buffer is full, remove the first element of the buffer and add the new event record to the end of the buffer; The index mechanism is used to track the latest event record position in the buffer to ensure that new events are always stored in the latest position of the buffer. The first-in-first-out principle is adopted. When the storage capacity reaches the upper limit, the oldest event record is overwritten to ensure that the latest events are stored first.
6. The method for monitoring the operation log of an intelligent instrument according to claim 1, characterized in that: Displaying the log records in the first memory on the display interface of the instrument includes: Displaying log records from the first memory in chronological order on the instrument display interface, wherein the log records at least include data of fault events, function check events, and other important events; The total operating time of the instrument is converted into a preset standard format and presented to the user on the display interface.
7. A smart instrument operation log monitoring device, characterized in that: The device comprises: The fixed time counting module is equipped with a timer, which is used to increase the value of the counter at fixed time intervals after the meter is started and initialized; Storage module, used to store event records and timestamps, and restore key parameters after power failure and restart; An event recording module is used to detect changes in the status of the instrument input and output ports and record at least one set of events, and allows the user to select different event types to record; A circular list storage module, used for circularly storing the event records according to the first-in-first-out principle, ensuring that the latest events are stored first; The display processing module is used to convert the counter value into a preset standard time format and display the log records in chronological order on the instrument display interface.
8. The intelligent instrument operation log monitoring device according to claim 7 is characterized in that: The storage module includes a first storage module and a second storage module. The first storage module is used for temporarily storing event records and their corresponding timestamps, and is implemented using a volatile storage medium; The second storage module is used to store the event records judged as faults and their corresponding timestamps for a long time, and to restore key parameters after the instrument is powered off and restarted, and is implemented using non-volatile storage media.
9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the smart meter operation log monitoring method as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the smart meter operation log monitoring method as described in any one of claims 1 to 6.
Citation Information
Cited By
Capacitance measurement and control instrument data processing method and device
CN120104429A
Data storage method and device, electronic equipment, computer readable storage medium and computer program product
CN120560574A
Cross-running-level timestamp synchronization method and device, chip, network interface card, equipment, medium and program product
CN121193362A