CN114625614A - Log processing method and device, computer equipment and storage medium - Google Patents

Log processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114625614A
CN114625614A CN202210299175.1A CN202210299175A CN114625614A CN 114625614 A CN114625614 A CN 114625614A CN 202210299175 A CN202210299175 A CN 202210299175A CN 114625614 A CN114625614 A CN 114625614A
Authority
CN
China
Prior art keywords
log
acquired
characteristic value
value data
address
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.)
Pending
Application number
CN202210299175.1A
Other languages
Chinese (zh)
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.)
Shenzhen Mingzhu Technology Co ltd
Original Assignee
Shenzhen Mingzhu 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 Shenzhen Mingzhu Technology Co ltd filed Critical Shenzhen Mingzhu Technology Co ltd
Priority to CN202210299175.1A priority Critical patent/CN114625614A/en
Publication of CN114625614A publication Critical patent/CN114625614A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a log processing method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring an off-chain address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the out-of-chain address is an address of a non-blockchain storage space for storing the log to be acquired; acquiring a log indicated by the chained foreign address; determining second characteristic value data uniquely corresponding to the acquired log; and if the second characteristic value data and the first characteristic value data are consistent, confirming that the acquired log is available. By adopting the method, the log security can be improved.

Description

Log processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of software technologies, and in particular, to a log processing method and apparatus, a computer device, and a storage medium.
Background
With the development of the computer field, a variety of program products are appeared, which usually generate logs at runtime, and related personnel can use the logs to maintain, further optimize or extract critical data from the program products. Currently, these logs are typically stored by the runtime of the program product, or the program product sends the logs to another device to store the logs.
However, in recent years, network attacks are abnormally active, malicious software threats are aggravated, data leakage events are increasing, various threats related to the network are also increasing, and there may be illegal behaviors that cause logs to be tampered, so that the information obtained by tracing the logs is not real and effective. If the information without authenticity and validity is used to carry out later work, the later work will be troublesome, and even enterprise accidents will be caused.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a log processing method, apparatus, computer device, storage medium, and computer program product capable of improving security.
In a first aspect, the present application provides a log processing method. The method comprises the following steps:
acquiring an off-chain address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the out-of-chain address is an address of a non-blockchain storage space for storing the log to be acquired;
acquiring a log indicated by the chained foreign address;
determining second characteristic value data uniquely corresponding to the acquired log;
and if the second characteristic value data and the first characteristic value data are consistent, confirming that the acquired log is available.
In one embodiment, the first characteristic value data is generated by processing the log to be acquired by using a characteristic value generation algorithm corresponding to the log to be acquired; the characteristic value data generated by the characteristic value generation algorithm aiming at the same log has uniqueness; the determining that the acquired log uniquely corresponds to the second characteristic value data includes:
acquiring a characteristic value generation algorithm which is stored in the block chain and corresponds to the log to be acquired;
and processing the acquired log by using the acquired characteristic value generation algorithm to obtain second characteristic value data uniquely corresponding to the acquired log.
In one embodiment, the log to be acquired is a log generated by a target program; the method further comprises the following steps:
if the acquired log is available, acquiring configuration information for the target program; the configuration information is stored in the block chain corresponding to the chain foreign address and the first characteristic value data;
and tracing the acquired log by using the configuration information.
In one embodiment, the log to be acquired is a log data packet which is specified to be acquired; before the off-link address of the log to be acquired stored in the acquisition block chain and the first characteristic value data uniquely corresponding to the log to be acquired, the method further comprises a log metadata chaining step; the log metadata chaining step comprises:
packing the generated logs to generate log data packets under the condition that the generated logs meet the log fragmentation conditions; determining characteristic value data of the log data packet, and storing the log data packet in a non-block chain storage space to obtain an out-chain address of the log data packet;
correspondingly storing the characteristic value data and the chain external address of the log data packet in the block chain.
In one embodiment, the log to be obtained is a log generated by an object program, and the object program runs code logic at different time points by using corresponding configuration information of different versions and generates the log to be obtained; the method further comprises the following steps:
acquiring configuration information of different versions used at different time points;
the correspondingly storing the characteristic value data and the chain foreign address of the log data packet into the blockchain comprises:
and correspondingly storing the different versions of the configuration information, the characteristic value data of the log data packet and the chain external address in the block chain.
In one embodiment, the first characteristic value data is generated by processing the log to be acquired by adopting a characteristic value generation algorithm corresponding to the log to be acquired; the correspondingly storing the characteristic value data and the chain foreign address of the log data packet into the blockchain comprises:
calling a log intelligent contract interface to process the characteristic value generation algorithm, the characteristic value data and the out-of-link address of the log data packet and generate a corresponding result;
storing the result into the blockchain.
In a second aspect, the present application further provides a log processing apparatus. The device comprises:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an off-chain address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the out-of-chain address is an address of a non-blockchain storage space for storing the log to be acquired;
a second obtaining module, configured to obtain a log indicated by the chained foreign address;
the determining module is used for determining second characteristic value data uniquely corresponding to the acquired log; and if the second characteristic value data and the first characteristic value data are consistent, confirming that the acquired log is available.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor executing the steps of the log processing method.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium has stored thereon a computer program, which is executed by a processor to perform the steps of the above-described log processing method.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program which is executed by a processor for performing the steps of the log processing method.
According to the log processing method, the log processing device, the computer equipment, the storage medium and the computer program product, the out-of-chain address of the log to be acquired stored in the block chain and the first characteristic value data uniquely corresponding to the log to be acquired are acquired; the off-chain address is an address of a non-blockchain storage space used to store the log to be obtained. It can be understood that the storage pressure of the blockchain can be reduced by using the off-chain address to store the log to be acquired instead of using the blockchain to store the log to be acquired. And the off-chain address is stored in the block chain, so that the off-chain address can be prevented from being tampered. Acquiring a log indicated by a chained external address; determining second characteristic value data uniquely corresponding to the acquired log; if the second characteristic value data and the first characteristic value data match, it is confirmed that the acquired log is available. Therefore, the acquired log is used only when the acquired log is accurate, and the truth and the effectiveness of the log are ensured. And the off-chain address and the first characteristic value data are both stored in the block chain, so that the off-chain address is kept secret, and the possibility that the log indicated by the off-chain address is tampered can be greatly reduced. Therefore, the method improves the safety and reliability of the log. The method also stores the log to be acquired in a non-blockchain storage space, so that the storage pressure of the log to be acquired on the blockchain can be greatly reduced while the safety of the log to be acquired is ensured by using the blockchain.
Drawings
FIG. 1 is a diagram of an application environment of a log processing method in one embodiment;
FIG. 2 is a flow diagram that illustrates a method for log processing, according to one embodiment;
FIG. 3 is a schematic diagram of a log processing method in one embodiment;
FIG. 4 is a flowchart illustrating a log processing method according to an embodiment
FIG. 5 is a schematic diagram of a log processing method in one embodiment;
FIG. 6 is a flowchart of a method for log processing in one embodiment;
FIG. 7 is a flowchart illustrating a method for processing logs in one embodiment;
FIG. 8 is a block diagram showing the structure of a log processing apparatus according to an embodiment;
FIG. 9 is a diagram of the internal structure of a computer device in one embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The log processing method provided by the application can be applied to the application environment shown in fig. 1. The obtaining end 110 communicates with the storage end 120 and the block chain 130 through a network. The obtaining end 110 and the storing end 120 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, portable wearable devices, independent servers, or a server cluster formed by multiple servers.
The obtaining end 110 obtains an off-link address of a log to be obtained stored in the block chain 130 and first characteristic value data uniquely corresponding to the log to be obtained; the off-chain address is an address of a non-blockchain storage space used by the storage 120 to store the log to be obtained. The retrieving end 110 retrieves the log indicated by the chain foreign address from the storing end 120. The obtaining end 110 determines the second characteristic value data uniquely corresponding to the obtained log; if the second characteristic value data and the first characteristic value data match, it is confirmed that the acquired log is available.
In an embodiment, as shown in fig. 2, a log processing method is provided, and this embodiment is illustrated by applying the method to a terminal, and it may be understood that the method may also be applied to a server, and may also be applied to a system including the terminal and the server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
s202, acquiring an off-chain address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the off-chain address is an address of a non-blockchain storage space used to store the log to be obtained.
The characteristic value data generated for the same log has uniqueness, and the characteristic value data can be used for distinguishing different logs. It can be understood that the feature values generated by different logs are inconsistent, and if the log is modified, the feature values corresponding to the log before modification and the log after modification are inconsistent.
Specifically, the terminal acquires an off-chain address of a log to be acquired stored in the block chain and first characteristic value data uniquely corresponding to the log to be acquired. The off-chain address is an address of a non-blockchain storage space for storing the log to be acquired. It can be understood that in the chain of the block and the storage of the out-of-chain address and the first characteristic value data, the out-of-chain address and the first characteristic value data can be prevented from being tampered, and the safety and confidentiality of the information are ensured. And moreover, the log is not directly stored in the block chain, but only the off-chain address corresponding to the log is stored while the safety and the confidentiality are ensured, so that the storage pressure and the reading pressure of the block chain can be greatly reduced.
In one embodiment, the log to be acquired is generated and stored by packaging the generated log under the condition that the log fragmentation condition is met.
In one embodiment, while the characteristic value data and the chain foreign address corresponding to the log to be acquired are correspondingly stored in the block chain, the terminal may also store the configuration information of the target program generating the log to be acquired in the block chain. The configuration information may also be different versions of configuration information used by the target program at different points in time.
In one embodiment, the terminal may store the characteristic value generation algorithm, the characteristic value data of the log data packet, and the chain-external address in the blockchain through the log-intelligence contract interface.
S204, acquiring the log indicated by the chain foreign address.
Specifically, the terminal accesses the out-of-chain address and acquires a log indicated by the out-of-chain address. It can be appreciated that since the off-chain address is stored in the blockchain, the security and confidentiality of the off-chain address is guaranteed. Because the off-link address is kept secret, the possibility of tampering with the log indicated by the off-link address is greatly reduced.
S206, determining second characteristic value data uniquely corresponding to the acquired log, and if the second characteristic value data is consistent with the first characteristic value data, confirming that the acquired log is available.
Specifically, the terminal processes the acquired log to obtain second characteristic value data uniquely corresponding to the acquired log. And the terminal compares the first characteristic value data with the second characteristic value data, and if the second characteristic value data is consistent with the first characteristic value data, the obtained log is confirmed to be available. And if the second characteristic value data does not accord with the first characteristic value data, confirming that the acquired log is unavailable. It can be understood that the reliability of the acquired log is further ensured by comparing the characteristic value data.
In one embodiment, the terminal may acquire a characteristic value generation algorithm for generating characteristic value data from the blockchain, and use the characteristic value algorithm to obtain second characteristic value data of the acquired log.
In one embodiment, if the obtained log is available, the terminal may obtain corresponding configuration information from the blockchain, so as to trace back the obtained log. The configuration information, the out-of-chain address and the first characteristic value data are stored in the block chain correspondingly.
The log processing method comprises the steps of acquiring an off-link address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the off-chain address is an address of a non-blockchain storage space used to store the log to be obtained. It can be understood that the storage pressure of the blockchain can be reduced by using the off-chain address to store the log to be acquired instead of using the blockchain to store the log to be acquired. And the off-chain address is stored in the block chain, so that the off-chain address can be prevented from being tampered. Acquiring a log indicated by a chained external address; determining second characteristic value data uniquely corresponding to the acquired log; if the second characteristic value data and the first characteristic value data match, it is confirmed that the acquired log is available. Therefore, the acquired log is used only when the acquired log is accurate, and the truth and the effectiveness of the log are ensured. And the off-chain address and the first characteristic value data are both stored in the block chain, so that the off-chain address is kept secret, and the possibility that the log indicated by the off-chain address is tampered can be greatly reduced. Therefore, the method improves the safety and reliability of the log. The method also stores the log to be acquired in a non-blockchain storage space, so that the storage pressure of the log to be acquired on the blockchain can be greatly reduced while the safety of the log to be acquired is ensured by using the blockchain.
In one embodiment, the first characteristic value data is generated by processing the log to be acquired by adopting a characteristic value generation algorithm corresponding to the log to be acquired; the characteristic value data generated by the characteristic value generation algorithm aiming at the same log has uniqueness; determining that the acquired log uniquely corresponds to the second characteristic value data includes: acquiring a characteristic value generation algorithm which is stored in a block chain and corresponds to a log to be acquired; and processing the acquired log by using the acquired characteristic value generation algorithm to obtain second characteristic value data uniquely corresponding to the acquired log.
Specifically, the first characteristic value data is generated by processing the log to be acquired by using a characteristic value generation algorithm corresponding to the log to be acquired. The eigenvalue generation algorithm has uniqueness with respect to the eigenvalue data generated by the same log. It will be appreciated that the eigenvalue data generated using the same eigenvalue algorithm for different logs is different. And the terminal acquires a characteristic value generation algorithm which is stored in the block chain and corresponds to the log to be acquired, and processes the acquired log by using the acquired characteristic value generation algorithm to obtain second characteristic value data which uniquely corresponds to the acquired log.
In one embodiment, the feature value generation algorithm may be a hash algorithm.
In another embodiment, the feature value generation Algorithm may be the MD5 Algorithm (Message-Digest Algorithm 5).
In this embodiment, the obtained log is processed by using the eigenvalue generation algorithm stored in the blockchain to obtain the eigenvalue data, so that the calculation mode of the eigenvalue data is effectively kept secret and cannot be tampered, thereby ensuring that the step of determining whether the obtained log is useful is reliable, and further improving the security of the log.
In one embodiment, the log to be obtained is a log generated by the target program; the method further comprises the following steps: if the acquired log is available, acquiring configuration information for the target program; the configuration information is stored in the block chain correspondingly with the out-of-chain address and the first characteristic value data; and tracing the acquired log by using the configuration information.
Specifically, the log to be acquired is a log generated by the target program. And if the acquired log is available, the terminal acquires the configuration information aiming at the target program. The configuration information, the out-of-chain address and the first characteristic value data are stored in the block chain correspondingly. The terminal can trace back the acquired log using the configuration information.
In one embodiment, the terminal may trace back the acquired log according to the existing problem, or trace back the acquired log according to the key information to be extracted, and so on.
In this embodiment, the configuration information in the block chain is acquired to trace back the acquired log, so that the configuration information is also effectively kept secret, and the reliability of processing the log is improved.
In one embodiment, the log to be obtained is a log data packet designated for obtaining; before acquiring an off-link address of a log to be acquired stored in a block chain and first characteristic value data uniquely corresponding to the log to be acquired, the method further comprises a log metadata chaining step; the log metadata chaining step comprises: packing the generated logs to generate log data packets under the condition that the generated logs meet the log fragmentation conditions; determining characteristic value data of a log data packet, and storing the log data packet in a non-block chain storage space to obtain an out-chain address of the log data packet; and correspondingly storing the characteristic value data of the log data packet and the chain external address in the block chain.
The metadata is data of data, and the log metadata is metadata of a log to be acquired, such as an out-of-link address, characteristic value data, and the like.
Specifically, the log to be acquired is a log data packet designated for acquisition. And under the condition that the generated logs meet the log fragmentation condition, the terminal packs the generated logs to generate log data packets. And the terminal determines the characteristic value data of the log data packet and stores the log data packet in the non-block chain storage space to obtain the out-chain address of the log data packet. And the terminal correspondingly stores the characteristic value data of the log data packet and the chain foreign address in the block chain.
In one embodiment, the terminal may store the time point or the fragment sequence number when the log is fragmented, so that after multiple logs are obtained, different logs may be combined according to the time point or the fragment sequence number when the logs are fragmented.
In this embodiment, under the condition that the log fragmentation condition is satisfied, the generated log is subjected to packing processing, and the related characteristic value data and the chain foreign address are correspondingly stored in the block chain. Therefore, ordered management of log storage can be realized, and arrangement and combination of multiple logs in the later period are facilitated.
In one embodiment, the log to be acquired is a log generated by the target program, and the target program runs the code logic and generates the log to be acquired at different time points by using corresponding configuration information of different versions; the method further comprises the following steps: acquiring configuration information of different versions used at different time points; correspondingly storing the characteristic value data of the log data packet and the chain external address into the block chain comprises the following steps: and correspondingly storing the configuration information of different versions, the characteristic value data of the log data packet and the chain foreign address in the block chain.
Specifically, the log to be acquired is a log generated by the target program, and the target program runs the code logic using the corresponding configuration information of different versions at different time points and generates the log to be acquired. The terminal acquires the configuration information of different versions used at different time points, and correspondingly stores the configuration information of different versions, the characteristic value data of the log data packet and the link foreign address in the block chain. It is understood that during the operation of the object program, the user may modify the configuration information so that the version of the configuration information is updated. Therefore, the configuration information and characteristic value data of different versions and the chain foreign address are correspondingly stored in the block chain, so that the log can be traced conveniently.
In one embodiment, the target program keeps the configuration information unchanged in the process of generating the log to be acquired, and the terminal correspondingly stores one version of the configuration information, the characteristic value data of the log data packet and the link foreign address in the block chain.
In one embodiment, the log to be acquired is an operation log of a big data platform, and the configuration information is configuration information of the big data platform.
In one embodiment, the terminal stores the configuration information in a blockchain by configuring an intelligent contract. Specifically, as shown in the schematic diagram of fig. 3, in the uplink preparation stage, the terminal determines that the configuration information that needs to be uplink may be configuration information of multiple versions or configuration information of one version. In the uplink stage, the terminal calls an interface for configuring the intelligent contract and stores the configuration information into the blocks of the block chain. The corresponding flow chart is as shown in fig. 4, and the terminal acquires the configuration information and invokes an interface provided by the configuration intelligent contract to trigger a related event so as to store the configuration information in the block chain. It is understood that the configuration information can be normalized and managed by linking the configuration information through the configuration intelligent contract.
In this embodiment, the terminal correspondingly stores the configuration information, the characteristic value data, and the link foreign address of different versions used at different time points in the block chain, so that the configuration information is effectively kept secret, and the log can be accurately traced, thereby ensuring the security and improving the accuracy.
In one embodiment, the first characteristic value data is generated by processing the log to be acquired by adopting a characteristic value generation algorithm corresponding to the log to be acquired; correspondingly storing the characteristic value data of the log data packet and the chain external address into the block chain comprises the following steps: calling a log intelligent contract interface processing characteristic value generation algorithm, characteristic value data and an out-link address of a log data packet, and generating a corresponding result; the results are stored into a blockchain.
Specifically, the first characteristic value data is generated by processing the log to be acquired by using a characteristic value generation algorithm corresponding to the log to be acquired. And the terminal calls a log intelligent contract interface to process a characteristic value generation algorithm, the characteristic value data and the out-link address of the log data packet and generates a corresponding result. The terminal stores the results into the blockchain.
In the present embodiment, the characteristic value generation algorithm, the characteristic value data of the log data packet, and the chain foreign address are stored by the log smart contract, so that the storage step of managing these data can be normalized, facilitating maintenance and management.
In one embodiment, the target program for generating the log to be acquired is a big data platform, the big data platform operation log collection system is used for collecting the operation log generated by the big data platform, and the processing end can use the method to complete the processing of the log. It is understood that the processing end may be a device of the big data platform operation log collection system, and may also be other devices. Specifically, as shown in fig. 5, the big data platform divides the account into different areas, such as an a area account, a B area account, and a C area account, where the account in each area may relate to multiple accounts, each account has a corresponding operation, an operation log is generated, and one operation log may be generated for one area or multiple areas. The big data platform oplog collection system collects these logs. The processing end divides the time into different stages, namely the log slicing condition is sliced according to the time. After the processing end acquires the logs from the big data platform operation log collection system, the logs generated in the stage 1 and the stage 2 can be packaged into one data packet, and the logs generated in the stage 3 and the stage 4 can be packaged into one data packet. And the processing end generates first characteristic value data corresponding to the data packet by using a characteristic value generation algorithm and stores the data packet into a non-block chain storage space. The processing side can also store the data packet to the non-blockchain storage space by calling a log intelligence contract. And the processing end stores the first characteristic value data of the data packet, the characteristic value generation algorithm and the chain external address into the block of the block chain through a log intelligent contract.
In one embodiment, oplogs of a large data platform need to be flushed for packed storage. Specifically, as shown in fig. 6, after the processing end obtains the big data platform operation log, the processing end performs data cleaning on the big data platform operation log, filters out useless data, and obtains an available big data platform operation log. The processing end judges whether a preset time slice is reached or whether the size of an available big data platform operation log reaches a preset threshold value, namely whether a preset log slicing condition is met. And when the log fragmentation condition is met, packing the available big data platform operation logs to generate a block data or a data packet, and acquiring corresponding characteristic value data, an out-link address and a characteristic value algorithm. It is to be understood that the feature value algorithm may be a hash algorithm. And the processing end calls a log intelligent contract to trigger a relevant event, and stores the characteristic value data, the out-link address and the characteristic value algorithm into the block chain. The processing end can also obtain the configuration information of different versions used at different time points, and the configuration information of different versions, the characteristic value data of the log data packet and the chain foreign address are correspondingly stored in the block chain by calling a log intelligent contract interface. In a traditional big data platform, an operation log only exists locally, and a historical operation log cannot guarantee whether the operation log is modified by others, so that whether data is real and effective or not cannot be confirmed during problem tracing. Compared with the traditional big data platform, the safety and the accuracy of the log can be ensured by the current big data platform by using the method.
In one embodiment, as shown in fig. 7, a flowchart illustrating how the obtaining end processes the log is shown. Specifically, the processing end acquires an off-chain address of a log to be acquired, which is stored in the block chain, a characteristic value generation algorithm, and first characteristic value data uniquely corresponding to the log to be acquired. The off-chain address is an address of a non-blockchain storage space used for storing the log to be acquired. And the processing end acquires the log indicated by the chain external address. And the processing end processes the acquired log by using the acquired characteristic value generation algorithm to obtain second characteristic value data uniquely corresponding to the acquired log. And the processing end compares the first characteristic value data with the second characteristic value data, and if the second characteristic value data is consistent with the first characteristic value data, the obtained log is confirmed to be available. And in the case that the acquired log is available, the processing end acquires configuration information corresponding to a chain foreign address on the block chain. The configuration information, the off-link address and the first characteristic value data are stored in the block chain correspondingly. The processing end can use the configuration information to perform problem tracing and the like on the acquired log.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flow chart may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a log processing apparatus for implementing the log processing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method, so specific limitations in one or more log processing device embodiments provided below can refer to the limitations on the log processing method in the foregoing, and details are not described herein again.
In one embodiment, as shown in fig. 8, there is provided a log processing apparatus 800 including: a first obtaining module 802, a second obtaining module 804, and a determining module 806, wherein:
a first obtaining module 802, configured to obtain an off-chain address of a log to be obtained stored in a block chain and first characteristic value data uniquely corresponding to the log to be obtained; the off-chain address is an address of a non-blockchain storage space used to store the log to be obtained.
A second obtaining module 804, configured to obtain the log indicated by the chain foreign address.
A determining module 806, configured to determine second characteristic value data uniquely corresponding to the acquired log; if the second characteristic value data and the first characteristic value data match, it is confirmed that the acquired log is available.
In one embodiment, the first characteristic value data is generated by processing the log to be acquired by adopting a characteristic value generation algorithm corresponding to the log to be acquired; the characteristic value data generated by the characteristic value generation algorithm aiming at the same log has uniqueness; the determining module 806 is further configured to obtain a feature value generation algorithm corresponding to the log to be obtained, where the feature value generation algorithm is stored in the block chain; and processing the acquired log by using the acquired characteristic value generation algorithm to obtain second characteristic value data uniquely corresponding to the acquired log.
In one embodiment, the log to be obtained is a log generated by the target program; the determining module 806 is further configured to obtain configuration information for the target program if the obtained log is available; the configuration information is stored in the block chain correspondingly with the out-of-chain address and the first characteristic value data; and tracing the acquired log by using the configuration information.
In one embodiment, the log to be obtained is a log data packet designated for obtaining; before acquiring the off-chain address of the log to be acquired stored in the block chain and the first characteristic value data uniquely corresponding to the log to be acquired, the log processing apparatus 800 is further configured to package the generated log to generate a log data packet when the generated log meets a log fragmentation condition; determining characteristic value data of a log data packet, and storing the log data packet in a non-block chain storage space to obtain an out-chain address of the log data packet; and correspondingly storing the characteristic value data of the log data packet and the chain foreign address in the block chain.
In one embodiment, the log to be acquired is a log generated by the target program, and the target program runs the code logic and generates the log to be acquired at different time points by using corresponding configuration information of different versions; the log processing apparatus 800 is further configured to obtain different versions of configuration information used at different time points; and correspondingly storing the configuration information of different versions, the characteristic value data of the log data packet and the chain foreign address in the block chain.
In one embodiment, the first characteristic value data is generated by processing the log to be acquired by adopting a characteristic value generation algorithm corresponding to the log to be acquired; the log processing device 800 is further configured to invoke a log intelligent contract interface processing characteristic value generation algorithm, characteristic value data of a log data packet, and an out-link address, and generate a corresponding result; the results are stored into a blockchain.
The log processing device acquires the out-of-chain address of the log to be acquired stored in the block chain and the first characteristic value data uniquely corresponding to the log to be acquired; the off-chain address is an address of a non-blockchain storage space used to store the log to be obtained. It can be understood that the storage pressure of the blockchain can be reduced by using the off-chain address to store the log to be acquired instead of using the blockchain to store the log to be acquired. And the off-chain address is stored in the block chain, so that the off-chain address can be prevented from being tampered. Acquiring a log indicated by a chained external address; determining second characteristic value data uniquely corresponding to the acquired log; if the second characteristic value data and the first characteristic value data match, it is confirmed that the acquired log is available. Therefore, the acquired log is used only when the acquired log is accurate, and the truth and the effectiveness of the log are ensured. And the off-chain address and the first characteristic value data are both stored in the block chain, so that the off-chain address is kept secret, and the possibility that the log indicated by the off-chain address is tampered can be greatly reduced. Therefore, the method improves the safety and reliability of the log. The method also stores the log to be acquired in the non-block chain storage space, so that the block chain is used for ensuring the safety of the log to be acquired, and the storage pressure of the log to be acquired on the block chain can be greatly reduced.
For the specific limitations of the log processing apparatus, reference may be made to the above limitations of the log processing method, which are not described herein again. The respective modules in the log processing apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, an Input/Output interface (I/O for short), and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a log processing method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 10. The computer apparatus includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected by a system bus, and the communication interface, the display unit and the input device are connected by the input/output interface to the system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a log processing method. The display unit of the computer equipment is used for forming a visual and visible picture, and can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the configurations shown in fig. 9 and 10 are merely block diagrams of some configurations relevant to the present disclosure, and do not constitute a limitation on the computing devices to which the present disclosure may be applied, and that a particular computing device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, carries out the steps in the method embodiments described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of log processing, the method comprising:
acquiring an off-chain address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the out-of-chain address is an address of a non-blockchain storage space for storing the log to be acquired;
acquiring a log indicated by the chained foreign address;
determining second characteristic value data uniquely corresponding to the acquired log;
and if the second characteristic value data and the first characteristic value data are consistent, confirming that the acquired log is available.
2. The method according to claim 1, wherein the first eigenvalue data is generated by processing the log to be acquired by using an eigenvalue generation algorithm corresponding to the log to be acquired; the characteristic value data generated by the characteristic value generation algorithm aiming at the same log has uniqueness; the determining of the second characteristic value data uniquely corresponding to the acquired log includes:
acquiring a characteristic value generation algorithm which is stored in the block chain and corresponds to the log to be acquired;
and processing the acquired log by using the acquired characteristic value generation algorithm to obtain second characteristic value data uniquely corresponding to the acquired log.
3. The method according to claim 1, wherein the log to be acquired is a log generated by a target program; the method further comprises the following steps:
if the acquired log is available, acquiring configuration information for the target program; the configuration information is stored in the block chain corresponding to the out-of-chain address and the first characteristic value data;
and tracing the acquired log by using the configuration information.
4. The method of claim 1, wherein the log to be obtained is a log data packet designated for obtaining; before the off-link address of the log to be acquired stored in the acquisition block chain and the first characteristic value data uniquely corresponding to the log to be acquired, the method further comprises a log metadata chaining step; the step of chaining the log metadata comprises the following steps:
under the condition that the generated logs meet the log slicing condition, packaging the generated logs to generate log data packets; determining characteristic value data of the log data packet, and storing the log data packet in a non-block chain storage space to obtain an out-chain address of the log data packet;
correspondingly storing the characteristic value data and the chain-external address of the log data packet in the block chain.
5. The method of claim 4, wherein the log to be obtained is a log generated by a target program, and the target program runs code logic using configuration information of corresponding different versions at different time points and generates the log to be obtained; the method further comprises the following steps:
acquiring configuration information of different versions used at different time points;
the correspondingly storing the characteristic value data and the chain foreign address of the log data packet into the blockchain comprises:
and correspondingly storing the different versions of the configuration information, the characteristic value data of the log data packet and the chain external address in the block chain.
6. The method according to claim 4, wherein the first eigenvalue data is generated by processing the log to be acquired by using an eigenvalue generation algorithm corresponding to the log to be acquired; the correspondingly storing the characteristic value data and the chain foreign address of the log data packet into the blockchain comprises:
calling a log intelligent contract interface to process the characteristic value generation algorithm, the characteristic value data and the off-link address of the log data packet and generate a corresponding result;
storing the result into the blockchain.
7. A log processing apparatus, characterized in that the apparatus comprises:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an off-chain address of a log to be acquired, which is stored in a block chain, and first characteristic value data uniquely corresponding to the log to be acquired; the out-of-chain address is an address of a non-blockchain storage space for storing the log to be acquired;
a second obtaining module, configured to obtain a log indicated by the chain foreign address;
the determining module is used for determining second characteristic value data uniquely corresponding to the acquired log; and if the second characteristic value data and the first characteristic value data are consistent, confirming that the acquired log is available.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202210299175.1A 2022-03-25 2022-03-25 Log processing method and device, computer equipment and storage medium Pending CN114625614A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210299175.1A CN114625614A (en) 2022-03-25 2022-03-25 Log processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210299175.1A CN114625614A (en) 2022-03-25 2022-03-25 Log processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114625614A true CN114625614A (en) 2022-06-14

