CN114491674A - Log processing method, device and equipment based on block chain - Google Patents

Log processing method, device and equipment based on block chain Download PDF

Info

Publication number
CN114491674A
CN114491674A CN202210143457.2A CN202210143457A CN114491674A CN 114491674 A CN114491674 A CN 114491674A CN 202210143457 A CN202210143457 A CN 202210143457A CN 114491674 A CN114491674 A CN 114491674A
Authority
CN
China
Prior art keywords
system operation
log
operation log
storage
block chain
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
CN202210143457.2A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210143457.2A priority Critical patent/CN114491674A/en
Publication of CN114491674A publication Critical patent/CN114491674A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Abstract

The disclosure provides a log processing method, device and equipment based on a block chain, and relates to a block chain technology in the technical field of computers. The method comprises the following steps: receiving a log storage request sent by terminal equipment, wherein the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, the identification information represents a unique identification of system operation, the system operation log is sent to a block chain to be stored, an association exists between the system operation log and the storage identification in the block chain, the storage identification is determined according to the identification information and uplink time of the system operation log, and the uplink time represents the time for storing the system operation log into the block chain, so that the system operation log stored into the block chain is prevented from being lost or tampered, the data security of the system operation log is improved, and the required system operation log record can be conveniently and quickly inquired in the block chain.

Description

