CN114500253A - Log information storage method and storage medium - Google Patents

Log information storage method and storage medium Download PDF

Info

Publication number
CN114500253A
CN114500253A CN202210038539.0A CN202210038539A CN114500253A CN 114500253 A CN114500253 A CN 114500253A CN 202210038539 A CN202210038539 A CN 202210038539A CN 114500253 A CN114500253 A CN 114500253A
Authority
CN
China
Prior art keywords
log
key
information
encrypted
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210038539.0A
Other languages
Chinese (zh)
Other versions
CN114500253B (en
Inventor
王晓鹏
晏元贵
祝国胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Telixin Electronics Technology Co ltd
Original Assignee
Beijing Telixin Electronics Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Telixin Electronics Technology Co ltd filed Critical Beijing Telixin Electronics Technology Co ltd
Priority to CN202210038539.0A priority Critical patent/CN114500253B/en
Publication of CN114500253A publication Critical patent/CN114500253A/en
Application granted granted Critical
Publication of CN114500253B publication Critical patent/CN114500253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a log information storage method and a storage medium, comprising the following steps: step 1: dividing the log into log grades, and calling a log sending interface to send log information to a log server; step 2: distributing the logs to different storage and display processes, converting the key logs into hexadecimal digital character strings by a log server through an encryption algorithm, and sending the hexadecimal digital character strings to a kernel driving process; and step 3: writing the encrypted key log into Flash; and 4, step 4: adding a script by the switch software compiling server, and generating an encryption log decryption key file in the switch software compiling process; and 5: and inputting the encrypted key log file and the generated encrypted log key into a decryption tool, and outputting the key log file and the generated encrypted log key as the finished key log plaintext information. The invention has the beneficial effects that: the invention classifies the logs into grades, and the logs with different grades are distributed to different storage and display processes, so that the fault location is simple and efficient, and the key logs are encrypted, thereby ensuring the safety of information.

Description

Log information storage method and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a log information storage method and a storage medium.
Background
With the development of communication technology, especially 4G and 5G communication technology, social life increasingly depends on information communication. The network switch, which is a core device of the wired network, is deployed at each node of the transport network. Generally, network switch software has a perfect log system to record the running state and information of the device when implemented. When the switch fails, the failure reason can be quickly located by checking the log. The network switch operation logs are generally stored in a fixed memory directory, and both the ordinary operation logs and the critical logs causing fatal errors exist in the same log file, so that the content of the log file is huge, and the fault positioning difficulty is increased. On the other hand, log information stored in the memory directory is easily lost, for example, when the device is restarted accidentally, the log information in the memory directory is lost, which brings great difficulty to find the cause of the problem.
Meanwhile, in the development process of communication technology, the information security problem becomes more and more important. At present, the security of the communication technology is mainly focused on the communication information content, the information protection technology of the terminal and the transmission equipment is more and more perfect, and the security transmission of the data information is greatly enhanced. However, sufficient attention is not paid to the information security leakage of the terminal and the transmission device, and if an attacker obtains the key log information of the device, the attacker obtains the key user configuration and operation information by analyzing the log, so that the risk of data leakage is greatly increased.
Disclosure of Invention
The invention provides a log information storage method, which comprises the following steps:
step 1: according to the importance of the log information, dividing the log into log grades, dividing the log into a key log, an error log, an alarm log and a general log, and calling a log sending interface to send the log information to a log server;
step 2: the log processing server distributes the logs to different storage and display processes according to the received log grades, and the log server converts the key logs into hexadecimal digital character strings through an encryption algorithm and sends the hexadecimal digital character strings to the kernel driving process;
and step 3: after receiving the encrypted key log sent by the log server, the kernel driver process writes the encrypted key log into Flash;
and 4, step 4: adding a script by the switch software compiling server, and generating an encryption log decryption key file in the switch software compiling process;
and 5: inputting the encrypted key log file and the generated encrypted log key into a decryption tool, and outputting the key log file and the generated encrypted log key as finished key log plaintext information;
step 6: when equipment has a fault, acquiring key log information currently stored in Flash through a command, storing the key log information in a general log directory, and translating key log plaintext information by using a log decryption key and a decryption tool of a current version to perform fault location.
As a further improvement of the present invention, in step 1, the sent log information carries the level of the log, the module generating the log, the interface, the location, the time and the specific content of the log.
As a further improvement of the present invention, in the step 2, the encrypted information includes a module, an interface, a location, a time and a log content of the log parameter.
As a further improvement of the present invention, in step 3, when the device is restarted, the kernel driver process reads out and stores the log information in Flash to the universal log directory.
As a further improvement of the present invention, in the step 2, in the encryption algorithm, in order to be able to accurately locate the position where the log occurs, when implementing the log system, each module is assigned with a module number, and the function defined inside the module is assigned with a function number; the log generated by the common module carries the module name, the function name, the running code line number and the log generation time.
As a further improvement of the present invention, in step 2, after the log service process receives the key log information data, the log is firstly analyzed, the module name, the function name and the running code line number are extracted, and the module name, the function name and the running code line number are translated into the module number, the function line number and the time generated by the log, which are added to the header of the encrypted log message; and simultaneously, extracting key information in the log, converting the key information into a 16-system character string by using an encryption algorithm, adding the 16-system character string into an encrypted log message, and then sending the character string to a kernel driving process.
As a further improvement of the present invention, in the step 4, the switch software compiling server adds a script, and in the switch software compiling process, an encryption log decryption key file is generated according to a predefined module and a function file.
As a further improvement of the present invention, in the step 5, the key log plaintext information includes a log generation module, an interface, a location, a time and a specific content.
As a further improvement of the present invention, in step 6, the general log directory stores the key log information of the latest device restart.
The present invention also provides a computer-readable storage medium storing a computer program configured to implement the steps of the log information storing method when called by a processor.
The invention has the beneficial effects that: the invention classifies the logs into grades, and the logs with different grades are distributed to different storage and display processes, so that the fault location is simple and efficient, and the key logs are encrypted, thereby ensuring the safety of information.
Drawings
FIG. 1 is a flow chart of a method of the present invention;
FIG. 2 is a schematic diagram of a key journal storage format;
FIG. 3 is a key log encryption flow diagram;
fig. 4 is a key log decryption flow diagram.
Detailed Description
As shown in fig. 1, the present invention discloses a log information storage method, which comprises the following steps:
step 1: according to the importance of the log information, the log is divided into log grades, the log is divided into a key log (keyword), an error log (error), an alarm log (war) and a general log (normal), a logs sending interface (vlog) is called to send the log information to a log server, and the sent log information carries the grade of the log, a module for generating the log, the interface, the position, the time and the specific content of the log.
Step 2: the log processing server distributes the logs to different storage and display processes according to the received log grades, the log server converts the key logs into hexadecimal digital character strings through an encryption algorithm and sends the hexadecimal digital character strings to the kernel driving process, and the encrypted information comprises modules, interfaces, positions, time and log contents of log parameters.
And step 3: and after receiving the encrypted key log sent by the log server, the kernel driving process writes the encrypted key log into Flash, and when the device is restarted, the kernel driving process reads out the log information in the Flash and stores the log information into a general log directory.
And 4, step 4: the exchanger software compiling server adds a script and generates an encryption log decryption key file in the exchanger software compiling process.
And 5: and inputting the encrypted key log file and the generated encrypted log key into a decryption tool, and outputting the key log file and the generated encrypted log key as the finished key log plaintext information.
Step 6: when equipment fails, key log information currently stored in Flash is obtained through a command and stored in a general log directory. Meanwhile, the general log directory stores the key log information of the latest restart of the device. And translating key log plaintext information by using the log decryption key of the current version and a decryption tool to perform fault location.
In the step 2, in the encryption algorithm, in order to accurately locate the position where the log occurs, when a log system is implemented, each module is assigned with a module number, and a function defined inside the module is assigned with a function number; the log generated by the common module carries the module name, the function name, the running code line number and the log generation time.
In the step 2, after receiving the key log information data, the log service process firstly analyzes the log, extracts the module name, the function name and the running code line number, and translates the module name, the function name and the running code line number into the module number, the function line number and the time generated by the log to be added to the head of the encrypted log message; and simultaneously, extracting key information in the log, such as user name, ip address information and the like, converting the key information into 16-system character strings by using an encryption algorithm, adding the 16-system character strings into the encrypted log message, and then sending the character strings to a kernel driving process.
In the step 4, the switch software compiling server adds a script, and in the switch software compiling process, an encryption log decryption key file is generated according to a predefined module and a function file.
In step 5, the key log plaintext information includes a log generation module, an interface, a location, a time, and specific content.
The invention classifies the logs into grades, and the logs with different grades are distributed to different storage and display processes, so that the fault location is simple and efficient, and the key logs are encrypted, thereby ensuring the safety of information.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (10)

1. A log information storage method is characterized by comprising the following steps:
step 1: according to the importance of the log information, dividing the log into log grades, dividing the log into a key log, an error log, an alarm log and a general log, and calling a log sending interface to send the log information to a log server;
step 2: the log processing server distributes the logs to different storage and display processes according to the received log grades, and the log server converts the key logs into hexadecimal digital character strings through an encryption algorithm and sends the hexadecimal digital character strings to the kernel driving process;
and step 3: after receiving the encrypted key log sent by the log server, the kernel driver process writes the encrypted key log into Flash;
and 4, step 4: adding a script by the switch software compiling server, and generating an encryption log decryption key file in the switch software compiling process;
and 5: inputting the encrypted key log file and the generated encrypted log key into a decryption tool, and outputting the key log file and the generated encrypted log key as finished key log plaintext information;
step 6: when equipment has a fault, acquiring key log information currently stored in Flash through a command, storing the key log information in a general log directory, and translating key log plaintext information by using a log decryption key and a decryption tool of a current version to perform fault location.
2. The method according to claim 1, wherein in the step 1, the transmitted log information carries the log level, the module generating the log, the interface, the location, the time and the specific content of the log.
3. The log information storage method according to claim 1, wherein in the step 2, the encrypted information includes a module of log parameters, an interface, a location, a time, and log contents.
4. The log information storage method according to claim 1, wherein in the step 3, when the device is restarted, the kernel driver process reads out and stores the log information in Flash to the general log directory.
5. The log information storage method according to claim 1, wherein in the step 2, in order to enable accurate location of a position where the log occurs in the encryption algorithm, each module is assigned a module number and a function defined inside the module is assigned a function number when the log system is implemented; the log generated by the common module carries the module name, the function name, the running code line number and the log generation time.
6. The log information storage method according to claim 5, wherein in the step 2, after the log service process receives the key log information data, the log is firstly analyzed, the module name, the function name and the running code line number are extracted, and the module name, the function name and the running code line number are translated into the module number, the function line number and the log generation time, which are added to the header of the encrypted log message; and simultaneously, extracting key information in the log, converting the key information into a 16-system character string by using an encryption algorithm, adding the 16-system character string into an encrypted log message, and then sending the character string to a kernel driving process.
7. The log information storage method according to claim 6, wherein in the step 4, the switch software compilation server adds a script in the step 4, and generates an encryption log decryption key file from a predefined module and a function file in a switch software compilation process.
8. The method according to claim 1, wherein in the step 5, the key log plaintext information includes a log generation module, an interface, a location, a time, and a specific content.
9. The method as claimed in claim 1, wherein in step 6, the general log directory stores the key log information of the latest restart of the device.
10. A computer-readable storage medium characterized by: the computer readable storage medium stores a computer program configured to, when invoked by a processor, implement the steps of the log information storage method of any one of claims 1 to 9.
CN202210038539.0A 2022-01-13 2022-01-13 Log information storage method and storage medium Active CN114500253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210038539.0A CN114500253B (en) 2022-01-13 2022-01-13 Log information storage method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210038539.0A CN114500253B (en) 2022-01-13 2022-01-13 Log information storage method and storage medium

Publications (2)

Publication Number Publication Date
CN114500253A true CN114500253A (en) 2022-05-13
CN114500253B CN114500253B (en) 2024-03-12

Family

ID=81511911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210038539.0A Active CN114500253B (en) 2022-01-13 2022-01-13 Log information storage method and storage medium

Country Status (1)

Country Link
CN (1) CN114500253B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050114505A1 (en) * 2003-11-26 2005-05-26 Destefano Jason M. Method and apparatus for retrieving and combining summarized log data in a distributed log data processing system
US20080215881A1 (en) * 2005-09-22 2008-09-04 Shenzhen Netcom Electronics Co., Ltd. Method Of Encrypting/Decrypting The Document And A Safety Management Storage Device And System Method Of Its Safety Management
CN102034040A (en) * 2010-11-04 2011-04-27 北京曙光天演信息技术有限公司 Log implementation method in encryption card
US20170103228A1 (en) * 2014-06-02 2017-04-13 Attila Altay Yavuz System and method for secure review of audit logs
CN109039749A (en) * 2018-08-10 2018-12-18 广州天予智能科技有限公司 A kind of acquisition of remote journal and encryption transmission system and method
CN109815203A (en) * 2019-02-12 2019-05-28 山东超越数控电子股份有限公司 A kind of log audit method and system based on block chain
CN110007956A (en) * 2019-03-29 2019-07-12 四川虹美智能科技有限公司 A kind of method and device of dynamic configuration log
CN110109841A (en) * 2019-05-17 2019-08-09 深圳前海微众银行股份有限公司 Localization method, device, equipment and the computer readable storage medium of abnormal problem
CN110222520A (en) * 2019-06-14 2019-09-10 西安电子科技大学 The keyword query method of figure encryption data is supported in cloud environment
CN111290919A (en) * 2020-02-27 2020-06-16 平安国际智慧城市科技股份有限公司 Log file generation method and device, computer equipment and storage medium
CN112784300A (en) * 2021-01-22 2021-05-11 重庆秦嵩科技有限公司 Multi-stage log encryption processing system and method
CN112910994A (en) * 2021-01-29 2021-06-04 重庆长安汽车股份有限公司 Remote uploading and acquiring method for application logs
CN113282560A (en) * 2021-06-09 2021-08-20 中国建设银行股份有限公司 Log management system and method under fast application platform and mobile terminal
CN113904865A (en) * 2021-10-28 2022-01-07 中国平安财产保险股份有限公司 Log transmission method and device based on asymmetric algorithm

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050114505A1 (en) * 2003-11-26 2005-05-26 Destefano Jason M. Method and apparatus for retrieving and combining summarized log data in a distributed log data processing system
US20080215881A1 (en) * 2005-09-22 2008-09-04 Shenzhen Netcom Electronics Co., Ltd. Method Of Encrypting/Decrypting The Document And A Safety Management Storage Device And System Method Of Its Safety Management
CN102034040A (en) * 2010-11-04 2011-04-27 北京曙光天演信息技术有限公司 Log implementation method in encryption card
US20170103228A1 (en) * 2014-06-02 2017-04-13 Attila Altay Yavuz System and method for secure review of audit logs
CN109039749A (en) * 2018-08-10 2018-12-18 广州天予智能科技有限公司 A kind of acquisition of remote journal and encryption transmission system and method
CN109815203A (en) * 2019-02-12 2019-05-28 山东超越数控电子股份有限公司 A kind of log audit method and system based on block chain
CN110007956A (en) * 2019-03-29 2019-07-12 四川虹美智能科技有限公司 A kind of method and device of dynamic configuration log
CN110109841A (en) * 2019-05-17 2019-08-09 深圳前海微众银行股份有限公司 Localization method, device, equipment and the computer readable storage medium of abnormal problem
CN110222520A (en) * 2019-06-14 2019-09-10 西安电子科技大学 The keyword query method of figure encryption data is supported in cloud environment
CN111290919A (en) * 2020-02-27 2020-06-16 平安国际智慧城市科技股份有限公司 Log file generation method and device, computer equipment and storage medium
CN112784300A (en) * 2021-01-22 2021-05-11 重庆秦嵩科技有限公司 Multi-stage log encryption processing system and method
CN112910994A (en) * 2021-01-29 2021-06-04 重庆长安汽车股份有限公司 Remote uploading and acquiring method for application logs
CN113282560A (en) * 2021-06-09 2021-08-20 中国建设银行股份有限公司 Log management system and method under fast application platform and mobile terminal
CN113904865A (en) * 2021-10-28 2022-01-07 中国平安财产保险股份有限公司 Log transmission method and device based on asymmetric algorithm

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HUNG NGUYEN; RADOSLAV IVANOV; LINH T.X. PHAN; OLEG SOKOLSKY; JAMES WEIMER; INSUP LEE: "LogSafe: Secure and Scalable Data Logger for IoT Devices", IEEE, 28 May 2018 (2018-05-28) *
刘霖;王文丰;赵跃龙;王国华;: "云存储平台下的复合加密日志容灾方法", 华中科技大学学报(自然科学版), no. 1 *

Also Published As

Publication number Publication date
CN114500253B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
CN107645562B (en) Data transmission processing method, device, equipment and system
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN110753050B (en) Method and device for generating protocol document, computer storage medium and electronic equipment
CN112422588B (en) Internet of things equipment information processing method and system
CN112784298A (en) Log desensitization method and device, computer equipment and storage medium
CN104348578B (en) The method and device of data processing
CN112487011A (en) Block chain based Internet of things terminal data chaining method and system
CN106465076A (en) Control method and terminal for short message reading
CN111327428B (en) Image information processing method and system and electronic equipment
CN102546606A (en) Telnet command filter method, network safety device and network safety system
CN113242109B (en) Method, device and equipment for checking message data
CN113792319A (en) File encryption method and device, storage medium and electronic equipment
CN114500253B (en) Log information storage method and storage medium
CN113111005A (en) Application program testing method and device
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN117201601A (en) Internet of things equipment access method, device, equipment and storage medium
CN102523221A (en) Detection method of data message and network safety detection device
US20050080659A1 (en) Server including an encoded data converter apparatus
CN115859941A (en) Real-time analysis method and device for vehicle-mounted ATC log
CN115412547A (en) File uploading method and file uploading system
CN114675989A (en) Data verification method and device, electronic equipment and storage medium
CN110995658A (en) Gateway protection method, device, computer equipment and storage medium
CN117171800B (en) Sensitive data identification method and device based on zero trust protection system
US11894981B1 (en) Systems and methods for generating soar playbooks
CN115982715A (en) Security vulnerability detection system and method based on rapid generation of data files

Legal Events

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