Log storage method and device, log auditing method and device, electronic equipment and medium

By generating multi-dimensional keyword tags and inverted indexes, combined with encryption processing, the problem of low search accuracy in log files is solved, fine-grained search and secure storage are achieved, and the retrieval and security of log files are improved.

CN118796789APending Publication Date: 2024-10-18CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410201629.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-23
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, the search accuracy of log files is low because there is no fine-grained classification based on information such as log content and category, resulting in too large search results returned when users search for specified log files.

Method used

By obtaining multi-dimensional keyword tags of log files and building an inverted index, the inverted index and log files are encrypted, a secure index and encrypted log files are generated, and uploaded to the cloud server to achieve fine-grained log file search.

Benefits of technology

It improves the search accuracy and security of log files, prevents log files from being tampered with, and enhances the retrieval of log files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796789A_ABST
    Figure CN118796789A_ABST
Patent Text Reader

Abstract

The invention provides a log storage method and device, a log auditing method and device, electronic equipment and a medium, and the method comprises the steps: obtaining log data of a plurality of log files; wherein the log data comprises file content of a corresponding log file and file description information of the log file; based on the log data, generating a multi-dimensional keyword tag of each log file; constructing an inverted index of each log file on the basis of the multi-dimensional keyword tag; wherein the reverse index is used for indicating a mapping relationship between the multi-dimensional keyword tag and the log identifier of the log file; and encrypting the reverse index and the log file to obtain a security index and an encrypted log file, and uploading the security index and the encrypted log file to a cloud server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a log storage, log audit method, device, electronic device and medium. Background Art

[0002] Cloud storage can store log data of a large number of log files, which contain users' personal information and sensitive log data. To ensure the security of stored data, the log data can be encrypted through the log processing system and uploaded to the cloud storage, supporting multiple users to query the corresponding log files.

[0003] In the related art, log files are classified according to a single attribute of log data, without fine-grained classification of log files based on log content, category and other information, resulting in too large search results returned when users search for specified log files, and low search accuracy for log files. Summary of the invention

[0004] The embodiments of the present disclosure at least provide a log storage and log auditing method, device, electronic device and medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a log storage method, which is applied to a log processing system, including:

[0006] Obtaining log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files;

[0007] Based on the log data, generate a multi-dimensional keyword tag for each of the log files;

[0008] Building an inverted index for each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file;

[0009] The inverted index and the log file are encrypted to obtain a security index and an encrypted log file respectively, and the security index and the encrypted log file are uploaded to a cloud server.

[0010] In an optional implementation manner, the step of constructing an inverted index of each log file based on the multi-dimensional keyword tag includes:

[0011] determining a log identifier for each of said log files;

[0012] The multi-dimensional keyword tag and the log identifier of the corresponding log file are combined to construct an inverted index of the log file.

[0013] In an optional implementation, generating a multi-dimensional keyword tag for each log file based on the log data includes:

[0014] Classify the log file according to at least one preset classification dimension to obtain a classification result for each classification dimension;

[0015] Based on the classification result of each of the classification dimensions, a multi-dimensional keyword tag of the log file is determined.

[0016] In an optional implementation manner, determining the multi-dimensional keyword tag of the log file based on the classification result of each of the classification dimensions includes:

[0017] The classification results of each of the classification dimensions are connected and combined to obtain a multi-dimensional keyword tag for the log file.

[0018] In an optional implementation manner, the encrypting the inverted index and the log file to obtain a security index and an encrypted log file respectively after encryption includes:

[0019] Performing searchable encryption processing on the inverted index using a first hash function and a first key to obtain a secure index of the log file;

[0020] The log file is symmetrically encrypted using a second key to obtain the encrypted log file.

[0021] In an optional implementation manner, before symmetrically encrypting the log file using the second key to obtain the encrypted log file, the method further includes:

[0022] Performing hash calculation on the log file by using a second hash function to obtain a first hash value of the log file;

[0023] The log file and the first hash value corresponding to the log file are uploaded to the blockchain system for storage.

[0024] In a second aspect, an embodiment of the present disclosure provides a log audit method, which is applied to a log audit system, including:

[0025] Responding to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file;

[0026] Generate a search token corresponding to the log audit request, and send the search token to the cloud server;

[0027] Receive the search results returned by the cloud server based on the search token, determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is obtained through the steps in the first aspect above.

[0028] In an optional implementation manner, generating a search token corresponding to the log audit request includes:

[0029] Based on the log audit request, generate a search request for the log file;

[0030] Obtain the first key of the log processing system;

[0031] The search request is encrypted using the first key and a first Hash function to generate a search token for the log file.

[0032] In an optional implementation manner, determining the log file to be searched in the cloud server based on the search results includes:

[0033] Decrypting the search result by using a first key of a log processing system to obtain a log identifier of the log file;

[0034] Downloading an encrypted log file corresponding to the log identifier in a cloud server;

[0035] The encrypted log file is decrypted by using the second key, and integrity verification is performed on the decrypted log file. After the integrity verification is passed, the log file to be searched is obtained.

[0036] In an optional implementation manner, decrypting the encrypted log file by using the second key, and performing integrity verification on the decrypted log file to obtain a verification result includes:

[0037] Performing hash calculation on the decrypted log file by using a second hash function to obtain a second hash value of the decrypted log file;

[0038] Querying the blockchain system for a first hash value that matches the log identifier;

[0039] The first Hash value is compared with the second Hash value, and an integrity verification result of the decrypted log file is determined according to the comparison result.

[0040] In a third aspect, the present disclosure provides a second log audit method, which is applied to a cloud server and includes:

[0041] Obtaining a security index and an encrypted log file sent by a log processing system; wherein the security index and the encrypted log file are obtained by encrypting an inverted index of a log file and the log file respectively, the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on log data of the log file;

[0042] Receive the search token sent by the log audit system;