Log processing method, device and equipment based on block chain
Technical Field
The present disclosure relates to a block chain in computer technology, and in particular, to a log processing method, apparatus, and device based on a block chain.
Background
A user may generate a large amount of logs while using the system, for example, the user often executes a file copy command, a file move command, a file delete command, and the like while operating the system kernel. In work and life, a plurality of systems are provided for users, and a large amount of logs of each system are generated in the process of operating the systems.
In the prior art, the generated system operation log can be stored locally; or storing the generated system operation log to the cloud.
However, the above method may cause the loss or tampering of the system operation log, and thus the data security is low.
Disclosure of Invention
The disclosure provides a block chain-based log processing method, a block chain-based log processing device and a block chain-based log processing device for improving data security.
According to a first aspect of the present disclosure, a block chain-based log processing method is provided, including:
receiving a log storage request sent by a terminal device, wherein the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation;
and sending the system operation log to a block chain for storage, wherein the system operation log in the block chain is associated with a storage identifier, and the storage identifier is determined according to the identifier information and the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain.
According to a second aspect of the present disclosure, there is provided a block chain-based log processing method, including:
receiving a system operation log to be stored, which is sent by an uplink server, wherein the system operation log carries identification information, and the identification information represents a unique identification of system operation;
storing the system operation log into a block chain, and obtaining the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain;
generating a storage identifier according to the identifier information and the uplink time of the system operation log;
and associating the storage identification with a system operation log in the block chain.
According to a third aspect of the present disclosure, there is provided a block chain-based log processing apparatus, including:
the system comprises a first receiving unit, a second receiving unit and a third receiving unit, wherein the first receiving unit is used for receiving a log storage request sent by a terminal device, the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation;
and the sending unit is used for sending the system operation log to a block chain for storage, wherein a correlation exists between the system operation log in the block chain and a storage identifier, and the storage identifier is determined according to the identifier information and the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain.
According to a fourth aspect of the present disclosure, there is provided a block chain-based log processing apparatus, including:
a third receiving unit, configured to receive a system operation log to be stored, where the system operation log carries identification information, and the identification information represents a unique identifier of a system operation;
the storage unit is used for storing the system operation log into a block chain and obtaining the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain;
a generating unit, configured to generate a storage identifier according to the identifier information and the uplink time of the system operation log;
and the association unit is used for associating the storage identifier with the system operation logs in the block chain.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect; or to enable the at least one processor to perform the method of the second aspect.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first aspect; alternatively, the computer instructions are for causing the computer to perform the method of the second aspect.
According to a seventh aspect of the present disclosure, there is provided a computer program product comprising: a computer program stored in a readable storage medium, from which the computer program can be read by at least one processor of an electronic device, execution of the computer program by the at least one processor causing the electronic device to perform the method of the first aspect; alternatively, execution of the computer program by the at least one processor causes the electronic device to perform the method of the second aspect.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is an application scenario diagram of a method for block chain-based log processing according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 3 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 4 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
FIG. 6 is a schematic diagram according to a fifth embodiment of the present disclosure;
FIG. 7 is a schematic diagram according to a sixth embodiment of the present disclosure;
FIG. 8 is a schematic diagram according to a seventh embodiment of the present disclosure;
FIG. 9 is a schematic diagram according to an eighth embodiment of the present disclosure;
fig. 10 is a block diagram of an electronic device used to implement a method of blockchain-based log processing of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
A user can generate a large amount of logs when using the system, for example, when operating a sensitive system kernel, the user often executes sensitive commands such as file copy (cp), file move (mv), file delete (rm), and the like; or in a background system, commands such as deletion and addition of an administrator are executed. The commands may cause unrecoverable influence on the current system, and the commands generated by the user when operating the system can be recorded in a log so as to track and audit the user operation in the following process. If a user is provided with a plurality of systems, the user may generate a large amount of logs of the respective systems in the process of operating the systems.
In an example, the operation logs of the user on the system can be saved to the local logs by means of the local log system, which cannot ensure that the logs are not modified, resulting in a technical problem that the data security of the operation logs of the system is low, and a technical problem that log reading cannot be performed once the local service is down.
In another example, the operation log of the user on the system can be saved to the cloud by means of an external remote service, which still cannot ensure that the log is not maliciously tampered by the remote service, resulting in a technical problem that the data security of the operation log of the system is low.
In order to avoid at least one of the above technical problems, the inventors of the present disclosure have made creative efforts to obtain the inventive concept of the present disclosure: and storing the system operation log to be stored into the block chain to obtain the uplink time of the system operation log, and performing associated storage on the storage identifier generated according to the identifier information representing the system operation and the uplink time of the system operation log and the system operation log in the block chain.
Based on the inventive concept, the present disclosure provides a log processing method, device and apparatus based on a block chain, which are applied to the block chain in the computer technology field to improve the data security of the system operation log and facilitate the reading of the system operation log record.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
Fig. 1 is an application scenario diagram of a log processing method based on a blockchain according to an embodiment of the present disclosure, where a server 101 establishes communication connections with a terminal device 102 and a blockchain 103, respectively. The user can log in the system through the terminal device 102, a system operation log is generated when the user operates the system, the terminal device 102 initiates a log storage request to the server 101, and the server 101 sends the system operation log to the block chain 103 for storage after receiving the log storage request.
Fig. 2 is a schematic diagram according to a first embodiment of the present disclosure. The log processing method based on the block chain in the embodiment of the present disclosure is applied to the server 101 in fig. 1, and as shown in fig. 2, the log processing method based on the block chain in the embodiment of the present disclosure includes:
s201, receiving a log storage request sent by a terminal device, wherein the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation.
The system operation log is generated by operations triggered by a user in a system, each system operation corresponds to an identifier, the identifier is a unique identifier for distinguishing other system operations, and is similar to identity representation, so that the uniqueness of the system operation log is conveniently embodied on a block chain, and the system operation can be tracked later.
Illustratively, a user logs in a system through a terminal device, when the user triggers a related operation in the system, the system automatically generates a system operation log corresponding to the operation, and automatically triggers a log storage request, where the system operation log corresponding to the triggered operation is the system operation log to be stored.
The system refers to a system which is accessed with a log uplink service in advance, and when a user triggers a related operation in the system, the system automatically calls a log uplink method, specifically, a storage interface in a Software Development Kit (SDK) is called, and a log storage request is sent to a server. The related operation may be any operation triggered by the user in the system, or may be a preset operation, such as copying, moving, deleting, uploading, downloading, and the like.
The log storage request carries a system operation log to be stored, the server obtains the system operation log to be stored after receiving the log storage request, and the system operation log carries identification information corresponding to system operation.
S202, the system operation log is sent to a block chain to be stored, the system operation log in the block chain is associated with a storage identifier, and the storage identifier is determined according to the identifier information and the uplink time of the system operation log, wherein the uplink time represents the time of storing the system operation log into the block chain.
The server forwards the system operation log to the blockchain for storage. The block chain comprises a plurality of nodes, intelligent contracts are deployed on the nodes, the server can automatically transmit and store information with the nodes of the block chain according to the intelligent contracts on the nodes, then the nodes storing the system operation logs broadcast to other nodes according to a consensus mechanism of the block chain, and the other nodes verify and confirm the data security of the system operation logs, so that the data security of the system operation logs is ensured.
And the block chain determines the time corresponding to the successful storage of the system operation log into the block chain as the uplink time of the system operation log, records the uplink time of the system operation log, generates a storage identifier according to the identification information and the uplink time of the system operation log, and associates the storage identifier with the system operation log in the block chain.
The storage identifier can be used as a query index of the system operation logs in the block chain, so as to quickly and flexibly query the required system operation log records in the block chain.
And associating the storage identifier with the system operation logs in the block chain, so that each system operation log in the block chain is associated with one storage identifier, and inquiring the system operation log associated with the storage identifier in the block chain through the storage identifier.
Based on the above analysis, an embodiment of the present disclosure provides a log processing method based on a block chain, including: receiving a log storage request sent by terminal equipment, wherein the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation; the method comprises the steps of storing a system operation log into a block chain, wherein the system operation log in the block chain is associated with a storage identifier, the storage identifier generates a storage identifier according to identification information and uplink time of the system operation log, and the storage identifier is associated with the system operation log in the block chain, wherein the uplink time represents the time for storing the system operation log into the block chain. In this embodiment, a technical feature of storing a to-be-stored system operation log indicated in a log storage request into a block chain is introduced, so that a problem that data security of the system operation log is low due to the fact that the system operation log cannot be guaranteed to be accidentally lost or maliciously tampered based on a local or cloud storage system operation log in a related technology is solved, and the system operation log stored into the block chain can be prevented from being lost or tampered by using distributed storage property, high security and non-tampering property of the block chain, so that data security of the system operation log is improved, and the system operation log can be conveniently tracked and audited subsequently; and the storage identifier generated according to the identification information representing the system operation and the uplink time of the system operation log is stored in association with the system operation log in the block chain, so that the required system operation log record can be inquired in the block chain quickly through the storage identifier.
Fig. 3 is a schematic diagram according to a second embodiment of the present disclosure. The log processing method based on the block chain in the embodiment of the present disclosure is applied to the server 101 in fig. 1, and as shown in fig. 3, the log processing method based on the block chain in the embodiment of the present disclosure includes:
s301, receiving a log storage request sent by a terminal device, wherein the log storage request is used for indicating a system operation log to be stored, and the system operation log carries identification information which represents a unique identification of system operation.
It should be noted that, the features of this embodiment that are the same as those of the above embodiment are not described again in this embodiment.
In some embodiments, the identification information includes a system identification of the system being operated, and a user identification. The system identifier is used for distinguishing different systems, and the user identifier is used for distinguishing different users. The same user may have operation logs in multiple systems, and the operation logs in different systems can be isolated through different system identifications.
In the embodiment, the system operation is characterized by combining the system identifier and the user identifier, so that the operation log record of a specific user in a specific system can be queried specifically through the system identifier and the user identifier subsequently.
S302, determining account information corresponding to the identification information, and determining quota requirement information corresponding to the log storage request, wherein the quota requirement information represents a quota required by a system operation log indicated by the log storage request.
The account information refers to block chain wallet account information, and each system accessing the log uplink service corresponds to one block chain wallet account. The account information corresponding to the identification information may be the account information corresponding to the system indicated by the system identifier determined according to the system identifier in the identification information.
Invoking the smart contract to store the system oplog into the blockchain requires spending a certain amount of tokens. The amount required by storing the system operation log can be understood as the number of tokens required to be spent for calling an intelligent contract to store the system operation log into the block chain, and the amount can be estimated and obtained based on the data size of the system operation log, the network congestion condition and other information.
And S303, if the balance information in the account information is determined to meet the limit requirement information, sending the system operation log to a block chain for storage, wherein the system operation log in the block chain is associated with a storage identifier, and the storage identifier is determined according to the identification information and the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain.
The balance information in the account information can be understood as the current token amount in the blockchain wallet account corresponding to the system, the balance information in the account information meets the information of the limit requirement, and the current token amount in the blockchain wallet account corresponding to the system is not less than the token amount required to be spent for calling the intelligent contract to store the system operation log in the blockchain.
In some embodiments, if it is determined that the balance information in the account information does not satisfy the credit line requirement information, that is, the current number of tokens in the blockchain wallet account corresponding to the system is less than the number of tokens required to be spent for calling an intelligent contract to store the system operation log in the blockchain, the system operation log is transferred to the blockchain wallet account corresponding to the system, so that the system operation log is stored in the blockchain when the balance information in the account information satisfies the credit line requirement information.
Illustratively, the block chain wallet account corresponding to the system is a common account, a contract account is arranged on the server side, and the contract account holds all tokens and can transfer the tokens to the common account.
In this embodiment, when it is determined that the balance information in the account information satisfies the information required by the quota, the system operation log is stored in the block chain, so that storage failure due to insufficient account balance is avoided, and the storage success rate is improved.
In some embodiments, sending the system operation log to the block chain for storage may include the following steps: storing the system operation log to a cache region; and calling the system operation log from the cache region, and sending the called system operation log to the block chain for storage.
For example, the same user may perform multiple operations on the same system at the same time, for example, a deletion operation is performed while a copy operation is performed, and at this time, multiple system operation logs are generated at the same time, and a concurrent log storage request is triggered. When receiving a concurrent log storage request, the server stores each system operation log indicated in the concurrent log storage request into a cache region, and then calls each system operation log from the cache region one by one and sends the system operation logs to a block chain for storage.
In this embodiment, a buffer is introduced to temporarily store each system operation log indicated in the concurrent log storage request, and then each system operation log is stored into the block chain one by one, so as to avoid network congestion caused by directly storing all system operation logs indicated in the concurrent log storage request into the block chain and error reporting caused by concurrently modifying the shared state, thereby implementing concurrency control and improving the storage success rate.
In some embodiments, the system oplogs in the cache have priority information; the method for retrieving the system operation log from the cache region specifically includes the following steps: and calling the system operation log according to the priority information of the system operation log.
The priority information is used for representing the priority, namely the sequence, of the system operation logs in the cache region. When a plurality of system operation logs exist in the cache region, the system operation logs are called in sequence according to the priority of the system operation logs. Illustratively, the higher the priority of the system oplog, the earlier it is called.
In one example, the buffer area uses a blocking queue, and queues each system operation log indicated in the concurrent log storage request on a first-in first-out basis through the blocking queue.
In this embodiment, priority information is introduced to characterize and determine the order in which the system operation logs in the cache region are called, so that each system operation log in the cache region is stored into the block chain in order, and the concurrency control effect is improved.
In some embodiments, the priority information is any one or more of: the system operation log generation method comprises the steps of the system priority corresponding to the system operation log, the user priority corresponding to the system operation log, the priority input by a user, the generation time of the system operation log and the size of the system operation log.
For example, priorities may be set in advance for different systems, and/or different users, and/or different operations, and for each system operation log indicated in multiple log storage requests triggered simultaneously in the cache, the system operation log with the highest system, and/or user, and/or operation priority may be invoked preferentially.
The order of retrieval may be determined based on the generation time of each system operation log in the cache region, and the earlier the generation time of the system operation log is, the earlier the order of retrieval is.
The calling sequence can also be determined according to the size of each system operation log, and the smallest system operation log in the system operation logs indicated in a plurality of log storage requests triggered simultaneously in the cache region is called preferentially.
In this embodiment, the priority information is determined by one or more of the system priority, the user priority, the operation priority, the generation time of the system operation log, and the size of the system operation log, so that each system operation log in the cache region can be stored in the block chain in order, and the concurrency control effect is improved.
In some embodiments, sending the system operation log to the block chain for storage may include the following steps: determining a block chain to be stored according to the block chain information of the block chain; and sending the system operation log indicated by the log storage request to the determined block chain to be stored for storage.
The block chain to be stored refers to a block chain to which a system operation log indicated by the log storage request is to be stored. The system can access a plurality of log uplink services in advance, namely, the system operation log generated by the user in the system can be selectively stored in the block chain. The server firstly determines a block chain to be stored according to the block chain information of the block chain, and then stores the system operation log indicated by the log storage request to the determined block chain to be stored.
In this embodiment, by determining the block chain to be stored first and then storing the system operation log indicated by the log storage request to the determined block chain to be stored, more selectivity and better flexibility can be provided for log storage, which is beneficial to improving the storage success rate.
In some embodiments, the blockchain information is any one or more of: the remaining storable space of the blockchain, the total storage space of the blockchain, the priority of the blockchain.
For example, the block chain with the largest remaining storable space, or the largest total storage space, or the highest priority may be determined as the block chain to be stored.
In this embodiment, the block chain to be stored is determined according to one or more of the remaining storable space of the block chain, the total storage space of the block chain, and the priority of the block chain, which is helpful for determining the block chain that can better meet the storage requirement, and improves the storage success rate.
Fig. 4 is a schematic diagram according to a third embodiment of the present disclosure. The log processing method based on the block chain in the embodiment of the present disclosure is applied to the server 101 in fig. 1, and as shown in fig. 4, the log processing method based on the block chain in the embodiment of the present disclosure includes:
s401, receiving a log storage request sent by a terminal device, wherein the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation.
S402, the system operation log is sent to a block chain to be stored, the system operation log in the block chain is associated with a storage identifier, and the storage identifier is determined according to the identifier information and the uplink time of the system operation log, wherein the uplink time represents the time of storing the system operation log into the block chain.
It should be noted that, the features of this embodiment that are the same as those of the above embodiment are not described again in this embodiment.
And S403, feeding back response information to the terminal equipment, wherein the response information represents whether the system operation log indicated by the log storage request is successfully stored.
If the server successfully stores the system operation log indicated by the log storage request into the block chain, the response information may include a hash value to indicate a call link and block information when the system operation log is stored. The response message may also include a cochain time to indicate when the system oplog was successfully stored in the blockchain.
By feeding back the response information to the terminal equipment, the storage result of the system operation log can be fed back, and the user can find abnormal problems in the system operation log storage in time.
S404, receiving a log query request sent by the terminal device, wherein the log query request comprises identification information.
Illustratively, a user logs in a system through a terminal device, when the user triggers a log query operation in the system, the system automatically triggers a log query request, and invokes a query interface in a Software Development Kit (SDK) to send the log query request to a server.
The log query request carries identification information, the identification information in the log query request is used for representing an operation identification of a system operation log to be queried, and the server acquires the identification information from the log query request after receiving the log query request.
S405, determining a storage identifier corresponding to the identifier information in the log query request.
In some embodiments, determining the storage identity corresponding to the identification information in the log query request may include the steps of: and determining the storage identifier corresponding to the identifier information in the log query request according to the corresponding relation between the pre-stored identifier information and the storage identifier.
By presetting the corresponding relation between the identification information and the storage identification, after the identification information in the log query request is obtained, the storage identification corresponding to the identification information in the log query request can be determined according to the identification information in the log query request and the corresponding relation between the identification information and the storage identification, so that the required system operation log record can be queried in the block chain according to the determined storage identification.
In some embodiments, the log query request further includes a link up time; determining a storage identity corresponding to the identification information in the log query request may include the steps of: and splicing the identification information in the log query request and the uplink time to obtain a storage identification corresponding to the identification information in the log query request.
The log query request also carries uplink time, the uplink time in the log query request is used for representing the uplink time of the system operation log to be queried, and the server acquires the uplink time from the log query request after receiving the log query request.
The identification information in the log query request and the uplink time are spliced to determine the storage identification corresponding to the identification information in the log query request, so that the required system operation log record can be queried in the block chain according to the determined storage identification.
S406, according to the determined storage identifier, inquiring a system operation log associated with the determined storage identifier from the block chain, and feeding back the inquired system operation log to the terminal device.
The system operation logs stored in the blockchain are associated with the storage identifiers, so that the system operation logs in the blockchain have a corresponding relationship with the storage identifiers. After the server determines the storage identifier corresponding to the identifier information in the log query request, the server can query the system operation log associated with the determined storage identifier from the block chain according to the determined storage identifier and the corresponding relationship between the system operation log and the storage identifier in the block chain, and feed back the queried system operation log to the terminal device, so that a user can conveniently check the system operation log record, and the system operation log can be conveniently tracked and audited.
Fig. 5 is a schematic diagram according to a fourth embodiment of the present disclosure. The log processing method based on the block chain in the embodiment of the present disclosure is applied to the block chain 103 in fig. 1, and as shown in fig. 5, the log processing method based on the block chain in the embodiment of the present disclosure includes:
s501, receiving a system operation log to be stored, wherein the system operation log is sent by a server and carries identification information, and the identification information represents a unique identification of system operation.
The system operation log is generated by operations triggered by a user in a system, each system operation corresponds to an identifier, the identifier is a unique identifier for distinguishing other system operations, and is similar to identity representation, so that the uniqueness of the system operation log is conveniently embodied on a block chain, and the system operation can be tracked later.
Illustratively, a user logs in a system through a terminal device, when the user triggers a related operation in the system, the system automatically generates a system operation log corresponding to the operation, and automatically triggers a log storage request, where the system operation log corresponding to the triggered operation is the system operation log to be stored.
The system refers to a system which is accessed with a log uplink service in advance, and when a user triggers a related operation in the system, the system automatically calls a log uplink method, specifically, a storage interface in a Software Development Kit (SDK) is called, and a log storage request is sent to a server. The related operation may be any operation triggered by the user in the system, or may be a preset operation, such as copying, moving, deleting, uploading, downloading, and the like.
The log storage request carries a system operation log to be stored, the server obtains the system operation log to be stored after receiving the log storage request, and the system operation log carries identification information corresponding to system operation.
The server forwards the system operation log to be stored to the block chain, and the block chain receives the system operation log to be stored sent by the server.
S502, store the system operation log into the block chain, and obtain a uplink time of the system operation log, wherein the uplink time represents a time when the system operation log is stored into the block chain.
The block chain comprises a plurality of nodes, intelligent contracts are deployed on the nodes, the system operation logs are stored on the block chain nodes according to the intelligent contracts on the nodes, then the nodes storing the system operation logs broadcast to other nodes according to a consensus mechanism of the block chain, and the other nodes verify and confirm the data security of the system operation logs.
And the block chain determines the corresponding time when the system operation log is successfully stored in the block chain as the uplink time of the system operation log, and records the uplink time of the system operation log.
S503, generating a storage identifier according to the identifier information and the uplink time of the system operation log.
The storage identifier can be used as a query index of the system operation logs in the block chain, so as to quickly and flexibly query the required system operation log records in the block chain.
S504, the storage identification is associated with the system operation log in the block chain.
And associating the storage identifier with the system operation logs in the block chain, so that each system operation log in the block chain is associated with one storage identifier, and inquiring the system operation log associated with the storage identifier in the block chain through the storage identifier.
Based on the above analysis, an embodiment of the present disclosure provides a log processing method based on a block chain, including: receiving a system operation log to be stored, which is sent by a server, wherein the system operation log carries identification information, and the identification information represents a unique identification of system operation; storing the system operation log into a block chain, and obtaining the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain; generating a storage identifier according to the identifier information and the uplink time of the system operation log; the storage identity is associated with a system operation log in the blockchain. In this embodiment, a technical feature of storing a system operation log to be stored in a block chain is introduced, so that a problem that the data security of the system operation log is low due to the fact that the system operation log cannot be guaranteed to be accidentally lost or maliciously tampered based on a local or cloud storage system operation log in a related technology is solved, and the system operation log stored in the block chain can be prevented from being lost or tampered by utilizing the distributed storage property, high security and non-tampering property of the block chain, so that the data security of the system operation log is improved, and the system operation log can be conveniently tracked and audited subsequently; and the storage identifier generated according to the identification information representing the system operation and the uplink time of the system operation log is stored in association with the system operation log in the block chain, so that the required system operation log record can be inquired in the block chain quickly through the storage identifier.
In some embodiments, the identification information includes a system identification of the system being operated, and a user identification. The system identifier is used for distinguishing different systems, and the user identifier is used for distinguishing different users. The same user may have operation logs in multiple systems, and the operation logs in different systems can be isolated through different system identifications.
In the embodiment, the system operation is characterized by combining the system identifier and the user identifier, so that the operation log record of a specific user in a specific system can be queried specifically through the system identifier and the user identifier subsequently.
In some embodiments, generating the stored identity according to the identity information and the uplink time of the system operation log may include the following steps: determining primary key values corresponding to the system identification and the user identification according to a preset mapping relation, wherein the mapping relation represents the corresponding relation among the system identification, the user identification and the primary key values; and splicing the obtained primary key value and the uplink time to obtain a storage identifier.
The primary key value is an identifier capable of determining system operation log records generated in the same system by the same user, and the system operation log records generated in the system corresponding to the primary key value by the user corresponding to the primary key value can be inquired in the block chain through the primary key value.
The method comprises the steps of splicing a primary key value and uplink time to obtain a storage identifier, and inquiring a system operation log record which is generated in a system corresponding to the primary key value and stored in the uplink time by a user corresponding to the primary key value in a block chain through the storage identifier.
In this embodiment, the storage identifier is obtained by determining the primary key values corresponding to the system identifier and the user identifier and splicing the primary key values and the uplink time, so that the system operation log record in a certain system of a certain user in a certain time period can be conveniently queried from the blockchain through the storage identifier, and the personalized log record query requirement can be met.
In some embodiments, generating the stored identity according to the identity information and the uplink time of the system operation log may include the following steps: and splicing the system identification, the user identification and the uplink time to obtain a storage identification.
For example, the uplink time may be an uplink date, i.e. a unit of day. For example, if the system id, the user id, and the uplink time of a system oplog are A, a and 20220101, respectively, the storage id of the system oplog is a + 20220101. It can be understood that the storage identifiers of a plurality of system operation logs generated in the same system by the same user on the same day are the same, that is, all system operation logs generated in a certain system by a certain user on a certain day can be queried through the storage identifiers.
In this embodiment, the system identifier, the user identifier, and the uplink time are spliced to obtain the storage identifier, which facilitates querying a system operation log record in a certain system of a certain user within a certain time period from the block chain through the storage identifier, so as to meet a requirement for querying a personalized log record.
Fig. 6 is a schematic diagram according to a fifth embodiment of the present disclosure. The block chain based log processing method according to the embodiment of the present disclosure is applied to the server 101 in fig. 1, and as shown in fig. 6, the block chain based log processing apparatus 600 according to the embodiment of the present disclosure includes:
the first receiving unit 601 is configured to receive a log storage request sent by a terminal device, where the log storage request is used to indicate a system operation log to be stored, and the system operation log carries identification information that represents a unique identifier of a system operation.
A sending unit 602, configured to send the system operation log to a block chain for storage, where a relationship exists between the system operation log in the block chain and a storage identifier, and the storage identifier is determined according to the identifier information and a uplink time of the system operation log, where the uplink time represents a time when the system operation log is stored in the block chain.
In some embodiments, the identification information includes a system identification of the system being operated, and a user identification.
Fig. 7 is a schematic diagram according to a sixth embodiment of the present disclosure. The block chain based log processing method according to the embodiment of the present disclosure is applied to the server 101 in fig. 1, and as shown in fig. 7, the block chain based log processing apparatus 700 according to the embodiment of the present disclosure includes:
the first receiving unit 701 is configured to receive a log storage request sent by a terminal device, where the log storage request is used to indicate a system operation log to be stored, and the system operation log carries identification information, where the identification information represents a unique identifier of a system operation.
A first determining unit 702, configured to determine account information corresponding to the identification information, and determine quota requirement information corresponding to the log storage request, where the quota requirement information represents a quota required for storing the system operation log indicated by the log storage request.
A sending unit 703, configured to send the system operation log to the block chain for storage if it is determined that the balance information in the account information meets the information of the quota requirement, where a relationship exists between the system operation log in the block chain and a storage identifier, and the storage identifier is determined according to the identification information and the uplink time of the system operation log, where the uplink time represents time for storing the system operation log into the block chain.
As can be seen in fig. 6, in some embodiments, the sending unit 703 includes:
and the cache module 7031 is configured to store the system operation log in a cache region.
And a calling module 7032, configured to call the system operation log from the cache region.
And the first sending module 7033 is configured to send the called system operation log to the block chain for storage.
In some embodiments, the system oplogs in the cache have priority information; the retrieving module 7032 is configured to retrieve the system operation log according to the priority information of the system operation log.
In some embodiments, the priority information is any one or more of: the system operation log generation method comprises the steps of the system priority corresponding to the system operation log, the user priority corresponding to the system operation log, the priority input by a user, the generation time of the system operation log and the size of the system operation log.
As shown in fig. 6, in some embodiments, the sending unit 703 further includes:
a first determining module 7034, configured to determine a block chain to be stored according to block chain information of the block chain;
a second sending module 7035, configured to send the system operation log indicated by the log storage request to the determined block chain to be stored for storage.
In some embodiments, the blockchain information is any one or more of: the remaining storable space of the blockchain, the total storage space of the blockchain, the priority of the blockchain.
As can be seen in conjunction with fig. 7, in some embodiments, the apparatus 700 further comprises:
a feedback unit 704, configured to feed back response information to the terminal device, where the response information indicates whether the system operation log indicated by the log storage request is successfully stored.
As can be seen in conjunction with fig. 7, in some embodiments, the apparatus 700 further comprises:
the second receiving unit 705 is configured to receive a log query request sent by a terminal device, where the log query request includes identification information.
A second determining unit 706, configured to determine a storage identifier corresponding to the identification information in the log query request.
An inquiring unit 707, configured to inquire, according to the determined storage identifier, a system operation log associated with the determined storage identifier from the block chain, and feed back the inquired system operation log to the terminal device.
In some embodiments, the second determining unit 706 is configured to determine the storage identifier corresponding to the identification information in the log query request according to a correspondence between pre-stored identification information and the storage identifier.
In some embodiments, the log query request further includes a link up time; the second determining unit 706 is configured to perform concatenation processing on the identifier information and the uplink time in the log query request to obtain a storage identifier corresponding to the identifier information in the log query request.
Fig. 8 is a schematic diagram according to a seventh embodiment of the present disclosure. As shown in fig. 8, a block chain-based log processing apparatus 800 according to an embodiment of the present disclosure includes:
a third receiving unit 801, configured to receive a system operation log to be stored, where the system operation log carries identification information, and the identification information represents a unique identifier of a system operation.
The storage unit 802 is configured to store the system operation log into the block chain, and obtain a uplink time of the system operation log, where the uplink time represents a time when the system operation log is stored into the block chain.
The generating unit 803 is configured to generate a storage identifier according to the identifier information and the uplink time of the system operation log.
An associating unit 804, configured to associate the storage identifier with the system operation log.
In some embodiments, the identification information includes a system identification of the system being operated, and a user identification.
In some embodiments, the generating unit 803 includes:
the second determining module is used for determining the primary key values corresponding to the system identifier and the user identifier according to a preset mapping relation, wherein the mapping relation represents the corresponding relation among the system identifier, the user identifier and the primary key values;
and the splicing module is used for splicing the obtained primary key value and the uplink time to obtain the storage identifier.
In some embodiments, the generating unit 803 is configured to perform a concatenation process on the system identifier, the user identifier, and the uplink time to obtain a stored identifier.
Fig. 9 is a schematic diagram according to an eighth embodiment of the present disclosure. As shown in fig. 9, an electronic device 900 in the present disclosure may include: a processor 901 and a memory 902.
A memory 902 for storing programs; the Memory 902 may include a volatile Memory (RAM), such as a Static Random Access Memory (SRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), and the like; the memory may also comprise a non-volatile memory, such as a flash memory. The memory 902 is used to store computer programs (e.g., applications, functional modules, etc. that implement the above-described methods), computer instructions, etc., which may be stored in one or more of the memories 902 in a partitioned manner. And the above-described computer programs, computer instructions, data, and the like, can be called by the processor 701.
The computer programs, computer instructions, etc. described above may be stored in one or more memories 902 in partitions. And the above-mentioned computer program, computer instruction, etc. can be called by the processor 901.
A processor 901 for executing the computer program stored in the memory 902 to implement the steps of the method according to the above embodiments.
Reference may be made in particular to the description relating to the preceding method embodiment.
The processor 901 and the memory 902 may be separate structures or may be an integrated structure integrated together. When the processor 901 and the memory 902 are separate structures, the memory 902 and the processor 901 may be coupled by a bus 903.
The electronic device of this embodiment may execute the technical solution in the method, and the specific implementation process and the technical principle are the same, which are not described herein again.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
FIG. 10 illustrates a schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the device 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 executes the respective methods and processes described above, such as a block chain-based log processing method. For example, in some embodiments, the blockchain-based log processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the above-described block chain based log processing method may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the blockchain-based log processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (35)

