WO2021068488A1 - 基于区块链的日志处理方法、装置、计算机设备及存储介质 - Google Patents
基于区块链的日志处理方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2021068488A1 WO2021068488A1 PCT/CN2020/087131 CN2020087131W WO2021068488A1 WO 2021068488 A1 WO2021068488 A1 WO 2021068488A1 CN 2020087131 W CN2020087131 W CN 2020087131W WO 2021068488 A1 WO2021068488 A1 WO 2021068488A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- log
- log data
- preset
- storage
- blockchain
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/069—Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols 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]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Definitions
- This application relates to the field of data processing technology, and in particular to a log processing method, device, computer equipment, and storage medium based on blockchain.
- Log audit is an important part of information system security management. It collects various information such as system security events, user access information, and key business operations in the information system, and after processing such as standardization, filtering, and merging, it is in the form of a log in a unified format. Storage and management, combined with rich log statistics and correlation analysis functions, to achieve a comprehensive audit of information system logs. At present, the log audit system is based on a centralized database for log data storage and management.
- the inventor realizes that the existing log audit system has the following problems: On the one hand, if the log data is tampered with by an illegal intruder, it will not be able to Play the role of security audit; on the other hand, because log audit data is unilaterally collected and processed by the information service provider, if the user of the information service and the provider of the information service have a dispute over the accuracy of the information, the provision of information service The log audit data provided by the party unilaterally is difficult to be accepted.
- the embodiments of the present application provide a log processing method, device, computer equipment, and storage medium based on blockchain, aiming to solve the problem of the risk of tampering with log data.
- an embodiment of the present application provides a blockchain-based log processing method, which includes: receiving a log data storage request from the log data collection layer through a preset first interface; The second interface calls a predefined log audit smart contract and sends the log data storage request to the preset blockchain storage network, so that the storage nodes in the blockchain storage network execute the log audit smart contract and Write the log data to be stored into the blockchain for storage.
- an embodiment of the present application also provides a log processing device based on blockchain, which includes: a receiving unit configured to receive a log data storage request from the log data collection layer through a preset first interface Sending unit, used to call a predefined log audit smart contract through a preset second interface to send the log data storage request to the preset blockchain storage network, so that the blockchain storage network
- the storage node executes the log audit smart contract and writes the log data to be stored into the blockchain for storage.
- an embodiment of the present application also provides a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned blockchain-based log when the computer program is executed.
- the processing method is applied to the log data storage layer in the log audit system, the log audit system further includes a log data collection layer and a log data analysis layer, wherein the method at least includes: receiving data from all sources through a preset first interface The log data storage request of the log data collection layer; call the predefined log audit smart contract through the preset second interface to send the log data storage request to the preset blockchain storage network, so that the district The storage node in the block chain storage network executes the log audit smart contract and writes the log data to be stored into the block chain for storage.
- the embodiments of the present application also provide a computer-readable storage medium, the storage medium stores a computer program, and the computer program includes program instructions that, when executed by a processor, can implement the above-mentioned
- the log processing method of the blockchain is applied to the log data storage layer in the log audit system.
- the log audit system further includes a log data collection layer and a log data analysis layer.
- the method at least includes: An interface receives a log data storage request from the log data collection layer; calls a predefined log audit smart contract through a preset second interface to send the log data storage request to a preset blockchain storage network,
- the storage node in the blockchain storage network executes the log audit smart contract to write the log data to be stored into the blockchain for storage.
- the embodiment of the application provides a log processing method, device, computer equipment, and storage medium based on blockchain. Since the log data storage request is received through the first interface, the log data storage request is sent to the storage node through the second interface. The storage node writes the log data to the blockchain for storage, which can prevent the log data from being tampered with and improve the security and credibility of the log data.
- Figure 1 is a schematic diagram of an application scenario of a blockchain-based log processing method provided by an embodiment of the application
- FIG. 2 is a schematic flowchart of a log processing method based on a blockchain provided by an embodiment of the application
- FIG. 3 is a schematic flowchart of a log processing method based on blockchain provided by another embodiment of the application.
- FIG. 4 is a schematic flowchart of a log processing method based on blockchain provided by another embodiment of this application.
- FIG. 5 is a schematic flowchart of a log processing method based on blockchain provided by still another embodiment of the application.
- FIG. 6 is a schematic flowchart of a log processing method based on blockchain according to yet another embodiment of the application.
- FIG. 7 is a schematic block diagram of a block chain-based log processing device provided by an embodiment of the application.
- FIG. 8 is a schematic block diagram of a block chain-based log processing device provided by another embodiment of the application.
- FIG. 9 is a schematic block diagram of a block chain-based log processing device provided by another embodiment of this application.
- FIG. 10 is a schematic block diagram of a block chain-based log processing device provided by still another embodiment of the application.
- FIG. 11 is a schematic block diagram of a computer device provided by an embodiment of the application.
- FIG. 1 is a schematic diagram of an application scenario of a blockchain-based log processing method provided by an embodiment of the application.
- Fig. 2 is a schematic flowchart of a log processing method based on a blockchain provided by an embodiment of the application.
- This application is applied to the log audit system, and the specific application is in the server, which is deployed in the log data storage layer of the log audit system.
- the use of blockchain technology to ensure that the data is difficult to be tampered with, the blockchain technology and the log audit system are combined to solve the problem of the risk of tampering with the log data in the existing log audit system.
- Blockchain technology is a peer-to-peer network based on decentralization, which combines cryptographic principles with consensus mechanisms to ensure the coherence and continuity of data among distributed nodes. Realize the instant verification of information, traceability, hard to tamper with and unshielded, thus creating a private, efficient and safe shared value system.
- the existing log audit system includes: a log data collection layer 10, a log data storage layer 20, a log data analysis layer 30, and a log data display layer 40.
- Log data sources come from different applications, and user behavior on different applications forms log data, which is collected, stored, analyzed, and displayed by the log audit system.
- this application forms a blockchain storage network composed of multiple log data storage nodes at the log data storage layer to store and manage log data, instead of traditional centralized use The database stores log data.
- FIG. 2 is a schematic flowchart of a log processing method based on a blockchain provided by an embodiment of the present application. As shown in the figure, the method includes the following steps S110-S120.
- S110 Receive a log data storage request from the log data collection layer through a preset first interface.
- the log data collection layer mainly realizes the acquisition of log data from network devices, security devices, hosts, applications and databases, and realizes log parsing, filtering and aggregation through preset parsing rules. At the same time, the collected logs can be sent to the log in a unified format.
- the preset first interface is a pre-packaged high-level application interface, and its function is for the log data collection layer to write log data and for the log data analysis layer to read log data.
- the first interface is a unified data operation interface on the chain, which shields the details of the blockchain system for the log data collection layer and the log data analysis layer.
- the underlying details of the blockchain can also be operated on the blockchain storage network as a database, which makes operations on the chain more convenient. Therefore, after the log data collection layer collects the log data, it sends a log data storage request to the log data storage layer, requesting the log data storage layer to store the collected data; the log data storage layer receives the log data storage layer through the preset first interface Log data storage request, execute log data storage.
- step S110 the following step S111 is further included.
- the log data collection layer needs to wait for the log data to be uploaded to the chain to further collect the log data, and the generation speed of log data does not match the speed of log data to the chain, it will easily lead to block chain storage network congestion. For example, 1,000 log data are generated in one second, and the fastest write speed on the chain is only 100 per second, which will cause a blockage of the data on the chain. Therefore, the log data to be stored can be stored by setting the cache component, so that the collection and storage of the log data to be stored can be performed asynchronously, which greatly improves the throughput of log data and improves the performance of the log audit system.
- a single log data is too small.
- each log data is stored on the chain, which actually increases the load of the blockchain system and will result in a decrease in system performance. Therefore, multiple log data can be put on the chain as a whole, thereby reducing the frequency of operations on the chain, reducing the load of the blockchain system, and improving system performance.
- the preset threshold is the preset optimal number of log data entries for a single on-chain operation. If the number of log data entries to be stored reaches the preset threshold, If the threshold is set, the log data to be stored will be compressed.
- the compression will be performed after waiting for the number of entries of the log data to be stored to reach the preset threshold.
- different programming languages generally have corresponding compression algorithm libraries, so the log data can be compressed using the compression algorithm in the compression algorithm library.
- the java.util.zip class library can be used to compress log data. Since log data is generally in text format, after compression, the storage space requirements on the chain can be greatly reduced, and the performance of node synchronization on the chain and query from log data nodes can be improved.
- the preset second interface is a pre-packaged bottom layer block link interface
- the second interface is an interface for the log data storage layer to interact with the blockchain system.
- the preset blockchain storage network is the storage node network of the blockchain system, which includes a plurality of storage nodes, and each node communicates with each other.
- a smart contract is a computer protocol designed to spread, verify or execute a contract in an information-based way. Simply put, it is a pre-arranged computer program that can be automatically executed. As long as the contract content is specified in advance, the program will trigger the contract conditions The content of the contract is automatically executed at the time.
- the content of the contract is to store log data
- the trigger contract condition is to receive a log data storage request
- the contract condition is triggered to execute log data storage.
- the log audit smart contract has been pre-defined (in the log data storage layer) and is pre-deployed in each storage node. Therefore, after the log audit smart contract is called, the log audit smart contract can be executed.
- the log audit smart contract is called through the second interface, and the log audit smart contract is used to send the log data storage request to the blockchain storage network, and the storage in the blockchain storage network
- the node writes the log data to be stored into the blockchain for storage.
- the process of the storage node writing the log data to be stored to the blockchain mainly includes: first execute the log audit smart contract, and write the log data to be stored into the log audit smart contract , And then broadcast the log audit smart contract that writes the log data to other storage nodes in the form of blocks.
- Each storage node confirms the block through the consensus algorithm, and finally writes the confirmed block to the blockchain. Storing the log data to be stored in each storage node ensures the security and reliability of the log data.
- S132 Determine whether there is log data to be queried in the cache component.
- the log data to be queried can be obtained from the cache component, thereby greatly improving query performance.
- the log data to be queried can also be read directly from the chain of the storage node.
- the log data analysis layer sends a log data query request to the log data storage layer, and the log data storage layer receives the log data query request through the first interface, where the log data query request includes characteristic information of the log data to be queried, for example, Name, number ID, date, keywords, etc.
- the log data to be queried can be traversed and searched in the cache component by the number ID. If the log data to be queried exists in the cache component, the log data to be queried can be directly read from the cache data. If the log data to be queried does not exist in the cache component, the log audit smart contract is called through the second interface, and the log data query request is sent to the storage node using the log audit smart contract.
- the storage node uses the log data query request feature information from the zone Read the log data to be queried in the block chain.
- the same log data can be obtained from different storage nodes regularly. Compare to determine whether the log data is complete, accurate or tampered with. Specifically, first call the log audit smart contract through the second interface, use the log audit smart contract to obtain the first log data to be compared from the storage node, and then obtain the second to be compared with the same ID from the cache component Log data, compare the log data of the two to be compared. If the log data of the two to be compared are the same, it means that the log data has not been tampered with.
- the log data of the two to be compared is inconsistent, it means that the log data has been tampered and generated.
- Alarm message where the alarm message is generated in the form of an email, and the generated alarm message is sent to the email address of the administrator terminal to remind the administrator to pay attention to and deal with related risks.
- the log data to be compared is inconsistent, the log data obtained from the storage node can also be updated to the cache component to replace the tampered log data, thereby ensuring data security.
- the blockchain-based log processing method receives log data storage requests from the log data collection layer through a preset first interface; calls a predefined log audit smart contract through a preset second interface
- the log data storage request is sent to the preset blockchain storage network, so that the storage node in the blockchain storage network executes the log audit smart contract and writes the log data to be stored into the area.
- Storage in the block chain can prevent the log data from being tampered with, improve the security of the log data, reduce the space required for log data storage, and improve the performance of the log audit system.
- FIG. 7 is a schematic block diagram of a block chain-based log processing device 200 provided by an embodiment of the present application. As shown in FIG. 7, corresponding to the above block chain-based log processing method, the present application also provides a block chain-based log processing device 200.
- the blockchain-based log processing device 200 includes a unit for executing the above-mentioned blockchain-based log processing method, and the device can be configured in a server. Specifically, referring to FIG. 7, the block chain-based log processing device 200 includes: a receiving unit 210 and a sending unit 220.
- the receiving unit 210 is configured to receive a log data storage request from the log data collection layer through a preset first interface.
- the block chain-based log processing device 200 further includes: a storage unit 211.
- the storage unit 211 is configured to store the log data to be stored in a preset cache component.
- the block chain-based log processing device 200 further includes: a first judgment unit 2201 and a compression unit 2202.
- the first determining unit 2201 is configured to determine whether the number of entries of log data to be stored reaches a preset threshold
- the compression unit 2202 is configured to compress the log data to be stored if the number of entries of the log data to be stored reaches a preset threshold.
- the sending unit 220 is configured to call a predefined log audit smart contract through a preset second interface to send the log data storage request to a preset blockchain storage network, so that the blockchain storage network
- the storage node executes the log audit smart contract and writes the log data to be stored into the blockchain for storage.
- the blockchain-based log processing device 200 further includes: a query unit 231, a second judgment unit 232, a first reading unit 233, and a second reading unit 234.
- the query unit 231 is configured to receive a log data query request from the log data analysis layer through the preset first interface.
- the second determining unit 232 is configured to determine whether the log data to be queried exists in the cache component.
- the first reading unit 233 is configured to read the log data to be queried from the cache component if there is log data to be queried in the cache component.
- the second reading unit 234 is configured to, if the log data to be queried does not exist in the cache component, call the log audit smart contract through the preset second interface to send the log data query request to the storage node To read the log data to be queried from the storage node.
- the block chain-based log processing device 200 further includes: a first acquisition unit 241, a second acquisition unit 242, a comparison unit 243, and an alarm unit 244.
- the first obtaining unit 241 is configured to call the log audit smart contract through the preset second interface to obtain log data from the storage node as the first data to be compared.
- the second obtaining unit 242 is configured to obtain the corresponding log data from the cache component as the second data to be compared.
- the comparison unit 243 is configured to compare the first data to be compared with the second data to be compared.
- the alarm unit 244 is configured to generate an alarm message and send the alarm message to a preset administrator terminal if the first data to be compared is inconsistent with the second data to be compared.
- the above-mentioned block chain-based log processing device can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in FIG. 11.
- FIG. 11 is a schematic block diagram of a computer device according to an embodiment of the present application.
- the computer device 500 may be a server, where the server may be an independent server or a server cluster composed of multiple servers.
- the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
- the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
- the computer program 5032 includes program instructions. When the program instructions are executed, the processor 502 can execute a blockchain-based log processing method.
- the processor 502 is used to provide calculation and control capabilities to support the operation of the entire computer device 500.
- the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
- the processor 502 can make the processor 502 execute a blockchain-based log processing method.
- the network interface 505 is used for network communication with other devices.
- FIG. 11 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied.
- the specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
- the processor 502 is configured to run a computer program 5032 stored in the memory to implement the following steps: receive a log data storage request from the log data collection layer through a preset first interface; The second interface calls a predefined log audit smart contract and sends the log data storage request to the preset blockchain storage network, so that the storage nodes in the blockchain storage network execute the log audit smart contract and Write the log data to be stored into the blockchain for storage.
- the processor 502 after the processor 502 implements the step of receiving the log data storage request from the log data collection layer through the preset first interface, it further implements the following step: storing the log data to be stored in the preset Set in the cache component.
- the processor 502 further implements the following steps before implementing the step of invoking the log audit smart contract through the preset second interface to send the log data storage request to the preset blockchain storage network: It is determined whether the number of entries of log data to be stored reaches a preset threshold; if the number of entries of log data to be stored reaches the preset threshold, the log data to be stored is compressed.
- the processor 502 further implements the following steps: Receive a log data query request from the log data analysis layer through the preset first interface; determine whether there is log data to be queried in the cache component; if there is log data to be queried in the cache component, Read the log data to be queried from the cache component; if the log data to be queried does not exist in the cache component, call the log audit smart contract through the preset second interface to send the log data query request To the storage node to read the log data to be queried from the storage node.
- the processor 502 further implements the following steps: Invoke the log audit smart contract through the preset second interface to obtain log data from the storage node as the first data to be compared; obtain the corresponding log data from the cache component as the second data to be compared; Compare the first data to be compared with the second data to be compared; if the first data to be compared is inconsistent with the second data to be compared, an alarm message is generated and the alarm is The message is sent to the preset administrator terminal.
- the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
- the computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium.
- the program instructions are executed by at least one processor in the computer system to implement the above-mentioned blockchain-based log processing method, which is applied to the log data storage layer in the log audit system, and the log audit system further includes log data The collection layer and the log data analysis layer, wherein the method at least includes: receiving a log data storage request from the log data collection layer through a preset first interface; and invoking a predefined log audit through a preset second interface
- the smart contract sends the log data storage request to the preset blockchain storage network, so that the storage node in the blockchain storage network executes the log audit smart contract and writes the log data to be stored Store in the blockchain.
- the present application also provides a computer-readable storage medium.
- the computer-readable storage medium may be non-volatile or volatile.
- the storage medium stores a computer program, where the computer program includes program instructions.
- the processor executes the following steps: receive the log data storage request from the log data collection layer through the preset first interface; call the predefined log audit intelligence through the preset second interface Contract and send the log data storage request to the preset blockchain storage network, so that the storage node in the blockchain storage network executes the log audit smart contract and writes the log data to be stored to Store in the blockchain.
- the processor after the processor executes the program instructions to implement the step of receiving the log data storage request from the log data collection layer through the preset first interface, the processor further implements the following step:
- the stored log data is stored in a preset cache component.
- the processor executes the program instructions to implement the step of invoking the log audit smart contract through a preset second interface to send the log data storage request to a preset blockchain storage network Previously, the following steps were also implemented: judging whether the number of log data entries to be stored reaches a preset threshold; if the number of log data entries to be stored reaches the preset threshold, the log data to be stored is compressed.
- the processor executes the program instructions to implement the step of invoking the log audit smart contract through a preset second interface to send the log data storage request to a preset blockchain storage network
- the following steps are also implemented: receiving a log data query request from the log data analysis layer through the preset first interface; judging whether there is log data to be queried in the cache component; if the cache component is If there is log data to be queried, read the log data to be queried from the cache component; if the log data to be queried does not exist in the cache component, call the log audit smart contract through the preset second interface
- the log data query request is sent to the storage node to read the log data to be queried from the storage node.
- the processor executes the program instructions to implement the step of invoking the log audit smart contract through a preset second interface to send the log data storage request to a preset blockchain storage network
- the following steps are also implemented: call the log audit smart contract through the preset second interface to obtain log data from the storage node as the first data to be compared; obtain the corresponding log data from the cache component as the first data to be compared Second data to be compared; compare the first data to be compared with the second data to be compared; if the first data to be compared is inconsistent with the second data to be compared, generate Alarm message and send the alarm message to the preset administrator terminal.
- the storage medium may be a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk or an optical disk, and other computer-readable storage media that can store program codes.
- ROM Read-Only Memory
- the disclosed device and method may be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of each unit is only a logical function division, and there may be other division methods in actual implementation.
- multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
- the steps in the method in the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
- the units in the device of the embodiment of the present application may be combined, divided, and deleted according to actual needs.
- the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium.
- the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium It includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请实施例公开了一种基于区块链的日志处理方法、装置、计算机设备及存储介质。本申请应用于日志审计系统中的日志数据存储层,所述日志审计系统还包括日志数据采集层以及日志数据分析层,所述方法包括:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。本申请应用于区块链中的区块链存储系统领域。通过实施本申请实施例的方法可防止日志数据被篡改,提高日志数据的安全性和可信度。
Description
本申请要求于2019年10月12日提交中国专利局、申请号为201910969961.6,发明名称为“基于区块链的日志处理方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及数据处理技术领域,尤其涉及一种基于区块链的日志处理方法、装置、计算机设备及存储介质。
日志审计是信息系统安全管理的重要组成部分,通过采集信息系统中的系统安全事件、用户访问信息、关键业务操作等各类信息,经过规范化、过滤、归并等处理后,以统一格式的日志形式进行存储和管理,结合丰富的日志统计汇总及关联分析功能,实现对信息系统日志的全面审计。目前,日志审计系统是基于中心化的数据库进行日志数据的存储和管理的,然而,发明人意识到现有的日志审计系统存在以下问题:一方面,如果日志数据被非法入侵者篡改,将无法起到安全审计的作用;另外一方面,由于日志审计数据由信息服务的提供方单方采集和处理,如果信息服务的使用方和信息服务的提供方就信息的准确性产生争端,信息服务的提供方单方提供的日志审计数据,很难被采信。
发明内容
本申请实施例提供了一种基于区块链的日志处理方法、装置、计算机设备及存储介质,旨在解决日志数据存在被篡改风险的问题。
第一方面,本申请实施例提供了一种基于区块链的日志处理方法,其包括:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
第二方面,本申请实施例还提供了一种基于区块链的日志处理装置,其包括:接收单元,用于通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;发送单元,用于通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
第三方面,本申请实施例还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现上述基于区块链的日志处理方法,应用于日志审计系统中的日志数据存储层,所述日志审计系统还包括日志数据采集层以及日志数据分析层,其中,所述方法至少包括:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时可实现上述基于区块链的日志处理方法,应用于日志审计系统中的日志数据存储层,所述日志审计系统还包括日志数据采集层以及日志数据分析层,其中,所述方法至少包括:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
本申请实施例提供了一种基于区块链的日志处理方法、装置、计算机设备及存储介质,由于通过第一接口接收日志数据存储请求,通过第二接口将日志数据存储请求发送至存储节点,由存储节点将日志数据写入到区块链中进行存储,可实现防止日志数据被篡改,提高日志数据的安全性和可信度的效果。
图1为本申请实施例提供的基于区块链的日志处理方法的应用场景示意图;
图2为本申请实施例提供的基于区块链的日志处理方法的流程示意图;
图3为本申请另一实施例提供的基于区块链的日志处理方法的流程示意图;
图4为本申请又一实施例提供的基于区块链的日志处理方法的流程示意图;
图5为本申请再一实施例提供的基于区块链的日志处理方法的流程示意图;
图6为本申请又另一实施例提供的基于区块链的日志处理方法的流程示意图;
图7为本申请实施例提供的基于区块链的日志处理装置的示意性框图;
图8为本申请另一实施例提供的基于区块链的日志处理装置的示意性框图;
图9为本申请又一实施例提供的基于区块链的日志处理装置的示意性框图;
图10为本申请再一实施例提供的基于区块链的日志处理装置的示意性框图;以及
图11为本申请实施例提供的计算机设备的示意性框图。
请参阅图1和图2,图1为本申请实施例提供的基于区块链的日志处理方法的应用场景示意图。图2为本申请实施例提供的基于区块链的日志处理方法的示意性流程图。本申请应用于日志审计系统中,具体应用在服务器中,服务器部署在日志审计系统的日志数据存储层中。利用区块链技术保证数据难以被篡改的特性,将区块链技术与日志审计系统相结合,从而解决现有的日志审计系统中的日志数据存在被篡改风险的问题。区块链(Block Chain)技术是一种基于去中心化的对等(peer-to-peer)网络,其将密码学原理与共识机制相结合,来保障分布式各节点的数据连贯和持续,实现信息的即时验证、可追溯、难篡改和无法屏蔽,从而创造了一套隐私、高效、安全的共享价值体系。
现有的日志审计系统包括:日志数据采集层10、日志数据存储层20、日志数据分析层30以及日志数据展示层40。日志数据源来源于不同的应用,用户在不同应用上的行为形成日志数据,由日志审计系统进行采集、存储、分析以及展示。对于现有的日志审计系统进行改进,本申请在日志数据存储层,组建一个由多个日志数据存储节点构成的区块链存储网络来进行日志数据的存储和管理,以替代传统的用中心化的数据库存储日志数据。
图2是本申请实施例提供的基于区块链的日志处理方法的流程示意图。如图所示,该方法包括以下步骤S110-S120。
S110、通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求。
日志数据采集层主要实现网络设备、安全设备、主机、应用及数据库的日志数据获取,并通过预置的解析规则实现日志的解析、过滤及聚合,同时可将收集的日志统一格式后发送到日志数据存储层中。在本实施例中,预设的第一接口是预先封装的高级应用接口,其作用是供日志数据采集层写入日志数据以及供日志数据分析层读取日志数据。该第一接口是统一的链上数据操作接口,其为日志数据采集层和日志数据分析层屏蔽了区块链系统的细节,对于日志数据分析层和日志数据采集层来说,其不需要了解区块链底层的细节,比如审计日志智能合约信息,日志存储节点信息等,也即可将区块链存储网络当作是数据库进行操作即可,从而使得链上操作更加方便。因此,日志数据采集层采集到日志数据后,发送日志数据存储请求至日志数据存储层,请求日志数据存储层存储所采集的数据;日志数据存储层通过预设的第一接口接收日志采集层的日志数据存储请求,执行日志数据的存储。
在一实施例中,如图3所示,所述步骤S110之后,还包括以下步骤S111。
S111、将待存储的日志数据存储到预设的缓存组件中。
由于日志数据采集层需要等待日志数据上链完成才能进一步采集日志数 据,而日志数据的产生速度和日志数据上链的速度不匹配,就会容易导致区块链存储网络阻塞。例如,一秒钟产生了1000条的日志数据,而上链的最快写入速度只有100条每秒,这样就会造成数据上链堵塞。因此,可通过设置缓存组件来存储待存储的日志数据,这样待存储的日志数据的采集和存储即可异步进行,极大地提高了日志数据的吞吐量,提高日志审计系统的性能。
在一实施例中,如图4所示,所述步骤S120之前,还包括以下步骤S1201-S1202。
S1201、判断待存储的日志数据的条目数是否达到预设阈值。
S1202、若待存储的日志数据的条目数达到预设阈值,将待存储的日志数据进行压缩。
在部分应用场景下,单条的日志数据过小,这时对每条日志数据进行上链存储,其实是增加了区块链系统的负荷,会导致系统性能下降。因此,可将多条日志数据作为一个整体上链,从而减少链上操作频率,降低区块链系统的负荷,提高系统性能。具体地,首先判断待存储日志数据的条目数是否达到预设阈值,该预设阈值是预先设定的最优单次上链操作的日志数据条目数,若待存储日志数据的条目数达到预设阈值,则将待存储的日志数据进行压缩,若待存储日志数据的条目数未达到预设阈值,则等待待存储日志数据的条目数达到预设阈值后再进行压缩。其中,不同编程语言一般都有相应的压缩算法库,因此可利用压缩算法库中的压缩算法对日志数据进行压缩。例如,对于Java编程语言来说,可以利用java.util.zip类库进行日志数据的压缩。由于日志数据一般是文本格式,压缩后可以大大减少链上的存储空间需求,提高在链上节点同步以及从日志数据节点查询的性能。
S120、通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
在本实施例中,预设的第二接口是预先封装的底层区块链接口,该第二接口是日志数据存储层与区块链系统进行交互的接口。预设的区块链存储网络是区块链系统的存储节点网络,其包括有多个存储节点,每个节点之间相互通信连接。智能合约是一种旨在以信息化方式传播、验证或执行合同的计算机协议,简单来说是事先约定好的可以自动执行的计算机程序,只要提前规定好合约内容,程序就会在触发合约条件的时候自动执行合约内容。例如,合约的内容为存储日志数据,触发合约条件为接收到日志数据存储请求,那么当接收到日志数据存储请求,则触发合约条件执行日志数据的存储。其中,日志审计智能合约已(在日志数据存储层中)预先定义好,并在每个存储节点中预先部署,因此调用日志审计智能合约后,日志审计智能合约能被执行。在第一接口接收到 日志数据存储请求后,通过第二接口调用日志审计智能合约,利用日志审计智能合约将日志数据存储请求发送至区块链存储网络中,由区块链存储网络中的存储节点将待存储的日志数据写入到区块链中进行存储。
其中,在区块链存储网络中,存储节点将待存储的日志数据写入到区块链的过程主要包括:首先执行日志审计智能合约,将待存储的日志数据写入到日志审计智能合约中,然后将写入日志数据的日志审计智能合约以区块的形式广播到其他存储节点,各个存储节点通过共识算法确认区块,最后再将确认后的区块写入到区块链中,从而将待存储的日志数据的存储到各个存储节点中,保证了日志数据的安全性和可靠性。
在一实施例中,如图5所示,所述步骤S120之后,还包括以下步骤S131-S134。
S131、通过所述预设的第一接口接收来自所述日志数据分析层的日志数据查询请求。
S132、判断所述缓存组件中是否存在待查询的日志数据。
S133、若所述缓存组件中存在待查询的日志数据,从所述缓存组件中读取待查询的日志数据。
S134、若所述缓存组件中不存在待查询的日志数据,通过所述预设的第二接口调用日志审计智能合约将所述日志数据查询请求发送至所述存储节点以从所述存储节点中读取待查询的日志数据。
在一实施例中,由于区块链网络中的存储节点工作负载较高时,从链上查询日志数据的性能也会跟随下降。因此,为了提高查询效率,可从缓存组件中获取待查询的日志数据,由此可以大大提高查询性能。当然可以理解的是,也可直接从存储节点的链上读取待查询的日志数据。具体地,日志数据分析层发送日志数据查询请求至日志数据存储层,日志数据存储层通过第一接口接收日志数据查询请求,其中,日志数据查询请求中包括有待查询日志数据的特征信息,例如,名称、编号ID、日期以及关键字等。接着判断缓存组件中是否存在待查询的日志数据,可通过编号ID在缓存组件中遍历查找,若缓存组件中存在待查询的日志数据,则可直接从缓存数据中读取待查询的日志数据。若缓存组件中不存在待查询的日志数据,则通过第二接口调用日志审计智能合约,利用日志审计智能合约将日志数据查询请求发送至存储节点,存储节点根据日志数据查询请求的特征信息从区块链中读取待查询的日志数据。
在一实施例中,如图6所示,所述步骤S120之后,还包括以下步骤S141-S144。
S141、通过所述预设的第二接口调用日志审计智能合约从所述存储节点中获取日志数据作为第一待比对数据。
S142、从所述缓存组件中获取对应的日志数据作为第二待比对数据。
S143、将所述第一待比对数据与所述第二待比对数据进行比对。
S144、若所述第一待比对数据与所述第二待比对数据不一致,生成报警消息并将所述报警消息发送至预设的管理员终端。
在一实施例中,由于存储在缓存组件的日志数据依然存在被篡改的风险,因此,为了避免有恶意攻击者篡改缓存组件的日志数据,可定期从不同的存储节点中获取相同的日志数据进行比对,从而判断日志数据是否完整、准确或者被篡改。具体地,首先通过第二接口调用日志审计智能合约,利用日志审计智能合约从存储节点中获取第一待比对的日志数据,然后从缓存组件中获取同一个编号ID的第二待比对的日志数据,将两待比对的日志数据进行比对,若两待比对的日志数据一致,则说明日志数据未被篡改,若两待比对的日志数据不一致,说明日志数据被篡改,生成报警消息,其中,该报警消息是以邮件的形式生成,将生成的报警消息邮件发送至管理员终端的邮件地址,以提示管理员关注并处理相关的风险。若两待比对的日志数据不一致,还可将从存储节点中获取的日志数据更新到缓存组件中,以替换被篡改的日志数据,从而保证数据的安全性。
本申请所提供的基于区块链的日志处理方法,通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储,可以防止日志数据被篡改,提高日志数据的安全性,减小日志数据存储所需空间,提高日志审计系统的性能。
图7是本申请实施例提供的一种基于区块链的日志处理装置200的示意性框图。如图7所示,对应于以上基于区块链的日志处理方法,本申请还提供一种基于区块链的日志处理装置200。该基于区块链的日志处理装置200包括用于执行上述基于区块链的日志处理方法的单元,该装置可以被配置于服务器中。具体地,请参阅图7,该基于区块链的日志处理装置200包括:接收单元210以及发送单元220。
接收单元210,用于通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求。
在一实施例中,如图8所示,所述基于区块链的日志处理装置200还包括:存储单元211。
存储单元211,用于将待存储的日志数据存储到预设的缓存组件中。
在一实施例中,如图9所示,所述基于区块链的日志处理装置200还包括:第一判断单元2201以及压缩单元2202。
第一判断单元2201,用于判断待存储的日志数据的条目数是否达到预设阈值;
压缩单元2202,用于若待存储的日志数据的条目数达到预设阈值,将待存储的日志数据进行压缩。
发送单元220,用于通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
在一实施例中,如图8所示,所述基于区块链的日志处理装置200还包括:查询单元231、第二判断单元232、第一读取单元233以及第二读取单元234。
查询单元231,用于通过所述预设的第一接口接收来自所述日志数据分析层的日志数据查询请求。
第二判断单元232,用于判断所述缓存组件中是否存在待查询的日志数据。
第一读取单元233,用于若所述缓存组件中存在待查询的日志数据,从所述缓存组件中读取待查询的日志数据。
第二读取单元234,用于若所述缓存组件中不存在待查询的日志数据,通过所述预设的第二接口调用日志审计智能合约将所述日志数据查询请求发送至所述存储节点以从所述存储节点中读取待查询的日志数据。
在一实施例中,如图10所示,所述基于区块链的日志处理装置200还包括:第一获取单元241、第二获取单元242、比对单元243以及报警单元244。
第一获取单元241,用于通过所述预设的第二接口调用日志审计智能合约从所述存储节点中获取日志数据作为第一待比对数据。
第二获取单元242,用于从所述缓存组件中获取对应的日志数据作为第二待比对数据。
比对单元243,用于将所述第一待比对数据与所述第二待比对数据进行比对。
报警单元244,用于若所述第一待比对数据与所述第二待比对数据不一致,生成报警消息并将所述报警消息发送至预设的管理员终端。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述基于区块链的日志处理装置200和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
上述基于区块链的日志处理装置可以实现为一种计算机程序的形式,该计算机程序可以在如图11所示的计算机设备上运行。
请参阅图11,图11是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500可以是服务器,其中,服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。
参阅图11,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储 器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032包括程序指令,该程序指令被执行时,可使得处理器502执行一种基于区块链的日志处理方法。
该处理器502用于提供计算和控制能力,以支撑整个计算机设备500的运行。
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种基于区块链的日志处理方法。
该网络接口505用于与其它设备进行网络通信。本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现如下步骤:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
在一实施例中,处理器502在实现所述通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求步骤之后,还实现如下步骤:将待存储的日志数据存储到预设的缓存组件中。
在一实施例中,处理器502在实现所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络步骤之前,还实现如下步骤:判断待存储的日志数据的条目数是否达到预设阈值;若待存储的日志数据的条目数达到预设阈值,将待存储的日志数据进行压缩。
在一实施例中,处理器502在实现所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络步骤之后,还实现如下步骤:通过所述预设的第一接口接收来自所述日志数据分析层的日志数据查询请求;判断所述缓存组件中是否存在待查询的日志数据;若所述缓存组件中存在待查询的日志数据,从所述缓存组件中读取待查询的日志数据;若所述缓存组件中不存在待查询的日志数据,通过所述预设的第二接口调用日志审计智能合约将所述日志数据查询请求发送至所述存储节点以从所述存储节点中读取待查询的日志数据。
在一实施例中,处理器502在实现所述通过预设的第二接口调用日志审计 智能合约将所述日志数据存储请求发送至预设的区块链存储网络步骤之后,还实现如下步骤:通过所述预设的第二接口调用日志审计智能合约从所述存储节点中获取日志数据作为第一待比对数据;从所述缓存组件中获取对应的日志数据作为第二待比对数据;将所述第一待比对数据与所述第二待比对数据进行比对;若所述第一待比对数据与所述第二待比对数据不一致,生成报警消息并将所述报警消息发送至预设的管理员终端。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序包括程序指令,计算机程序可存储于一存储介质中,该存储介质为计算机可读存储介质。该程序指令被该计算机系统中的至少一个处理器执行,以实现上述基于区块链的日志处理方法,该方法应用于日志审计系统中的日志数据存储层,所述日志审计系统还包括日志数据采集层以及日志数据分析层,其中,所述方法至少包括:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
因此,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性。该存储介质存储有计算机程序,其中计算机程序包括程序指令。该程序指令被处理器执行时使处理器执行如下步骤:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
在一实施例中,所述处理器在执行所述程序指令而实现所述通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求步骤之后,还实现如下步骤:将待存储的日志数据存储到预设的缓存组件中。
在一实施例中,所述处理器在执行所述程序指令而实现所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络步骤之前,还实现如下步骤:判断待存储的日志数据的条目数是否达到预设阈值;若待存储的日志数据的条目数达到预设阈值,将待存储的日志数据 进行压缩。
在一实施例中,所述处理器在执行所述程序指令而实现所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络步骤之后,还实现如下步骤:通过所述预设的第一接口接收来自所述日志数据分析层的日志数据查询请求;判断所述缓存组件中是否存在待查询的日志数据;若所述缓存组件中存在待查询的日志数据,从所述缓存组件中读取待查询的日志数据;若所述缓存组件中不存在待查询的日志数据,通过所述预设的第二接口调用日志审计智能合约将所述日志数据查询请求发送至所述存储节点以从所述存储节点中读取待查询的日志数据。
在一实施例中,所述处理器在执行所述程序指令而实现所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络步骤之后,还实现如下步骤:通过所述预设的第二接口调用日志审计智能合约从所述存储节点中获取日志数据作为第一待比对数据;从所述缓存组件中获取对应的日志数据作为第二待比对数据;将所述第一待比对数据与所述第二待比对数据进行比对;若所述第一待比对数据与所述第二待比对数据不一致,生成报警消息并将所述报警消息发送至预设的管理员终端。
所述存储介质可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的计算机可读存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质 上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
Claims (10)
- 一种基于区块链的日志处理方法,应用于日志审计系统中的日志数据存储层,所述日志审计系统还包括日志数据采集层以及日志数据分析层,其中,所述方法包括:通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
- 根据权利要求1所述的基于区块链的日志处理方法,其中,所述通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求之后,还包括:将待存储的日志数据存储到预设的缓存组件中。
- 根据权利要求1所述的基于区块链的日志处理方法,其中,所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络之前,还包括:判断待存储的日志数据的条目数是否达到预设阈值;若待存储的日志数据的条目数达到预设阈值,将待存储的日志数据进行压缩。
- 根据权利要求2所述的基于区块链的日志处理方法,其中,所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络之后,还包括:通过所述预设的第一接口接收来自所述日志数据分析层的日志数据查询请求;判断所述缓存组件中是否存在待查询的日志数据;若所述缓存组件中存在待查询的日志数据,从所述缓存组件中读取待查询的日志数据;若所述缓存组件中不存在待查询的日志数据,通过所述预设的第二接口调用日志审计智能合约将所述日志数据查询请求发送至所述存储节点以从所述存储节点中读取待查询的日志数据。
- 根据权利要求2所述的基于区块链的日志处理方法,其中,所述通过预设的第二接口调用日志审计智能合约将所述日志数据存储请求发送至预设的区块链存储网络之后,还包括:通过所述预设的第二接口调用日志审计智能合约从所述存储节点中获取日志数据作为第一待比对数据;从所述缓存组件中获取对应的日志数据作为第二待比对数据;将所述第一待比对数据与所述第二待比对数据进行比对;若所述第一待比对数据与所述第二待比对数据不一致,生成报警消息并将所述报警消息发送至预设的管理员终端。
- 一种基于区块链的日志处理装置,其中,包括:接收单元,用于通过预设的第一接口接收来自所述日志数据采集层的日志数据存储请求;发送单元,用于通过预设的第二接口调用预定义的日志审计智能合约而将所述日志数据存储请求发送至预设的区块链存储网络,以使所述区块链存储网络中的存储节点执行所述日志审计智能合约而将待存储的日志数据写入到区块链中进行存储。
- 根据权利要求6所述的基于区块链的日志处理装置,其中,所述基于区块链的日志处理装置还包括:存储单元,用于将待存储的日志数据存储到预设的缓存组件中。
- 根据权利要求6所述的基于区块链的日志处理装置,其中,所述基于区块链的日志处理装置还包括:第一判断单元,用于判断待存储的日志数据的条目数是否达到预设阈值;压缩单元,用于若待存储的日志数据的条目数达到预设阈值,将待存储的日志数据进行压缩。
- 一种计算机设备,其中,所述计算机设备包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现如权利要求1-5中任一项所述的方法。
- 一种计算机可读存储介质,其中,所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时可实现如权利要求1-5中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910969961.6A CN111092745A (zh) | 2019-10-12 | 2019-10-12 | 基于区块链的日志处理方法、装置、计算机设备及存储介质 |
CN201910969961.6 | 2019-10-12 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021068488A1 true WO2021068488A1 (zh) | 2021-04-15 |
Family
ID=70393012
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/087131 WO2021068488A1 (zh) | 2019-10-12 | 2020-04-27 | 基于区块链的日志处理方法、装置、计算机设备及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111092745A (zh) |
WO (1) | WO2021068488A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114020726A (zh) * | 2021-11-26 | 2022-02-08 | 中国电力科学研究院有限公司 | 基于多元日志数据分析的日志审计方法、系统、设备及介质 |
CN115378803A (zh) * | 2022-04-13 | 2022-11-22 | 网易(杭州)网络有限公司 | 日志管理方法、装置、区块链节点和存储介质 |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112235243A (zh) * | 2020-09-10 | 2021-01-15 | 李文华 | 一种基于Web应用安全的日志审计安全平台 |
CN112448946B (zh) * | 2020-11-09 | 2024-03-19 | 北京工业大学 | 基于区块链的日志审计方法及装置 |
CN112732480A (zh) * | 2020-12-29 | 2021-04-30 | 中钞信用卡产业发展有限公司杭州区块链技术研究院 | 数据库管理方法、装置、设备及存储介质 |
CN112818056A (zh) * | 2020-12-31 | 2021-05-18 | 杭州趣链科技有限公司 | 一种区块链的日志安全共享方法、系统与装置 |
CN113411206B (zh) * | 2021-05-26 | 2022-09-06 | 北京沃东天骏信息技术有限公司 | 一种日志审计方法、装置、设备和计算机存储介质 |
CN113746665B (zh) * | 2021-07-29 | 2022-04-15 | 深圳市明源云科技有限公司 | 日志数据处理方法、装置及存储介质 |
CN113779056B (zh) * | 2021-09-15 | 2024-06-14 | 湖南麒麟信安科技股份有限公司 | 批量审计日志处理方法、装置和计算机设备 |
CN117692149B (zh) * | 2024-01-25 | 2024-05-07 | 鹏城实验室 | 一种日志透明实体诚实性的检验方法、设备以及介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170206235A1 (en) * | 2015-04-09 | 2017-07-20 | Commvault Systems, Inc. | Management of log data |
CN108446407A (zh) * | 2018-04-12 | 2018-08-24 | 北京百度网讯科技有限公司 | 基于区块链的数据库审计方法和装置 |
CN108833514A (zh) * | 2018-06-01 | 2018-11-16 | 众安信息技术服务有限公司 | 基于区块链的审计日志处理方法、装置和日志审计系统 |
CN109190410A (zh) * | 2018-09-26 | 2019-01-11 | 华中科技大学 | 一种云存储环境下的基于区块链的日志行为审计方法 |
CN109286676A (zh) * | 2018-10-15 | 2019-01-29 | 国网上海市电力公司 | 一种基于区块链的电力数据安全信息系统 |
US10324893B1 (en) * | 2011-12-15 | 2019-06-18 | Veritas Technologies Llc | Backup application catalog analyzer |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10164952B2 (en) * | 2016-02-16 | 2018-12-25 | Xerox Corporation | Method and system for server based secure auditing for revisioning of electronic document files |
CN108900505B (zh) * | 2018-06-28 | 2020-08-11 | 中国科学院软件研究所 | 一种基于区块链技术的集群审计管控方法 |
CN109656778B (zh) * | 2018-11-28 | 2022-07-12 | 金蝶软件(中国)有限公司 | 数据获取方法、装置、计算机设备和存储介质 |
-
2019
- 2019-10-12 CN CN201910969961.6A patent/CN111092745A/zh active Pending
-
2020
- 2020-04-27 WO PCT/CN2020/087131 patent/WO2021068488A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10324893B1 (en) * | 2011-12-15 | 2019-06-18 | Veritas Technologies Llc | Backup application catalog analyzer |
US20170206235A1 (en) * | 2015-04-09 | 2017-07-20 | Commvault Systems, Inc. | Management of log data |
CN108446407A (zh) * | 2018-04-12 | 2018-08-24 | 北京百度网讯科技有限公司 | 基于区块链的数据库审计方法和装置 |
CN108833514A (zh) * | 2018-06-01 | 2018-11-16 | 众安信息技术服务有限公司 | 基于区块链的审计日志处理方法、装置和日志审计系统 |
CN109190410A (zh) * | 2018-09-26 | 2019-01-11 | 华中科技大学 | 一种云存储环境下的基于区块链的日志行为审计方法 |
CN109286676A (zh) * | 2018-10-15 | 2019-01-29 | 国网上海市电力公司 | 一种基于区块链的电力数据安全信息系统 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114020726A (zh) * | 2021-11-26 | 2022-02-08 | 中国电力科学研究院有限公司 | 基于多元日志数据分析的日志审计方法、系统、设备及介质 |
CN115378803A (zh) * | 2022-04-13 | 2022-11-22 | 网易(杭州)网络有限公司 | 日志管理方法、装置、区块链节点和存储介质 |
CN115378803B (zh) * | 2022-04-13 | 2023-12-12 | 网易(杭州)网络有限公司 | 日志管理方法、装置、区块链节点和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN111092745A (zh) | 2020-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021068488A1 (zh) | 基于区块链的日志处理方法、装置、计算机设备及存储介质 | |
US11343268B2 (en) | Detection of network anomalies based on relationship graphs | |
US11921873B1 (en) | Authenticating data associated with a data intake and query system using a distributed ledger system | |
US20230144450A1 (en) | Multi-partitioning data for combination operations | |
US10754989B2 (en) | Runtime self-correction for blockchain ledgers | |
TW202013234A (zh) | 資料處理方法、設備以及儲存媒介 | |
WO2018196650A1 (zh) | 用户特征数据的获取方法、装置、服务器及介质 | |
CN111698126B (zh) | 信息监控方法、系统及计算机可读存储介质 | |
CN111881011A (zh) | 日志管理方法、平台、服务器及存储介质 | |
CN107301215B (zh) | 一种搜索结果缓存方法及装置、搜索方法及装置 | |
US11922222B1 (en) | Generating a modified component for a data intake and query system using an isolated execution environment image | |
CN112214519B (zh) | 一种数据查询方法、装置、设备及可读介质 | |
US11178160B2 (en) | Detecting and mitigating leaked cloud authorization keys | |
US20210126922A1 (en) | Method and system to rate limit access to data endpoints with potential privacy risk | |
US11533323B2 (en) | Computer security system for ingesting and analyzing network traffic | |
CN111740868A (zh) | 告警数据的处理方法和装置及存储介质 | |
US20070261061A1 (en) | System and method of aggregating and consolidating security event data | |
US20210075817A1 (en) | Method and system for variable or static rate limiting of javascript functions with potential for privacy risk | |
CN112818014A (zh) | 区块链数据解析方法、装置和电子设备 | |
WO2022057525A1 (zh) | 一种数据找回方法、装置、电子设备及存储介质 | |
US10909131B1 (en) | Method and system for indexing and searching data sub-streams | |
CN111078418B (zh) | 操作同步方法、装置、电子设备及计算机可读存储介质 | |
CN112988798A (zh) | 一种日志处理方法、装置、设备及介质 | |
CN115328509A (zh) | 算法变更方法、装置、计算机设备及存储介质 | |
CN115225544A (zh) | 一种网络流量统计和监测方法、装置、电子设备及介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20875343 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18/08/2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20875343 Country of ref document: EP Kind code of ref document: A1 |