[0043] Determining the encrypted multi-dimensional keyword tag in the search token, and determining a security index matching the encrypted multi-dimensional keyword tag;

[0044] A search result is determined based on the security index, and the search result is sent to the log audit system.

[0045] In an optional implementation, the method further includes: after sending the search result to the log audit system, obtaining a log identifier sent by the log audit system based on the search result;

[0046] The encrypted log file matching the log identifier is searched in the stored encrypted log files, and the encrypted log file matching the log identifier is returned to the log audit system.

[0047] In a fourth aspect, the embodiment of the present disclosure further provides a log storage device, which is provided in a log processing system, and the device includes:

[0048] A first acquisition unit is used to acquire log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files;

[0049] A first generating unit, configured to generate a multi-dimensional keyword tag for each of the log files based on the log data;

[0050] A construction unit, configured to construct an inverted index of each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file;

[0051] The first processing unit is used to encrypt the inverted index and the log file to obtain a security index and an encrypted log file respectively after encryption, and upload the security index and the encrypted log file to a cloud server.

[0052] In a fifth aspect, the embodiment of the present disclosure further provides a log audit device, which is arranged in the log audit system, and the device includes:

[0053] A response unit, configured to respond to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file;

[0054] A second generating unit, configured to generate a search token corresponding to the log audit request, and send the search token to a cloud server;

[0055] A first receiving unit is used to receive the search results returned by the cloud server based on the search token, and determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, and the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is obtained through the steps in the above-mentioned first aspect.

[0056] In a sixth aspect, the embodiment of the present disclosure further provides a second log auditing device, which is arranged in a cloud server, and the device includes:

[0057] A second acquisition unit is used to acquire a security index and an encrypted log file sent by the log processing system; wherein the security index and the encrypted log file are obtained by encrypting an inverted index of a log file and the log file respectively, the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on log data of the log file;

[0058] A second receiving unit, used to receive a search token sent by the log audit system;

[0059] A second processing unit determines the encrypted multi-dimensional keyword tag in the search token, and determines a security index matching the encrypted multi-dimensional keyword tag;

[0060] A sending unit is used to determine a search result based on the security index and send the search result to the log audit system.

[0061] In the seventh aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned first aspect, the second aspect, or the third aspect are performed.

[0062] In an eighth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned first aspect, second aspect, or third aspect are executed.

[0063] In an embodiment of the present application, first, log data of multiple log files is obtained; and based on the log data, a multidimensional keyword tag is generated for each log file, and then an inverted index of each log file is constructed based on the multidimensional keyword tag. Finally, the inverted index and log file are encrypted, and a security index and an encrypted log file are obtained after encryption, and the security index and the encrypted log file are uploaded to the cloud server.

[0064] In the above implementation, by performing multi-dimensional classification on log files and generating multi-dimensional keyword tags, fine-grained log file search can be achieved, and the log storage and log auditing processes are completed through the interaction between the log processing system, the log auditing system and the cloud server, thereby improving the security and retrievability of the log files and preventing the log files from being tampered with.

[0065] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0067] Figure 1 A flow chart of a log storage method provided by an embodiment of the present disclosure is shown;

[0068] Figure 2 A flow chart of a first log audit method provided by an embodiment of the present disclosure is shown;

[0069] Figure 3 A flow chart of a second log audit method provided by an embodiment of the present disclosure is shown;

[0070] Figure 4 A schematic diagram showing a log storage method and a log audit method provided by an embodiment of the present disclosure is shown;

[0071] Figure 5 A schematic diagram of a log storage device provided by an embodiment of the present disclosure is shown;

[0072] Figure 6 A schematic diagram of a log auditing device provided by an embodiment of the present disclosure is shown;

[0073] Figure 7 A schematic diagram of a second log auditing device provided by an embodiment of the present disclosure is shown;

[0074] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0075] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0076] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0077] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0078] Research has found that cloud storage can store a large amount of log data from log files, which contains users' personal information and sensitive log data. To ensure the security of stored data, the log data can be encrypted through the log processing system and uploaded to cloud storage, supporting multiple users to query the corresponding log files.

[0079] In the related art, log files are classified according to a single attribute of log data, without fine-grained classification of log files based on log content, category and other information, resulting in too large search results returned when users search for specified log files, and low search accuracy for log files.

[0080] Based on the above research, the present disclosure provides a log storage, log auditing method, device, electronic device and medium. In the embodiment of the present application, first, the log data of multiple log files are obtained; and based on the log data, a multi-dimensional keyword tag of each log file is generated, and then an inverted index of each log file is constructed based on the multi-dimensional keyword tag. Finally, the inverted index and log file are encrypted, and after encryption, a security index and an encrypted log file are obtained respectively, and the security index and the encrypted log file are uploaded to the cloud server.

[0081] In the above implementation, by performing multi-dimensional classification on log files and generating multi-dimensional keyword tags, fine-grained log file search can be achieved, and the log storage and log auditing processes are completed through the interaction between the log processing system, the log auditing system and the cloud server, thereby improving the security and retrievability of the log files and preventing the log files from being tampered with.

[0082] To facilitate understanding of this embodiment, a log storage method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the log storage method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities, and the electronic device includes, for example, a terminal device or a server or other processing device. In some possible implementations, the log storage method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0083] See also Figure 1 FIG. 1 is a flow chart of a log storage method provided by an embodiment of the present disclosure. The log storage method can be applied to a log processing system. The method includes steps S101 to S104, wherein:

[0084] Step S101: obtaining log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files.

[0085] In an embodiment of the present application, the log processing system can collect various types of log data from different data sources, perform log cleaning and preprocessing on the log data, and store the cleaned and preprocessed log data in the log processing system.

[0086] Here, data sources include servers, applications, and network devices. The collection methods of log data include using a log collector to actively collect log files, or configuring applications to send log files to a log processing system.