1. A log processing method based on a block chain comprises the following steps:
receiving a log storage request sent by a terminal device, wherein the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation;
and sending the system operation log to a block chain for storage, wherein the system operation log in the block chain is associated with a storage identifier, and the storage identifier is determined according to the identifier information and the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain.
2. The method of claim 1, wherein the identification information includes a system identification of the operated system, and a user identification.
3. The method of claim 1 or 2, wherein sending the system operation log into a block chain for storage comprises:
storing the system operation log to a cache region;
and calling the system operation log from the cache region, and sending the called system operation log to a block chain for storage.
4. The method of claim 3, wherein the system oplogs in the cache have priority information; retrieving the system operation log from the cache area, including:
and calling the system operation log according to the priority information of the system operation log.
5. The method of claim 4, wherein the priority information is any one or more of: the system operation log generation method comprises the steps of the system priority corresponding to the system operation log, the user priority corresponding to the system operation log, the priority input by a user, the generation time of the system operation log and the size of the system operation log.
6. The method of any of claims 1-5, wherein sending the system oplog into a blockchain for storage comprises:
determining a block chain to be stored according to the block chain information of the block chain;
and sending the system operation log indicated by the log storage request to the determined block chain to be stored for storage.
7. The method of claim 6, wherein the blockchain information is any one or more of: the remaining storable space of the blockchain, the total storage space of the blockchain, the priority of the blockchain.
8. The method of any of claims 1-7, wherein prior to sending the system oplog into a blockchain for storage, further comprising:
determining account information corresponding to the identification information, and determining quota requirement information corresponding to the log storage request, wherein the quota requirement information represents a quota required for storing a system operation log indicated by the log storage request;
sending the system operation log to a block chain for storage, wherein the storage comprises the following steps:
and if the balance information in the account information is determined to meet the limit requirement information, sending the system operation log to a block chain for storage.
9. The method according to any one of claims 1-8, further comprising:
and feeding back response information to the terminal equipment, wherein the response information represents whether the system operation log indicated by the log storage request is successfully stored.
10. The method according to any one of claims 1-9, further comprising:
receiving a log query request sent by the terminal equipment, wherein the log query request comprises identification information;
determining a storage identifier corresponding to the identifier information in the log query request;
and inquiring a system operation log associated with the determined storage identifier from the block chain according to the determined storage identifier, and feeding back the inquired system operation log to the terminal equipment.
11. The method of claim 10, wherein determining a storage identity corresponding to the identification information in the log query request comprises:
and determining a storage identifier corresponding to the identifier information in the log query request according to the corresponding relation between the pre-stored identifier information and the storage identifier.
12. The method of claim 10, wherein the log query request further includes a link up time; determining a storage identifier corresponding to the identification information in the log query request, including:
and splicing the identification information and the uplink time in the log query request to obtain a storage identification corresponding to the identification information in the log query request.
13. A log processing method based on a block chain comprises the following steps:
receiving a system operation log to be stored, which is sent by a server, wherein the system operation log carries identification information, and the identification information represents a unique identification of system operation;
storing the system operation log into a block chain, and obtaining the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain;
generating a storage identifier according to the identifier information and the uplink time of the system operation log;
and associating the storage identification with a system operation log in the block chain.
14. The method of claim 13, wherein the identification information includes a system identification of the operated system, and a user identification.
15. The method of claim 14, wherein generating a stored identity based on the identity information and a uplink time of the system oplog comprises:
determining a primary key value corresponding to the system identifier and the user identifier according to a preset mapping relation, wherein the mapping relation represents the corresponding relation among the system identifier, the user identifier and the primary key value;
and splicing the obtained primary key value and the uplink time to obtain the storage identifier.
16. The method of claim 14, wherein generating a stored identity based on the identity information and a uplink time of the system oplog comprises:
and splicing the system identifier, the user identifier and the uplink time to obtain the storage identifier.
17. A blockchain-based log processing apparatus, comprising:
the system comprises a first receiving unit, a second receiving unit and a third receiving unit, wherein the first receiving unit is used for receiving a log storage request sent by a terminal device, the log storage request is used for indicating a system operation log to be stored, the system operation log carries identification information, and the identification information represents a unique identification of system operation;
and the sending unit is used for sending the system operation log to a block chain for storage, wherein a correlation exists between the system operation log in the block chain and a storage identifier, and the storage identifier is determined according to the identifier information and the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain.
18. The apparatus of claim 17, wherein the identification information comprises a system identification of the operated system, and a user identification.
19. The apparatus of claim 17 or 18, wherein the transmitting unit comprises:
the cache module is used for storing the system operation log to a cache region;
the calling module is used for calling the system operation log from the cache region;
and the first sending module is used for sending the called system operation log to a block chain for storage.
20. The apparatus of claim 19, wherein a system oplog in the cache has priority information; the calling module is used for calling the system operation log according to the priority information of the system operation log.
21. The apparatus of claim 20, wherein the priority information is any one or more of: the system operation log generation method comprises the steps of the system priority corresponding to the system operation log, the user priority corresponding to the system operation log, the priority input by a user, the generation time of the system operation log and the size of the system operation log.
22. The apparatus according to any of claims 17-21, wherein the transmitting unit further comprises:
the first determining module is used for determining the block chain to be stored according to the block chain information of the block chain;
and the second sending module is used for sending the system operation log indicated by the log storage request to the determined block chain to be stored for storage.
23. The apparatus of claim 22, wherein the blockchain information is any one or more of: the remaining storable space of the blockchain, the total storage space of the blockchain, the priority of the blockchain.
24. The apparatus of any of claims 17-23, further comprising:
the first determining unit is used for determining account information corresponding to the identification information and determining quota requirement information corresponding to the log storage request, wherein the quota requirement information represents a quota required for storing a system operation log indicated by the log storage request;
and the sending unit is used for sending the system operation log to a block chain for storage if the balance information in the account information is determined to meet the limit requirement information.
25. The apparatus of any of claims 17-24, further comprising:
and the feedback unit is used for feeding back response information to the terminal equipment, wherein the response information represents whether the system operation log indicated by the log storage request is successfully stored or not.
26. The apparatus of any of claims 17-25, further comprising:
a second receiving unit, configured to receive a log query request sent by the terminal device, where the log query request includes identification information;
a second determining unit, configured to determine a storage identifier corresponding to the identifier information in the log query request;
and the query unit is used for querying the system operation log associated with the determined storage identifier from the block chain according to the determined storage identifier and feeding back the queried system operation log to the terminal equipment.
27. The apparatus of claim 26, wherein the second determining unit is configured to determine the storage identifier corresponding to the identifier information in the log query request according to a correspondence between pre-stored identifier information and storage identifiers.
28. The apparatus of claim 26, wherein the log query request further includes a link up time; the second determining unit is configured to perform splicing processing on the identification information and the uplink time in the log query request to obtain a storage identifier corresponding to the identification information in the log query request.
29. A blockchain-based log processing apparatus, comprising:
the third receiving unit is used for receiving a system operation log to be stored, wherein the system operation log is sent by a server and carries identification information, and the identification information represents a unique identification of system operation;
the storage unit is used for storing the system operation log into a block chain and obtaining the uplink time of the system operation log, wherein the uplink time represents the time for storing the system operation log into the block chain;
a generating unit, configured to generate a storage identifier according to the identifier information and the uplink time of the system operation log;
and the association unit is used for associating the storage identifier with the system operation logs in the block chain.
30. The apparatus of claim 29, wherein the identification information comprises a system identification of the operated system, and a user identification.
31. The apparatus of claim 30, wherein the generating unit comprises:
the second determining module is used for determining the primary key values corresponding to the system identifier and the user identifier according to a preset mapping relation, wherein the mapping relation represents the corresponding relation among the system identifier, the user identifier and the primary key values;
and the splicing module is used for splicing the obtained primary key value and the uplink time to obtain the storage identifier.
32. The apparatus of claim 30, wherein the generating unit is configured to perform a concatenation on the system identifier, the user identifier, and the uplink time to obtain the stored identifier.
33. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12; or to enable the at least one processor to perform the method of any of claims 13-16.
34. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-12; alternatively, the computer instructions are for causing the computer to perform the method of any of claims 13-16.
35. A computer program product comprising a computer program which, when executed by a processor, carries out the steps of the method of any one of claims 1 to 12; alternatively, the computer program when executed by a processor implements the steps of the method of any one of claims 13 to 16.
CN202210143457.2A 2022-02-16 2022-02-16 Log processing method, device and equipment based on block chain Pending CN114491674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210143457.2A CN114491674A (en) 2022-02-16 2022-02-16 Log processing method, device and equipment based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210143457.2A CN114491674A (en) 2022-02-16 2022-02-16 Log processing method, device and equipment based on block chain

