A log storage method and system for power collection terminal
By using the latest and backup storage areas of the NFC module in the power acquisition terminal to process log information, the problem of logging memory failure caused by the inability to read logs is solved, and the log information is quickly obtained and uploaded in the event of a failure is achieved, helping operation and maintenance personnel to quickly obtain and upload log information Repair the system.
Patent Information
- Application Number
- CN202411133409.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-08-19
AI Technical Summary
When the power acquisition terminal fails, the log memory is damaged and the device log information cannot be read, affecting the operation and maintenance personnel to quickly restore the system.
The NFC module is divided into the latest storage area and the backup storage area. The device log is generated in real time and overwrites the storage to the latest storage area. When determining the impact of the log on the system security, it is stored in the backup area. The relevant logs are selected and transferred to the backup area and uploaded in real time. Cloud server to ensure that the failure log is readable.
Even if the device fails seriously, the latest log information can still be read through external active devices to help quickly repair it. The NFC module backup storage area stores log information with strong fault correlation to ensure that operation and maintenance personnel quickly locate problems.
Smart Images

Figure CN118656253B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of log storage, and in particular to a log storage method and system for a power collection terminal. Background Art
[0002] The power collection terminal can collect and store power metering data. Each power collection terminal is usually responsible for collecting data from a large number of electric meters. Therefore, it is particularly important to ensure the normal operation of the power collection terminal. When a power collection terminal fails, the operation and maintenance personnel need to quickly find the problem through the device log of the power collection terminal to restore the normal operation of the power collection terminal as soon as possible. However, sometimes the log memory is damaged, the power collection terminal cannot operate, etc., resulting in the inability to successfully read the device log information. Therefore, it is necessary to provide a log storage method and system for a power collection terminal to solve the above problems. Summary of the invention
[0003] In view of the deficiencies in the prior art, the object of the present invention is to provide a log storage method and system for a power collection terminal to solve the problems existing in the above-mentioned background technology.
[0004] The present invention is implemented as follows: a log storage method for a power collection terminal, the method comprising the following steps:
[0005] Generate device log information in real time based on the operation status of the power collection terminal, update the device log information in the memory, and overwrite and store the latest generated device log information with preset bytes into the latest storage area of the NFC module;
[0006] Determine whether the device log information stored in the memory within the most recent preset time period affects the basic operation of the acquisition terminal, the safe storage of the memory, or the network security. If so, store the device log information in the backup storage area of the NFC module.
[0007] Selecting device log information before a recent preset time period in the memory based on the remaining storage space in the backup storage area of the NFC module, and transferring part of the device log information to the backup storage area of the NFC module;
[0008] Upload the device log information in the NFC module backup storage area to the cloud server in real time. When the upload is successful, the NFC module backup storage area is cleared; when the upload fails, all the contents in the NFC module backup storage area are retained.
[0009] As a further solution of the present invention: the method further comprises:
[0010] Upload the device log information in the storage to the cloud server regularly, and clear the device log information stored in the storage after uploading;
[0011] When the subsequently generated device log information needs to be stored in the backup storage area of the NFC module, and the device log information is stored in the backup storage area of the NFC module, the content in the backup storage area of the NFC module is overwritten.
[0012] As a further solution of the present invention: the step of determining whether the device log information stored in the memory within the most recent preset time period has an impact on the basic operation of the acquisition terminal, the safe storage of the memory, or the network security specifically includes:
[0013] Extract the log entries of the device log information saved in the memory within the latest preset time period, and filter out the log entries related to the basic operation of the acquisition terminal, the secure storage of the memory, or the network security based on the regular expression;
[0014] Based on the log analysis tool syslog-ng, determine whether the log entry reflects device downtime, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or corruption, network attack, or malware activity;
[0015] When the log entry reflects any of the above items, it is determined that the log entry has an impact on the basic operation of the acquisition terminal, the safe storage of the memory, or the network security.
[0016] As a further solution of the present invention: the step of filtering out log entries related to basic operation of the acquisition terminal, secure storage of the memory or network security based on regular expressions specifically includes:
[0017] Retrieving keywords related to basic operation of the acquisition terminal, secure storage of the memory, and network security, and constructing regular expressions based on the keywords;
[0018] Apply a regular expression to filter log entries. When applying, the options used need to support extended regular expression syntax.
[0019] As a further solution of the present invention: the step of selecting part of the device log information to be transferred to the backup storage area of the NFC module specifically includes:
[0020] Determine the occurrence time, warning code and warning module of the device log information in the NFC module backup storage area;
[0021] Determine the generation time, code information and module information of each log entry in the device log information before the most recent preset time period in the memory in order from back to front;
[0022] The correlation between the log entry and the device log information in the backup storage area of the NFC module is calculated based on the generation time, code information and module information. When the correlation is greater than the preset correlation value, the corresponding log entry is transferred to the backup storage area of the NFC module until the remaining storage space reaches the preset lower limit.
[0023] As a further solution of the present invention: the NFC module can communicate with an external active NFC device without power supply, and the NFC module is powered and performs data transmission through the electromagnetic field of the NFC device.
[0024] Another object of the present invention is to provide a log storage system for a power collection terminal, the system comprising:
[0025] The latest log storage module is used to generate device log information in real time based on the operation status of the power collection terminal, update the device log information in the memory, and overwrite and store the latest generated device log information of preset bytes in the latest storage area of the NFC module;
[0026] The log backup storage module is used to determine whether the device log information saved in the memory within the latest preset time period has an impact on the basic operation of the acquisition terminal, the safe storage of the memory or the network security. If an impact is caused, the device log information is stored in the backup storage area of the NFC module;
[0027] A related log selection module is used to select device log information before the most recent preset time period in the memory based on the remaining storage space in the backup storage area of the NFC module, and select part of the device log information to be transferred to the backup storage area of the NFC module;
[0028] The NFC log upload module is used to upload the device log information in the NFC module backup storage area to the cloud server in real time. When the upload is successful, the backup storage area of the NFC module is cleared; when the upload fails, all the contents in the NFC module backup storage area are retained.
[0029] As a further solution of the present invention: the system also includes:
[0030] The storage log upload module is used to regularly upload the device log information in the storage to the cloud server. After the upload is completed, the device log information stored in the storage is cleared;
[0031] The backup log overwriting module is used to overwrite the content in the backup storage area of the NFC module when the subsequently generated device log information needs to be stored in the backup storage area of the NFC module and the device log information is stored in the backup storage area of the NFC module.
[0032] As a further solution of the present invention: the log backup storage module includes:
[0033] A log entry screening unit, used to extract log entries of device log information stored in the memory within a recent preset time period, and screen out log entries related to basic operation of the acquisition terminal, secure storage of the memory, or network security based on regular expressions;
[0034] A log entry analysis unit, used to determine whether the log entry reflects device downtime, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or corruption, network attack, or malware activity based on the log analysis tool syslog-ng;
[0035] The log entry determination unit is used to determine whether the log entry affects the basic operation of the collection terminal, the safe storage of the memory or the network security when the log entry reflects any of the above items.
[0036] As a further solution of the present invention: the relevant log selection module includes:
[0037] An information extraction unit, used to determine the occurrence time, warning code and warning module of the device log information in the NFC module backup storage area;
[0038] An information determination unit, used to determine, from back to front, the generation time, code information and module information of each log entry in the device log information in the memory before the most recent preset time period;
[0039] A correlation calculation unit is used to calculate the correlation between the log entry and the device log information in the backup storage area of the NFC module based on the generation time, code information and module information. When the correlation is greater than a preset correlation value, the corresponding log entry is transferred to the backup storage area of the NFC module until the remaining storage space reaches a preset lower limit.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] The present invention overwrites and stores the latest generated device log information of preset bytes into the latest storage area of the NFC module; and determines whether the device log information stored in the memory within the latest preset time period affects the basic operation of the acquisition terminal, the safe storage of the memory, or the network security. If it does affect, the device log information is stored in the backup storage area of the NFC module; and part of the device log information is selected and transferred to the backup storage area of the NFC module. In this way, even if a serious fault occurs immediately after the device log information is generated, the latest device log information can be read through an external active NFC device to help the operation and maintenance personnel to quickly repair it, and the backup storage area of the NFC module stores all device log information that is highly correlated with the fault. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The present invention is a flow chart of a log storage method of a power collection terminal.
[0043] Figure 2 The present invention is a flow chart of determining device log information in a log storage method of a power collection terminal.
[0044] Figure 3 The present invention is a flowchart of regular expression-based screening in a log storage method of a power collection terminal.
[0045] Figure 4 The present invention is a flowchart for selecting part of the equipment log information in a log storage method of a power collection terminal.
[0046] Figure 5 The diagram is a structural diagram of a log storage system for a power collection terminal. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0048] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.
[0049] like Figure 1 As shown, an embodiment of the present invention provides a log storage method for a power collection terminal, the method comprising the following steps:
[0050] S100, generating device log information in real time based on the operation status of the power collection terminal, updating the device log information in the memory, and overwriting and storing the latest generated device log information with preset bytes into the latest storage area of the NFC module;
[0051] S200, determining whether the device log information stored in the memory within the most recent preset time period affects the basic operation of the acquisition terminal, the secure storage of the memory, or the network security, and if so, storing the device log information in the backup storage area of the NFC module;
[0052] S300, selecting device log information before a recent preset time period in the memory based on the remaining storage space in the backup storage area of the NFC module, and transferring part of the device log information to the backup storage area of the NFC module;
[0053] S400, upload the device log information in the NFC module backup storage area to the cloud server in real time. When the upload is successful, the backup storage area of the NFC module is cleared; when the upload fails, all the contents in the NFC module backup storage area are retained.
[0054] It should be noted that when a power collection terminal fails, the operation and maintenance personnel need to quickly find the problem through the device log of the power collection terminal in order to restore the normal operation of the power collection terminal as soon as possible. However, sometimes the log memory may be damaged, the power collection terminal may not be able to operate, etc., resulting in the inability to successfully read the device log information. The embodiments of the present invention aim to solve the above problems.
[0055] In the embodiment of the present invention, in addition to the memory of the prior art, the power collection terminal is also equipped with an NFC module, which is divided into the latest storage area and the backup storage area. The NFC module can communicate with an external active NFC device without power supply, that is, the NFC module is powered and transmits data through the electromagnetic field of the NFC device. The embodiment of the present invention will generate device log information in real time according to the operation of the power collection terminal, and synchronize the device log information in the memory according to the real-time generated device log information. In addition, the embodiment of the present invention will overwrite and store the latest generated device log information of preset bytes in the latest storage area of the NFC module. For example, if the capacity of the latest storage area is A bytes, the latest generated device log information of A bytes will be overwritten and stored in the latest storage area. In this way, even if the power collection terminal immediately encounters a serious fault after the device log information is generated, such as the memory is damaged, the power collection terminal cannot be turned on, etc., the latest device log information can be read through an external active NFC device to help the operation and maintenance personnel to quickly repair it. In addition, the embodiment of the present invention will also determine whether the device log information saved in the memory within the most recent preset time period (for example, the most recent 20 minutes) affects the basic operation of the acquisition terminal, the safe storage of the memory, or the network security. If it does, the corresponding device log information will be stored in the backup storage area of the NFC module, and then the device log information saved before the most recent preset time period (for example, the most recent 20 minutes) in the memory will be selected based on the remaining storage space in the backup storage area of the NFC module, and some device log information with strong correlation will be selected and transferred to the backup storage area of the NFC module. In this way, the backup storage area stores device log information that is helpful for maintenance, and this part of the device log information can still be read when a serious fault occurs in the power acquisition terminal. In addition, the embodiment of the present invention will upload the device log information in the backup storage area of the NFC module to the cloud server in real time. When the upload is successful, the backup storage area of the NFC module will be cleared; when the upload fails, such as when the network is unstable or the network communication is attacked, all the contents in the backup storage area of the NFC module will be retained.
[0056] like Figure 1 As shown, as a preferred embodiment of the present invention, the method further includes:
[0057] S500, regularly uploading the device log information in the memory to the cloud server, and after the uploading is completed, clearing the device log information stored in the memory;
[0058] S600: When the subsequently generated device log information needs to be stored in the backup storage area of the NFC module, and the device log information is stored in the backup storage area of the NFC module, the content in the backup storage area of the NFC module is overwritten.
[0059] In the embodiment of the present invention, the device log information in the memory is uploaded to the cloud server regularly, for example, once a week. After the upload is completed, the device log information stored in the memory is cleared. It is easy to understand that when the network is unstable and the network communication is attacked, there will be a situation where the subsequently generated device log information needs to be stored in the backup storage area of the NFC module, and the device log information is stored in the backup storage area of the NFC module. Since the storage space of the NFC module is not large and limited, only relatively important data can be retained in the NFC module, that is, the content in the backup storage area is overwritten with the subsequently generated device log information.
[0060] like Figure 2 As shown, as a preferred embodiment of the present invention, the step of determining whether the device log information stored in the memory within the most recent preset time period affects the basic operation of the acquisition terminal, the safe storage of the memory, or the network security specifically includes:
[0061] S201, extracting log entries of device log information stored in the memory within a recent preset time period, and filtering out log entries related to basic operation of the acquisition terminal, secure storage of the memory, or network security based on regular expressions;
[0062] S202, determining whether the log entry reflects device downtime, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or corruption, network attack, or malware activity based on the log analysis tool syslog-ng;
[0063] S203: When the log entry reflects any of the above items, it is determined that the log entry has an impact on the basic operation of the collection terminal, the safe storage of the memory, or the network security.
[0064] In an embodiment of the present invention, log entries of device log information are automatically extracted, and then log entries related to the basic operation of the acquisition terminal, secure storage of memory or network security are screened out based on regular expressions. After the log entries that initially meet the requirements are screened out, it is determined based on the log analysis tool syslog-ng whether the log entries reflect device shutdown, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or damage, network attack or malware activity, among which, device shutdown, service interruption and performance degradation to a preset percentage affect the basic operation of the acquisition terminal, illegal access, data leakage or tampering and data loss or damage affect the secure storage of memory, and network attack and malware activity affect network security. In this way, when the log entry reflects any of the above items, it can be determined that the log entry has an impact on the basic operation of the acquisition terminal, secure storage of memory or network security.
[0065] like Figure 3 As shown, as a preferred embodiment of the present invention, the step of filtering out log entries related to basic operation of the acquisition terminal, secure storage of the memory or network security based on regular expressions specifically includes:
[0066] S2011, retrieve keywords related to basic operation of the acquisition terminal, secure storage of the memory, and network security, and construct a regular expression based on the keywords;
[0067] S2012, apply regular expressions to filter log entries. When applying, the options used need to support extended regular expression syntax.
[0068] In the embodiment of the present invention, keywords related to the basic operation of the acquisition terminal, secure storage of the memory, and network security need to be set in advance. The embodiment of the present invention automatically constructs regular expressions based on these keywords; then the constructed regular expressions are applied to the screening process of the device logs, specifically, by writing scripts or using tools that support regular expressions, such as the grep command in Linux, the re module of Python, etc. In the embodiment of the present invention, the grep command in Linux is taken as an example. If the log file name is device_log.txt, the command: grep -E '(startup|running|fault|restart|normal status|encryption|decryption|secure storage|access control|data protection|network connection|firewall|intrusion detection|security alert|IP address)' device_log.txt can be used to filter the log entries containing one of the above keywords, and the -E option is used to enable grep to support the extended regular expression syntax, so that the screening effect is better.
[0069] like Figure 4 As shown, as a preferred embodiment of the present invention, the step of selecting part of the device log information to be transferred to the backup storage area of the NFC module specifically includes:
[0070] S301, determining the occurrence time, warning code and warning module of the device log information in the NFC module backup storage area;
[0071] S302, determining the generation time, code information and module information of each log entry in the device log information before the most recent preset time period in the memory in order from back to front;
[0072] S303, based on the generation time, code information and module information, calculate the correlation between the log entry and the device log information in the backup storage area of the NFC module. When the correlation is greater than a preset correlation value, transfer the corresponding log entry to the backup storage area of the NFC module until the remaining storage space reaches a preset lower limit.
[0073] In the embodiment of the present invention, the occurrence time, warning code and warning module of the device log information in the backup storage area of the NFC module are determined. The warning code is the error code in the log, and the warning module refers to the module in the power collection terminal where an abnormality occurs, for example, the warning module is a battery module. Then, the generation time, code information and module information of each log entry in the device log information before the most recent preset time period in the memory are determined in sequence from back to front, and then the correlation between the log entry and the device log information in the backup storage area of the NFC module is calculated based on the generation time, code information and module information. It is easy to understand that when the generation time is closer to the occurrence time, the code information and the warning code belong to the same category, and the module information and the warning module are the same, the higher the calculation result of the correlation is, and when the correlation is greater than the preset correlation value (a fixed value set in advance), the corresponding log entry is transferred to the backup storage area of the NFC module until the remaining storage space reaches the preset lower limit value, for example, the preset lower limit value is B bytes, and the log entry is no longer transferred. The specific calculation formula of the correlation can be modified according to actual conditions. For example, the specific calculation formula of the correlation is: Correlation = a ÷ (time difference between occurrence time and generation time) + b × the number of digits in common between the code information and the warning code + c. When the module information is the same as the warning module, c is K; when the module information is different from the warning module, c is 0. a and b are constant coefficients, K is a constant, and a, b and K are all empirical values, such as a=0.6, b=0.7 and K=3.
[0074] like Figure 5 As shown, an embodiment of the present invention further provides a log storage system for a power collection terminal, the system comprising:
[0075] The latest log storage module 100 is used to generate device log information in real time based on the operation status of the power collection terminal, update the device log information in the memory, and overwrite and store the latest generated device log information of preset bytes in the latest storage area of the NFC module;
[0076] The log backup storage module 200 is used to determine whether the device log information stored in the memory within the most recent preset time period has an impact on the basic operation of the acquisition terminal, the secure storage of the memory or the network security. If an impact is caused, the device log information is stored in the backup storage area of the NFC module;
[0077] The relevant log selection module 300 is used to select the device log information before the most recent preset time period in the memory based on the remaining storage space of the NFC module backup storage area, and select part of the device log information to be transferred to the NFC module backup storage area;
[0078] The NFC log upload module 400 is used to upload the device log information in the NFC module backup storage area to the cloud server in real time. When the upload is successful, the backup storage area of the NFC module is cleared; when the upload fails, all the contents in the NFC module backup storage area are retained;
[0079] The storage log uploading module 500 is used to regularly upload the device log information in the storage to the cloud server, and after the upload is completed, the device log information stored in the storage is cleared;
[0080] The backup log overwriting module 600 is used to overwrite the content in the backup storage area of the NFC module when the subsequently generated device log information needs to be stored in the backup storage area of the NFC module and the device log information is stored in the backup storage area of the NFC module.
[0081] As a preferred embodiment of the present invention, the log backup storage module 200 includes:
[0082] A log entry screening unit, used to extract log entries of device log information stored in the memory within a recent preset time period, and screen out log entries related to basic operation of the acquisition terminal, secure storage of the memory, or network security based on regular expressions;
[0083] A log entry analysis unit, used to determine whether the log entry reflects device downtime, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or corruption, network attack, or malware activity based on the log analysis tool syslog-ng;
[0084] The log entry determination unit is used to determine whether the log entry affects the basic operation of the collection terminal, the safe storage of the memory or the network security when the log entry reflects any of the above items.
[0085] As a preferred embodiment of the present invention, the relevant log selection module 300 includes:
[0086] An information extraction unit, used to determine the occurrence time, warning code and warning module of the device log information in the NFC module backup storage area;
[0087] An information determination unit, used to determine, from back to front, the generation time, code information and module information of each log entry in the device log information in the memory before the most recent preset time period;
[0088] A correlation calculation unit is used to calculate the correlation between the log entry and the device log information in the backup storage area of the NFC module based on the generation time, code information and module information. When the correlation is greater than a preset correlation value, the corresponding log entry is transferred to the backup storage area of the NFC module until the remaining storage space reaches a preset lower limit.
[0089] The above only describes in detail the preferred embodiments of the present invention, which is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0090] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0091] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0092] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the disclosure in the specification and examples. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A log storage method for a power collection terminal, characterized in that: The method comprises the following steps: Generate device log information in real time based on the operation status of the power collection terminal, update the device log information in the memory, and overwrite and store the latest generated device log information with preset bytes into the latest storage area of the NFC module; Determine whether the device log information stored in the memory within the most recent preset time period affects the basic operation of the acquisition terminal, the safe storage of the memory, or the network security. If so, store the device log information in the backup storage area of the NFC module. Selecting device log information before a recent preset time period in the memory based on the remaining storage space in the backup storage area of the NFC module, and transferring part of the device log information to the backup storage area of the NFC module; Upload the device log information in the NFC module backup storage area to the cloud server in real time. When the upload is successful, the NFC module backup storage area is cleared; when the upload fails, all the contents in the NFC module backup storage area are retained; Among them, the step of determining whether the device log information stored in the memory within the most recent preset time period has an impact on the basic operation of the acquisition terminal, the safe storage of the memory, or the network security specifically includes: extracting log entries of the device log information stored in the memory within the most recent preset time period, and filtering out log entries related to the basic operation of the acquisition terminal, the safe storage of the memory, or the network security based on regular expressions; determining whether the log entry reflects device downtime, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or damage, network attack, or malware activity based on the log analysis tool syslog-ng; when the log entry reflects any of the above, determining that the log entry has an impact on the basic operation of the acquisition terminal, the safe storage of the memory, or the network security; Among them, the step of selecting part of the device log information to be transferred to the backup storage area of the NFC module specifically includes: determining the occurrence time, warning code and warning module of the device log information in the backup storage area of the NFC module; determining the generation time, code information and module information of each log entry in the device log information before the most recent preset time period in the memory in sequence from back to front; calculating the correlation between the log entry and the device log information in the backup storage area of the NFC module based on the generation time, code information and module information, and when the correlation is greater than a preset correlation value, transferring the corresponding log entry to the backup storage area of the NFC module until the remaining storage space reaches a preset lower limit.
2. The log storage method of the power collection terminal according to claim 1, characterized in that: The method further comprises: Upload the device log information in the storage to the cloud server regularly, and clear the device log information stored in the storage after uploading; When the subsequently generated device log information needs to be stored in the backup storage area of the NFC module, and the device log information is stored in the backup storage area of the NFC module, the content in the backup storage area of the NFC module is overwritten.
3. The log storage method of the power collection terminal according to claim 2, characterized in that: The step of filtering out log entries related to basic operation of the acquisition terminal, secure storage of the memory, or network security based on the regular expression specifically includes: Retrieving keywords related to basic operation of the acquisition terminal, secure storage of the memory, and network security, and constructing regular expressions based on the keywords; Apply a regular expression to filter log entries. When applying, the options used need to support extended regular expression syntax.
4. The log storage method of the power collection terminal according to claim 3 is characterized in that: The NFC module can communicate with an external active NFC device without power supply. The NFC module is powered and performs data transmission through the electromagnetic field of the NFC device.
5. A log storage system for a power collection terminal, characterized in that: The log storage method applied to the power collection terminal according to claim 4, the system comprising: The latest log storage module is used to generate device log information in real time based on the operation status of the power collection terminal, update the device log information in the memory, and overwrite and store the latest generated device log information of preset bytes in the latest storage area of the NFC module; The log backup storage module is used to determine whether the device log information saved in the memory within the latest preset time period has an impact on the basic operation of the acquisition terminal, the safe storage of the memory or the network security. If an impact is caused, the device log information is stored in the backup storage area of the NFC module; A related log selection module is used to select device log information before the most recent preset time period in the memory based on the remaining storage space in the backup storage area of the NFC module, and select part of the device log information to be transferred to the backup storage area of the NFC module; The NFC log upload module is used to upload the device log information in the NFC module backup storage area to the cloud server in real time. When the upload is successful, the NFC module backup storage area is cleared; when the upload fails, all the contents in the NFC module backup storage area are retained; The log backup storage module includes: a log entry screening unit, which is used to extract log entries of device log information saved in the memory within the latest preset time period, and screen out log entries related to the basic operation of the acquisition terminal, the safe storage of the memory, or the network security based on regular expressions; a log entry analysis unit, which is used to determine whether the log entry reflects equipment downtime, service interruption, performance degradation to a preset percentage, illegal access, data leakage or tampering, data loss or damage, network attack or malware activity based on the log analysis tool syslog-ng; a log entry determination unit, which is used to determine whether the log entry has an impact on the basic operation of the acquisition terminal, the safe storage of the memory, or the network security when the log entry reflects any of the above items; Among them, the relevant log selection module includes: an information extraction unit, which is used to determine the occurrence time, warning code and warning module of the device log information in the NFC module backup storage area; an information determination unit, which is used to determine the generation time, code information and module information of each log entry in the device log information before the most recent preset time period in the memory in sequence from back to front; a correlation calculation unit, which is used to calculate the correlation between the log entry and the device log information in the NFC module backup storage area based on the generation time, code information and module information. When the correlation is greater than the preset correlation value, the corresponding log entry is transferred to the backup storage area of the NFC module until the remaining storage space reaches the preset lower limit.
6. The log storage system of the power collection terminal according to claim 5, characterized in that: The system further comprises: The storage log upload module is used to regularly upload the device log information in the storage to the cloud server. After the upload is completed, the device log information stored in the storage is cleared; The backup log overwriting module is used to overwrite the content in the backup storage area of the NFC module when the subsequently generated device log information needs to be stored in the backup storage area of the NFC module and the device log information is stored in the backup storage area of the NFC module.
Citation Information
Patent Citations
Method of managing debug logs in storage device
CN115587011A
Database log real-time management method, system and device and storage medium
CN117785059A
Log processing method, device and equipment and readable storage medium
CN118244989A
Log collection method and device, computer equipment and storage medium
CN118409926A
Management of event log information of a memory sub-system
US20200192779A1