[0087] Here, preprocessing includes removing irrelevant information from the log data and unifying the log format. The preprocessing process can ensure the consistency and readability of the data and facilitate subsequent audit operations.

[0088] Step S102: Based on the log data, a multi-dimensional keyword tag is generated for each log file.

[0089] Here, the multi-dimensional keyword tag is formed by combining the classification results of the log file in each dimension. The generation method of the multi-dimensional keyword tag includes automatic generation through data classification and grading technology and manual generation through log data analysis.

[0090] Here, the classification dimensions of log files include: sensitivity, business type and generation time. For example, the sensitivity of log data can be used as a dimension to divide it into: A sensitive, B general, C insensitive; or the business type of log data can be used as a dimension to divide it into: a security log, b network log, c system log, d application log; or the generation time of the log file can be used as a dimension to divide it, for example, data = XXXX year YY month ZZ day.

[0091] In addition to the above classification dimensions, log files can also be divided from other dimensions. The classification results of each dimension can also be set according to the specific application scenario. This application does not make specific requirements for this.

[0092] If the multi-dimensional keyword tag is A||b||XXXX||YY||ZZ, it means that the sensitivity of the log file corresponding to the multi-dimensional keyword tag is A sensitive, the business type of the log file is b network log, and the generation time of the log file is XXXX year YY month ZZ day. Here, we can use w j Represents the multi-dimensional keyword tags of log files, i.e., w j =A||b||XXXX||YY||ZZ, where j is the serial number of the multi-dimensional keyword label, and the multi-dimensional keyword label can be sorted according to the first letter of the multi-dimensional keyword label.

[0093] The accuracy of the division of the log file generation time can be adjusted according to the actual generation rate of the log file. The faster the actual generation rate of the log file, the finer the division of the log file generation time. For example, the generation time of each log file can be divided into hours.

[0094] In an embodiment of the present application, the log processing system can extract keyword information of the log file corresponding to the log data based on the file content and file description information in each log data, and perform multi-dimensional classification of the log file based on the keyword information to generate multi-dimensional keyword tags.

[0095] Step S103: constructing an inverted index for each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file.

[0096] For example, assuming that the multidimensional keyword label is w1=A||b||XXXX||YY||ZZ, and the multidimensional keyword label corresponds to the third log file and the fifth log file, the above mapping relationship can be represented by w1→log3, log5, and it can be used as the first index in the inverted index, and subsequent indexes are constructed according to the above steps.

[0097] Here, the inverted index includes multiple multi-dimensional keyword tags and multiple log identifiers, each log identifier corresponds to a multi-dimensional keyword tag, and each multi-dimensional keyword tag may correspond to multiple log identifiers.

[0098] In an embodiment of the present application, the log processing system generates a log identifier for each log file according to the generation time of each log file, connects and combines the log identifier with the multi-dimensional keyword tag of the log file corresponding to the log identifier, and constructs an inverted index for each log file.

[0099] Step S104: encrypt the inverted index and the log file to obtain a security index and an encrypted log file respectively, and upload the security index and the encrypted log file to a cloud server.

[0100] Here, the security index is used to indicate the mapping relationship between the encrypted log identifier and the encrypted multi-dimensional keyword tag.

[0101] In an embodiment of the present application, the log processing system encrypts the inverted index through a searchable encryption algorithm to generate a security index, and encrypts the log file through a symmetric encryption algorithm to generate an encrypted log file, and uploads the generated security index and encrypted log file to the cloud server for storage.

[0102] In the above implementation, by performing multi-dimensional classification on log files and generating multi-dimensional keyword tags, fine-grained log file search can be achieved, and the log storage and log auditing processes are completed through the interaction between the log processing system, the log auditing system and the cloud server, thereby improving the security and retrievability of the log files and preventing the log files from being tampered with.

[0103] In an optional implementation, constructing an inverted index of each log file based on the multi-dimensional keyword tag includes:

[0104] Step S21: determining a log identifier of each log file;

[0105] Step S22: Combine the multi-dimensional keyword tag and the log identifier of the corresponding log file to construct an inverted index of the log file.

[0106] Here, the log identifier is generated by the log processing system according to the generation time of each log file. The log identifier is used to distinguish each log file. i To indicate that i is the sequence number of each log file.

[0107] Here, the inverted index is used to indicate the mapping relationship between the multi-dimensional keyword tag and the log identifier of the log file corresponding to the multi-dimensional keyword tag.

[0108] Among them, the inverted index is expressed as: Each log identifier corresponds to a multi-dimensional keyword tag, and each multi-dimensional keyword tag can correspond to multiple log identifiers.

[0109] In the above implementation, multi-dimensional keyword tags and log identifiers are combined to construct an inverted index of log files, so that corresponding log files can be retrieved by inputting keywords, reducing search time and resource consumption, thereby improving retrieval efficiency and system performance.

[0110] In an optional implementation, generating a multi-dimensional keyword tag for each log file based on the log data includes:

[0111] Step S31: classifying the log file according to at least one pre-set classification dimension to obtain a classification result for each classification dimension;

[0112] Step S32: Determine a multi-dimensional keyword tag of the log file based on the classification result of each of the classification dimensions.

[0113] Here, the log files may be classified according to at least one of the above-described classification dimensions to obtain classification results for each classification dimension, for example, the log files may be classified according to sensitivity, business type, and generation time to obtain classification results for each classification dimension. The classification results are used to indicate the results of the log files after classification according to each pre-set classification dimension.

[0114] For example, regarding the sensitivity of log data, the classification result of the classification dimension may be any one of A sensitive, B general, and C insensitive.

[0115] The classification dimension of each log file may be different, and the length of the multi-dimensional keyword tag generated according to the classification dimension may also be different.