Family

ID=81904514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210299175.1A Pending CN114625614A (en) 2022-03-25 2022-03-25 Log processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114625614A (en)

Similar Documents

Publication Publication Date Title
CN108304704B (en) Authority control method and device, computer equipment and storage medium
CN109474619B (en) Data encryption reporting method and device and data decryption method and device
CN113489713B (en) Network attack detection method, device, equipment and storage medium
CN111563365B (en) Method and device for processing modification information of test standard worksheet and computer equipment
CN112506481A (en) Service data interaction method and device, computer equipment and storage medium
CN117459327B (en) Cloud data transparent encryption protection method, system and device
CN108985096B (en) Security enhancement and security operation method and device for Android SQLite database
WO2024125108A1 (en) On-demand enabling method and apparatus for security aspect of mobile terminal
CN110930193B (en) Advertisement conversion rate evaluation method, advertisement conversion rate evaluation device, computer equipment and storage medium
CN117370701A (en) Browser risk detection method, browser risk detection device, computer equipment and storage medium
US11171995B2 (en) Identifying and mitigating risks of cryptographic obsolescence
CN109922056B (en) Data security processing method, terminal and server thereof
CN115935414A (en) Block chain based data verification method and device, electronic equipment and storage medium
CN114625614A (en) Log processing method and device, computer equipment and storage medium
CN110781500A (en) Data wind control system and method
CN114386047A (en) Application vulnerability detection method and device, electronic equipment and storage medium
KR20220073657A (en) Image-based malicious code analysis method and apparatus and artificial intelligence-based endpoint detection and response system using the same
CN111177726B (en) System vulnerability detection method, device, equipment and medium
CN112417533A (en) Anti-screenshot method and device, computer equipment and storage medium
JP7268742B2 (en) Policy evaluation device, control method, and program
CN108256320B (en) Dynamic detection method, device, equipment and storage medium for differential domain
US20220366035A1 (en) Execution control system, execution control method, and program
CN117040855A (en) Risk factor set generation and risk behavior monitoring method, device, medium and equipment
CN117675267A (en) Log processing method and device
CN110543759A (en) Malicious file detection method and device, computer equipment and storage medium

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