Publications (1)

Publication Number Publication Date
CN114491674A true CN114491674A (en) 2022-05-13

Family

ID=81483243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210143457.2A Pending CN114491674A (en) 2022-02-16 2022-02-16 Log processing method, device and equipment based on block chain

Country Status (1)

Country Link
CN (1) CN114491674A (en)

Similar Documents

Publication Publication Date Title
US10528405B2 (en) Methods, apparatus and computer programs for managing persistence
CN111344706B (en) Method and system for managing transactions on blockchain
CN112650576A (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN113961510B (en) File processing method, device, equipment and storage medium
US11061727B1 (en) Preventing performance degradation over time in a cache
CN110881224B (en) Network long connection method, device, equipment and storage medium
US20180287954A1 (en) Technologies for offloaded management of communication
CN115514718B (en) Data interaction method, control layer and equipment based on data transmission system
US20220303360A1 (en) Reduction of data transmissions based on end-user context
CN114491674A (en) Log processing method, device and equipment based on block chain
CN114374657A (en) Data processing method and device
CN113726885A (en) Method and device for adjusting flow quota
CN114048059A (en) Method and device for adjusting timeout time of interface, computer equipment and storage medium
CN114449040A (en) Configuration issuing method and device based on cloud platform
CN113051244A (en) Data access method and device, and data acquisition method and device
CN112231290A (en) Method, device and equipment for processing local log and storage medium
CN113781154A (en) Information rollback method, system, electronic equipment and storage medium
CN112699116A (en) Data processing method and system
CN111769965B (en) Information processing method, device and equipment
CN113766437B (en) Short message sending method and device
CN110262756B (en) Method and device for caching data
CN115801357A (en) Global exception handling method, device, equipment and storage medium
CN117057815A (en) Unmanned network virtual seat service method, system, equipment and storage medium
CN114490583A (en) Data migration method and device, electronic equipment and storage medium
CN114896086A (en) Message processing 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