[0116] In the above implementation, the log files are classified according to the preset classification dimensions, so that relevant log information can be quickly found according to the specific classification dimensions without browsing the entire log file, thereby improving the search efficiency of the log files.

[0117] In an optional implementation, determining the multi-dimensional keyword tag of the log file based on the classification result of each of the classification dimensions includes:

[0118] The classification results of each of the classification dimensions are connected and combined to obtain a multi-dimensional keyword tag for the log file.

[0119] After obtaining the classification results of each classification dimension, the classification results of each classification dimension can be connected and combined. For example, they can be connected and combined in the manner described above: A||b||XXXX||YY||ZZ; wherein the classification results of each classification dimension can be separated by a separation symbol, for example, they can be classified by “||”. In addition, other separation symbols can also be selected.

[0120] In the above implementation, the log processing system connects the classification results of each classification dimension, improves the value range of the combined multi-dimensional keyword tag, thereby narrowing the search results returned based on the multi-dimensional keyword tag, improving the search accuracy of the log file, and avoiding keyword guessing attacks caused by a too small keyword set.

[0121] In an optional implementation, the encrypting the inverted index and the log file to obtain a security index and an encrypted log file respectively after encryption includes:

[0122] Step S51: performing searchable encryption processing on the inverted index using a first hash function and a first key to obtain a secure index of the log file;

[0123] Step S52: symmetrically encrypt the log file using the second key to obtain the encrypted log file.

[0124] Here, a hash function is an algorithm that can convert data of any length into an output of a fixed length. The hash function can be used to unify the lengths of multi-dimensional keyword tags generated according to different classification dimensions into a fixed length.

[0125] The log processing system uses a searchable encryption algorithm and a symmetric encryption algorithm to encrypt the inverted index and log file respectively, and generates a corresponding first key and a second key, which can be represented by k1 and k2 respectively, and uses k1 and k2 to encrypt the inverted index and log file respectively. Among them, k1 and k2 can be obtained according to KeyGen(1 λ ) is generated, and λ represents the initial security parameter.

[0126] Among them, the symmetric encryption algorithm includes AES and SM4. This application uses the AES symmetric encryption algorithm to encrypt the log identifier in the inverted index, and this application does not make specific requirements for this.

[0127] In the embodiment of the present application, the log processing system first encrypts the multi-dimensional keyword tags in the inverted index by using the first hash function and the first key to generate Hash1(k1,w j ), which can also be expressed as Hash1(w j ), and then use the first key and the corresponding symmetric encryption algorithm to encrypt the log identifier to generate AES k1 (log i ), which can also be expressed as AES(log i ), and finally, the encrypted multi-dimensional keyword tag and the encrypted log identifier are combined to obtain a security index of the log file, and then the log file is symmetrically encrypted with a second key to obtain an encrypted log file.

[0128] Among them, the security index is expressed as: Used to indicate the mapping relationship between the encrypted log identifier and the encrypted multi-dimensional keyword tag.

[0129] In an optional implementation, before symmetrically encrypting the log file using the second key to obtain the encrypted log file, the method further includes:

[0130] Step S61: performing hash calculation on the log file by using a second hash function to obtain a first hash value of the log file;

[0131] Step S62: Upload the log file and the first hash value corresponding to the log file to the blockchain system for storage.

[0132] Here, the first hash value is used to indicate summary information of the log file. The log file can be represented as log_file, and the first hash value can be represented as Hash2(log_file), which is used to verify whether the log file is tampered with during transmission or storage, thereby ensuring the integrity of the log data.

[0133] In the above implementation, the integrity of the log data is verified by performing hash calculation on each log file, thereby improving the security of the log data. When a new log file is obtained, the summary information corresponding to the log file is uploaded to the blockchain system. By comparing the summary information of the log file, the integrity of the log data can be detected, thereby improving data processing efficiency.

[0134] See also Figure 2 As shown, it is a flowchart of a first log audit method provided by an embodiment of the present disclosure. The log audit method can be applied to a log audit system. The method includes steps S201 to S203, wherein:

[0135] Step S201: responding to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file.

[0136] Here, the log audit request is a request initiated by an auditor to retrieve or view a specified log file. The log audit request includes the identity information of the auditor initiating the request and the multi-dimensional keyword tags of the specified log file, which facilitates the system to perform identity authentication and permission checking.

[0137] In an embodiment of the present application, the auditor logs in to the log audit system with an authorized account and password, and initiates a log audit request for the log file to the log audit system. The log audit system verifies the auditor's authority through the log audit request, and if the authority verification passes, allows the auditor to audit the corresponding log file.

[0138] Step S202: Generate a search token corresponding to the log audit request, and send the search token to the cloud server.

[0139] Here, the search token includes a multi-dimensional keyword tag in the log audit request, and the corresponding log file can be queried in the cloud server according to the search token.

[0140] Among them, the format of the multidimensional keyword tag in the log audit request and the order of the classification results of each classification dimension in the multidimensional keyword tag need to be consistent with the multidimensional keyword tag generated by the log processing system according to the log data of the log file.

[0141] In an embodiment of the present application, after the log audit system receives the log audit request initiated by the auditor, it extracts the multi-dimensional keyword tag in the log audit request and generates a corresponding search token based on the multi-dimensional keyword tag. After that, the log audit system can send the search token to the cloud server.

[0142] Step S203: Receive the search results returned by the cloud server based on the search token, determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is determined by the above-mentioned log storage method.

[0143] Here, the search result refers to the encrypted log identifier in the security index corresponding to the search token, and the corresponding log file to be searched can be downloaded from the cloud server according to the search result.

[0144] In an embodiment of the present application, after the cloud server receives the search token sent by the log audit system, the cloud server searches for the multidimensional keyword tag that matches the search token, and returns the search results that match the multidimensional keyword tag to the log audit system. The log audit system can download the log file to be searched from the cloud server based on the search results, so that the auditor can audit the log file to be searched.

[0145] In the above implementation, by performing multi-dimensional classification on log files and generating multi-dimensional keyword tags, fine-grained log file search can be achieved, and the log storage and log auditing processes are completed through the interaction between the log processing system, the log auditing system and the cloud server, thereby improving the security and retrievability of the log files and preventing the log files from being tampered with.

[0146] In an optional implementation, generating a search token corresponding to the log audit request includes:

[0147] Step S81: Based on the log audit request, generate a search request for the log file;

[0148] Step S82: Obtain the first key of the log processing system;

[0149] Step S83: encrypt the search request using the first key and the first Hash function to generate a search token for the log file.

[0150] Here, the search request is generated by the log audit system based on the multi-dimensional keyword tags in the log audit request.

[0151] Here, the search token is used to instruct the log audit system to download the corresponding log file from the cloud server.

[0152] In an embodiment of the present application, after the log audit system receives the log audit request initiated by the auditor, it extracts the multi-dimensional keyword tags in the log audit request and generates a search request, and then negotiates a key with the log processing system. The log processing system transmits a first key and a second key to the log audit system. After the log audit system receives the first key, it encrypts the search request using the first key and the first hash function, and generates a search token based on the encrypted result.

[0153] In the above implementation, auditors can access and audit corresponding log files through the search token generated by the log audit system without exposing the information in the search request initiated by the auditor, thereby protecting the privacy of users and improving the security and processing efficiency of the log audit process.

[0154] In an optional implementation, determining the log file to be searched in the cloud server based on the search results includes:

[0155] Step S91: decrypting the search result by using a first key of the log processing system to obtain a log identifier of the log file;

[0156] Step S92: downloading the encrypted log file corresponding to the log identifier in the cloud server;

[0157] Step S93: decrypt the encrypted log file using the second key, and perform integrity verification on the decrypted log file. After the integrity verification passes, the log file to be searched is obtained.

[0158] In the above implementation, using two different keys to encrypt and decrypt log files can provide additional protection for log files, ensuring that auditors obtain original data that has not been tampered with, and can verify the integrity of the decrypted log files to ensure the integrity of the log data during transmission and storage.

[0159] In an optional implementation, the decrypting the encrypted log file by using the second key and performing integrity verification on the decrypted log file to obtain a verification result includes:

[0160] Step S1001: performing hash calculation on the decrypted log file by using a second hash function to obtain a second hash value of the decrypted log file;

[0161] Step S1002: querying the blockchain system for a first hash value that matches the log identifier;

[0162] Step S1003: Compare the first Hash value with the second Hash value, and determine the integrity verification result of the decrypted log file according to the comparison result.

[0163] Here, the second hash value is used to indicate summary information of the log file downloaded by the log audit system in the cloud server.

[0164] In an embodiment of the present application, the log audit system first performs a hash calculation on the log file downloaded from the cloud server to obtain a second hash value, and then queries the blockchain system for a first hash value that matches the log identifier based on the log identifier. If the first hash value is the same as the second hash value, the integrity verification of the log file passes, and a verification pass is returned; if the first hash value is different from the second hash value, it means that the log file has been tampered with during transmission or storage, and a result of integrity verification failure is returned.

[0165] See also Figure 3 As shown, it is a flow chart of a second log audit method provided by an embodiment of the present disclosure. The log audit method can be applied to a cloud server. The method includes steps S301 to S304, wherein:

[0166] Step S301: Obtain a security index and an encrypted log file sent by a log processing system; wherein the security index and the encrypted log file are obtained by encrypting the inverted index of the log file and the log file respectively, and the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on the log data of the log file.

[0167] In an embodiment of the present application, a log processing system generates a multidimensional keyword tag for the log file based on the log data of the log file, generates an inverted index of the log file through the multidimensional keyword tag, and encrypts the inverted index and the corresponding log file to obtain a security index and an encrypted log file. The cloud server is used to receive the security index and encrypted log file sent by the log processing system.

[0168] Step S302: Receive a search token sent by the log audit system.

[0169] In an embodiment of the present application, after the log audit system receives the log audit request initiated by the auditor, it extracts the multi-dimensional keyword tag in the log audit request and generates a corresponding search token based on the multi-dimensional keyword tag. After that, the cloud server can receive the search token sent by the log audit system.

[0170] Step S303: Determine the encrypted multi-dimensional keyword tag in the search token, and determine a security index that matches the encrypted multi-dimensional keyword tag.

[0171] In an embodiment of the present application, after receiving the search token, the cloud server extracts the encrypted multi-dimensional keyword tag in the search token and searches for a security index that matches the encrypted multi-dimensional keyword tag.

[0172] Step S304: Determine search results based on the security index, and send the search results to the log audit system.

[0173] In an embodiment of the present application, after the cloud server determines the security index that matches the search token, it uses the encrypted log identifier in the security index as the search result and sends the search result to the log audit system.

[0174] In the above implementation, by performing multi-dimensional classification on log files and generating multi-dimensional keyword tags, fine-grained log file search can be achieved, and the log storage and log auditing processes are completed through the interaction between the log processing system, the log auditing system and the cloud server, thereby improving the security and retrievability of the log files and preventing the log files from being tampered with.

[0175] In an optional implementation, the method further includes: after sending the search result to the log audit system, obtaining a log identifier sent by the log audit system based on the search result;

[0176] The encrypted log file matching the log identifier is searched in the stored encrypted log files, and the encrypted log file matching the log identifier is returned to the log audit system.

[0177] In an embodiment of the present application, after the cloud server sends the search results to the log audit system, the log audit system decrypts the search results, obtains the log identifier of the corresponding log file, and sends the log identifier to the cloud server. After the cloud server receives the log identifier, it can download the corresponding encrypted log file according to the log identifier and send the encrypted log file to the log audit system.

[0178] like Figure 4 Shown is a schematic diagram of a log storage method and a log audit method, which includes: a log processing system, a log audit system, a cloud server and a blockchain system.

[0179] Among them, the log processing system is equivalent to the data owner and is used to collect log data from various log files.

[0180] Among them, the log audit system is equivalent to a data user, which can authenticate the identity of the auditor and control the authority, and support multi-user auditing. Only when the auditor is authenticated and authorized can he log in to the system to access the specified log file.

[0181] Among them, the cloud server is used to store relevant data of various log files sent by the log processing system and the log audit system.

[0182] Among them, the blockchain system is mainly used to receive the first hash value uploaded by the log processing system, and verify the integrity of the log file with the log audit system.

[0183] The method mainly includes four processes: log collection preprocessing, log encryption storage, log update, and log search and audit.

[0184] 1. Log collection preprocessing: The log processing system collects various types of log data and performs log cleaning, index extraction, and inverted index generation on various types of log data.

[0185] 2. Log encryption storage: The log processing system performs searchable encryption and symmetric encryption on the inverted index and log files respectively, generates a secure index and encrypted log file, and uploads the secure index and encrypted log file to the cloud server for storage. At the same time, the first hash value of the log file is uploaded to the blockchain system for storage.

[0186] 3. Log update: When a new log file is generated, it is processed according to the log collection preprocessing and log encryption storage process.

[0187] 4. Log search and audit: Auditors submit log audit requests through the log audit system. The log audit system interacts with the log processing system, cloud server and blockchain system based on the log audit request, obtains the log file corresponding to the log audit request, and performs log audit.

[0188] The specific process is described as follows:

[0189] 1.1. The log processing system collects various log data from multiple log files.

[0190] 1.2. The log processing system generates multi-dimensional keyword tags for each log file based on the log data.

[0191] 2.1. The log processing system uploads the first hash value corresponding to the log file to the blockchain system for storage.

[0192] 2.2. The log processing system encrypts the inverted index and log file of the log file, obtains the security index and encrypted log file after encryption, and uploads the security index and encrypted log file to the cloud server.

[0193] 3.1. The auditor initiates a log audit request for the log file to the log audit system.

[0194] 3.2. The log audit system negotiates a key with the log processing system based on the log audit request.

[0195] 3.3. The log audit system generates a search token corresponding to the log audit request and sends the search token to the cloud server.

[0196] 3.4. The cloud server determines the search result based on the search token and sends the search result to the log audit system.

[0197] 3.5. The log audit system decrypts the search result, obtains the log identifier of the log file, and decrypts the log file corresponding to the log identifier.

[0198] 3.6. The log audit system determines the log file to be searched and performs a log audit on the log file.

[0199] In the embodiment of the present application, the log file is encrypted by using a searchable encryption algorithm, thereby realizing the secure storage, search, and update functions of the encrypted log file. In the log collection preprocessing process, the keyword information of the log file is extracted by combining data automatic identification, manual labeling and other data classification and grading technologies, and a multi-dimensional keyword tag of the log file is generated based on the keyword information, and an inverted index of the log file is constructed based on the multi-dimensional keyword tag, and then the inverted index is encrypted using a searchable encryption algorithm to generate a secure index and upload it to the cloud server, thereby increasing the scope of searchable keywords of the log file and realizing the fine-grained, multi-dimensional search function of the encrypted log file.

[0200] In addition, the identity of auditors is authenticated and the authority is controlled through the log audit system, and the log audit authority management of multiple users is realized, which can support the log search function of different users when performing log audits, without the need to combine the public key cryptography mechanism to realize the multi-user search function. At the same time, the blockchain system is introduced. During the log audit process, the log audit system interacts with the blockchain system to synchronously verify the integrity of the log file and prevent the log file from being tampered with, thereby improving the encrypted search function of the log file and ensuring the integrity of the log file.

[0201] It can be seen from the above description that the technical solution disclosed in the present invention has the following advantages:

[0202] (1) This solution implements searchable encrypted storage of log files, and combines data classification and grading technology with automatic data recognition and manual labeling to identify multi-dimensional keyword tags of log files, and constructs an inverted index of log files based on the multi-dimensional keyword tags, thereby improving the accuracy of log file searches and enabling fine-grained searches of log files.

[0203] (2) This solution implements multi-user log file search and realizes authentication and authorization of multiple users through the log audit system. When the authorization is passed, it supports the log search function of different users when performing log audit, without the need to combine the public key cryptography mechanism to realize the multi-user search function, which is simpler and more efficient.

[0204] (3) This solution implements integrity verification of log files. During the log audit process, through the interaction between the log audit system and the blockchain system, it verifies whether the integrity of the log files stored on the cloud server is destroyed, ensuring the integrity of the log files without taking up the time consumption of the log audit business and preventing the log files from being tampered with.

[0205] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0206] Based on the same inventive concept, a log storage device corresponding to the log storage method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned log storage method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0207] Reference Figure 5 FIG. 1 is a schematic diagram of a log storage device provided by an embodiment of the present disclosure, wherein the device comprises: a first acquisition unit 50, a first generation unit 51, a construction unit 52, and a first processing unit 53; wherein:

[0208] A first acquisition unit is used to acquire log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files;

[0209] A first generating unit, configured to generate a multi-dimensional keyword tag for each of the log files based on the log data;

[0210] A construction unit, configured to construct an inverted index of each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file;

[0211] The first processing unit is used to encrypt the inverted index and the log file to obtain a security index and an encrypted log file respectively after encryption, and upload the security index and the encrypted log file to a cloud server.

[0212] In a possible implementation manner, the device is also used for:

[0213] determining a log identifier for each of said log files;

[0214] The multi-dimensional keyword tag and the log identifier of the corresponding log file are combined to construct an inverted index of the log file.

[0215] In a possible implementation manner, the device is also used for:

[0216] Classify the log file according to at least one preset classification dimension to obtain a classification result for each classification dimension;

[0217] Based on the classification result of each of the classification dimensions, a multi-dimensional keyword tag of the log file is determined.

[0218] In a possible implementation manner, the device is also used for:

[0219] The classification results of each of the classification dimensions are connected and combined to obtain a multi-dimensional keyword tag for the log file.

[0220] In a possible implementation manner, the device is also used for:

[0221] Performing searchable encryption processing on the inverted index using a first hash function and a first key to obtain a secure index of the log file;

[0222] The log file is symmetrically encrypted using a second key to obtain the encrypted log file.

[0223] In a possible implementation manner, the device is also used for:

[0224] Performing hash calculation on the log file by using a second hash function to obtain a first hash value of the log file;

[0225] The log file and the first hash value corresponding to the log file are uploaded to the blockchain system for storage.

[0226] Reference Figure 6 , which is a schematic diagram of a log audit device provided by an embodiment of the present disclosure, the device includes: a response unit 60, a second generation unit 61, a first receiving unit 62, and a first processing unit 63; wherein,

[0227] A response unit, configured to respond to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file;

[0228] A second generating unit, configured to generate a search token corresponding to the log audit request, and send the search token to a cloud server;

[0229] A first receiving unit is used to receive the search results returned by the cloud server based on the search token, and determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, and the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is determined by the above-mentioned log storage method.

[0230] In a possible implementation manner, the device is also used for:

[0231] Based on the log audit request, generate a search request for the log file;

[0232] Obtain the first key of the log processing system;

[0233] The search request is encrypted using the first key and a first Hash function to generate a search token for the log file.

[0234] In a possible implementation manner, the device is also used for:

[0235] Decrypting the search result by using a first key of a log processing system to obtain a log identifier of the log file;

[0236] Downloading an encrypted log file corresponding to the log identifier in a cloud server;

[0237] The encrypted log file is decrypted by using the second key, and integrity verification is performed on the decrypted log file. After the integrity verification is passed, the log file to be searched is obtained.

[0238] In a possible implementation manner, the device is also used for:

[0239] Performing hash calculation on the decrypted log file by using a second hash function to obtain a second hash value of the decrypted log file;

[0240] Querying the blockchain system for a first hash value that matches the log identifier;

[0241] The first Hash value is compared with the second Hash value, and an integrity verification result of the decrypted log file is determined according to the comparison result.

[0242] Reference Figure 7 , which is a schematic diagram of a second log audit device provided by an embodiment of the present disclosure, the device includes: a second acquisition unit 70, a second receiving unit 71, a second processing unit 72, and a sending unit 73; wherein,

[0243] A second acquisition unit is used to acquire a security index and an encrypted log file sent by the log processing system; wherein the security index and the encrypted log file are obtained by encrypting an inverted index of a log file and the log file respectively, the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on log data of the log file;

[0244] A second receiving unit, used to receive a search token sent by the log audit system;

[0245] A second processing unit determines the encrypted multi-dimensional keyword tag in the search token, and determines a security index matching the encrypted multi-dimensional keyword tag;

[0246] A sending unit is used to determine a search result based on the security index and send the search result to the log audit system.

[0247] In a possible implementation manner, the device is also used for:

[0248] The encrypted log file matching the log identifier is searched in the stored encrypted log files, and the encrypted log file matching the log identifier is returned to the log audit system.

[0249] For descriptions of the processing flow of each unit in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0250] Corresponds to Figure 1 Log storage method in Figure 2 and Figure 3 The log audit method in the present disclosure also provides an electronic device 80, such as Figure 8 FIG. 8 is a schematic diagram of the structure of an electronic device 80 provided in an embodiment of the present disclosure, including:

[0251] Processor 81, memory 82, and bus 83; memory 82 is used to store execution instructions, including internal memory 821 and external memory 822; the internal memory 821 is also called internal memory, which is used to temporarily store the operation data in the processor 81 and the data exchanged with the external memory 822 such as a hard disk. The processor 81 exchanges data with the external memory 822 through the internal memory 821. When the electronic device 80 is running, the processor 81 communicates with the memory 82 through the bus 83, so that the processor 81 executes the following instructions:

[0252] Obtaining log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files;

[0253] Based on the log data, generate a multi-dimensional keyword tag for each of the log files;

[0254] Building an inverted index for each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file;

[0255] The inverted index and the log file are encrypted to obtain a security index and an encrypted log file respectively, and the security index and the encrypted log file are uploaded to a cloud server.

[0256] Or execute the following command:

[0257] Responding to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file;

[0258] Generate a search token corresponding to the log audit request, and send the search token to the cloud server;

[0259] Receive the search results returned by the cloud server based on the search token, determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is determined by the above-mentioned log storage method.

[0260] Or execute the following command:

[0261] Obtaining a security index and an encrypted log file sent by a log processing system; wherein the security index and the encrypted log file are obtained by encrypting an inverted index of a log file and the log file respectively, the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on log data of the log file;

[0262] Receive the search token sent by the log audit system;

[0263] Determining the encrypted multi-dimensional keyword tag in the search token, and determining a security index matching the encrypted multi-dimensional keyword tag;

[0264] A search result is determined based on the security index, and the search result is sent to the log audit system.

[0265] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the log storage method and the log audit method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0266] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the log storage method and the log audit method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0267] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0268] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0269] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0270] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0271] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0272] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A log storage method, characterized in that: Applied to log processing systems, including: Obtaining log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files; Based on the log data, generate a multi-dimensional keyword tag for each of the log files; Building an inverted index for each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file; The inverted index and the log file are encrypted to obtain a security index and an encrypted log file respectively, and the security index and the encrypted log file are uploaded to a cloud server.

2. The method according to claim 1, characterized in that The step of constructing an inverted index of each log file based on the multi-dimensional keyword tag includes: determining a log identifier for each of said log files; The multi-dimensional keyword tag and the log identifier of the corresponding log file are combined to construct an inverted index of the log file.

3. The method according to claim 1, characterized in that The step of generating a multi-dimensional keyword tag for each log file based on the log data includes: Classify the log file according to at least one preset classification dimension to obtain a classification result for each classification dimension; Based on the classification result of each of the classification dimensions, a multi-dimensional keyword tag of the log file is determined.

4. The method according to claim 3, characterized in that Determining the multi-dimensional keyword tag of the log file based on the classification result of each of the classification dimensions includes: The classification results of each of the classification dimensions are connected and combined to obtain a multi-dimensional keyword tag for the log file.

5. The method according to claim 1, characterized in that The encrypting the inverted index and the log file to obtain a security index and an encrypted log file respectively after encryption includes: Performing searchable encryption processing on the inverted index using a first hash function and a first key to obtain a secure index of the log file; The log file is symmetrically encrypted using a second key to obtain the encrypted log file.

6. The method according to claim 5, characterized in that Before symmetrically encrypting the log file using the second key to obtain the encrypted log file, the method further includes: Performing hash calculation on the log file by using a second hash function to obtain a first hash value of the log file; The log file and the first hash value corresponding to the log file are uploaded to the blockchain system for storage.

7. A log audit method, characterized in that: Applied to log auditing system, including: Responding to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file; Generate a search token corresponding to the log audit request, and send the search token to the cloud server; Receive the search results returned by the cloud server based on the search token, determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is determined by the log storage method described in any one of claims 1 to 6 above.

8. The method according to claim 7, characterized in that The generating a search token corresponding to the log audit request includes: Based on the log audit request, generate a search request for the log file; Obtain the first key of the log processing system; The search request is encrypted using the first key and a first Hash function to generate a search token for the log file.

9. The method according to claim 7, characterized in that: The determining the log file to be searched in the cloud server based on the search results includes: Decrypting the search result by using a first key of a log processing system to obtain a log identifier of the log file; Downloading an encrypted log file corresponding to the log identifier in a cloud server; The encrypted log file is decrypted by using the second key, and integrity verification is performed on the decrypted log file. After the integrity verification is passed, the log file to be searched is obtained.

10. The method according to claim 9, characterized in that The encrypted log file is decrypted by the second key, and the integrity of the decrypted log file is verified to obtain a verification result, including: Performing hash calculation on the decrypted log file by using a second hash function to obtain a second hash value of the decrypted log file; Querying the blockchain system for a first hash value that matches the log identifier; The first Hash value is compared with the second Hash value, and an integrity verification result of the decrypted log file is determined according to the comparison result.

11. A log audit method, characterized in that: Applied to cloud servers, including: Obtaining a security index and an encrypted log file sent by a log processing system; wherein the security index and the encrypted log file are obtained by encrypting an inverted index of a log file and the log file respectively, the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on log data of the log file; Receive the search token sent by the log audit system; Determining the encrypted multi-dimensional keyword tag in the search token, and determining a security index matching the encrypted multi-dimensional keyword tag; A search result is determined based on the security index, and the search result is sent to the log audit system.

12. The method according to claim 11, characterized in that The method further comprises: after sending the search result to the log audit system, obtaining a log identifier sent by the log audit system based on the search result; The encrypted log file matching the log identifier is searched in the stored encrypted log files, and the encrypted log file matching the log identifier is returned to the log audit system.

13. A log storage device, characterized in that: Set in a log processing system, the device includes: A first acquisition unit is used to acquire log data of multiple log files; wherein the log data includes file contents of corresponding log files and file description information of the log files; A first generating unit, configured to generate a multi-dimensional keyword tag for each of the log files based on the log data; A construction unit, configured to construct an inverted index of each of the log files based on the multi-dimensional keyword tags; wherein the inverted index is used to indicate a mapping relationship between the multi-dimensional keyword tags and the log identifier of the log file; The first processing unit is used to encrypt the inverted index and the log file to obtain a security index and an encrypted log file respectively after encryption, and upload the security index and the encrypted log file to a cloud server.

14. A log auditing device, characterized in that: Set up in the log audit system, the device includes: A response unit, configured to respond to a log audit request for a log file; wherein the log audit request carries a multi-dimensional keyword tag of the log file; A second generating unit, configured to generate a search token corresponding to the log audit request, and send the search token to a cloud server; A first receiving unit is used to receive the search results returned by the cloud server based on the search token, and determine the log file to be searched in the cloud server based on the search results, and perform an audit operation on the log file; wherein the search results are used to indicate the log identifier of the log file, and the search results are determined by the cloud server based on a security index that matches the encrypted multi-dimensional keyword tag in the search token, and the security index is determined by the log storage method described in any one of claims 1 to 6 above.

15. A log auditing device, characterized in that: Set up in a cloud server, the device includes: A second acquisition unit is used to acquire a security index and an encrypted log file sent by the log processing system; wherein the security index and the encrypted log file are obtained by encrypting an inverted index of a log file and the log file respectively, the inverted index is used to indicate a mapping relationship between a multidimensional keyword tag of the log file and a log identifier of the log file, and the multidimensional keyword tag is generated based on log data of the log file; A second receiving unit, used to receive a search token sent by the log audit system; A second processing unit determines the encrypted multi-dimensional keyword tag in the search token, and determines a security index matching the encrypted multi-dimensional keyword tag; A sending unit is used to determine a search result based on the security index and send the search result to the log audit system.

16. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the log storage method described in any one of claims 1 to 6 are executed; or the steps of the log auditing method described in any one of claims 7 to 12 are executed.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the log storage method according to any one of claims 1 to 6; or executes the steps of the log auditing method according to any one of claims 7 to 12.