A method, system, device, and medium for verifying device logs.
By obtaining the device's published information and using a hash algorithm to encrypt the location and time information, combined with blockchain to store log information, the security and reliability issues of device log verification are solved, achieving highly reliable log verification results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD
- Filing Date
- 2023-10-23
- Publication Date
- 2026-07-31
AI Technical Summary
Existing device log verification methods cannot ensure the security and reliability of logs. Holders can arbitrarily modify the device working logs in storage, making the verification results unreliable.
By obtaining the device's published information, encrypting the location and time information using a hash algorithm, and combining this with blockchain to store log information, the device's authentic log verification can be achieved.
This improves the security and reliability of device log verification, reduces the likelihood of technicians altering logs, and ensures the accuracy of verification results.
Smart Images

Figure CN117318920B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of log processing technology, and in particular to a device log verification method, system, device, and medium. Background Technology
[0002] With the widespread use of surveillance equipment, such as cameras, video surveillance devices have been deployed in key locations. However, when surveillance video is needed as evidence, log records of the surveillance equipment cannot be obtained to prove the equipment's online and offline times, making the reliability of the actual operation logs of the surveillance equipment unreliable.
[0003] Most existing device log verification systems only provide log synchronization functionality. The owner of the monitoring device can arbitrarily modify the device's working logs in storage, which reduces the security and reliability of the device log verification results. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a device log verification method, system, device and medium that can improve the security and reliability of device log verification results.
[0005] On one hand, the present invention provides a device log verification method, comprising the following steps:
[0006] Obtain the device's published information; the published information includes first address information, first time information, first log event, and hash algorithm; the first address information includes first location information and first device region;
[0007] The first location information and the first time information are hashed and encrypted according to the first log event and the hash algorithm to obtain the encrypted first location information; the first log event includes online events or offline events.
[0008] The device's verification information is obtained based on the encrypted first location information, the first device region, the first time information, and the first log event.
[0009] The encrypted first location information is matched with the stored log information on the blockchain to obtain the actual log information of the device;
[0010] The verification result is obtained by comparing the information to be verified with the actual log information.
[0011] Optionally, if the first log event is an online event, and the first location information includes the location of the first device, the first location information and the first time information are hashed and encrypted according to the first log event and the hash algorithm to obtain the encrypted first location information, specifically including:
[0012] Substitute the first time information and the first device location into the variables of the hash algorithm to obtain the first hash value;
[0013] The first hash value is used as the encrypted first location information.
[0014] Optionally, if the first log event is an offline event, the first location information includes a first device identity encryption number and a first device location. The first location information and the first time information are hashed and encrypted according to the first log event and the hash algorithm to obtain the encrypted first location information, specifically including:
[0015] Substitute the first device identity encryption number and the first device location into the variables of the hash algorithm to obtain the second hash value;
[0016] The second hash value is used as the encrypted first location information.
[0017] Optionally, the method further includes: updating the storage log information on the blockchain, wherein updating the storage log information on the blockchain specifically includes the following steps:
[0018] Acquire the device's second time information, second log events, second device region, and second location information;
[0019] The second time information and the second location information are hashed and encrypted according to the second log event and the preset hash algorithm to obtain the encrypted second location information;
[0020] The log information on the blockchain is updated based on the encrypted second location information, the second time information, the second log event, and the second device area.
[0021] Optionally, the step of hashing and encrypting the second time information and the second location information according to the second log event and a preset hash algorithm to obtain the encrypted second location information specifically includes:
[0022] If the second log event is an online event, then the second location information includes the second device location. The second time information of the device and the second device location are encrypted using a preset hash algorithm to obtain the encrypted second location information.
[0023] If the second log event is an offline event, then the second location information includes the device's identification number and the second device location. The second time information of the device and the device's identification number are encrypted using the preset hash algorithm to obtain the second device identification encrypted number. The second device identification encrypted number and the second device location are then encrypted using the preset hash algorithm to obtain the encrypted second location information.
[0024] Optionally, the step of matching the encrypted first location information with the stored log information on the blockchain to obtain the actual log information of the device specifically includes:
[0025] The first log information belonging to the first device region is obtained by matching the region with the stored log information on the blockchain.
[0026] The device's actual log information is obtained by matching the encrypted first location information with the first log information.
[0027] Optionally, comparing the information to be verified with the real log information to obtain a verification result specifically includes:
[0028] Compare the information to be verified with the actual log information;
[0029] If the information to be verified is the same as the actual log information, then passing the verification is the verification result;
[0030] If the information to be verified is different from the actual log information, the verification result is verification failure.
[0031] On the other hand, the present invention provides a device log verification system, including a camera module, a verification module, and a blockchain module, wherein,
[0032] The camera module is used to generate device log information and store the device log information in the blockchain module;
[0033] The verification module is used to implement the method described above;
[0034] The blockchain module is used to store encrypted log information from several devices.
[0035] On the other hand, the present invention provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described above.
[0036] On the other hand, the present invention provides a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the methods described above.
[0037] Implementing this invention provides the following beneficial effects: This invention obtains a device's first address information, first time information, first log event, and a hash algorithm. The first address information includes first location information and a first device region. The first location information and first time information are hashed and encrypted using the first log event and hash algorithm to obtain encrypted first location information. The first log event includes online or offline events. Based on the encrypted first location information, first device region, first time information, and first log event, the device's verification information is obtained. The encrypted first location information is matched with stored log information on the blockchain to obtain the device's true log information. The verification information is then compared with the true log information to obtain a verification result. By storing the encrypted log information on the blockchain, the possibility of technicians altering monitoring logs can be reduced. Furthermore, by hashing and encrypting the location information and time, unique verification information for the device can be obtained, improving the reliability and security of log verification. Attached Figure Description
[0038] Figure 1 This is a flowchart of a device log verification method provided by the present invention;
[0039] Figure 2 This is a schematic diagram illustrating the publicly disclosed information content of a camera provided by the present invention;
[0040] Figure 3 This invention provides a flowchart for comparing the camera position with encrypted first position information;
[0041] Figure 4 This is a flowchart of an invention for updating stored log information on a blockchain;
[0042] Figure 5 This is a schematic diagram of an encryption method for an online event log provided by the present invention;
[0043] Figure 6 This is a schematic diagram of an encryption method for offline event logs provided by the present invention;
[0044] Figure 7 This invention provides a flowchart for obtaining the actual log information of a device;
[0045] Figure 8 This is a flowchart of obtaining verification results provided by the present invention;
[0046] Figure 9 This is a schematic diagram of the structure of a device log verification system provided by the present invention;
[0047] Figure 10 This is a schematic diagram of the structure of an electronic device provided by the present invention. Detailed Implementation
[0048] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
[0049] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0050] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0051] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0052] The technical features of this invention are applicable to various devices capable of generating log events. To better understand the technical means of this invention, a camera is used as an example in the specific embodiments for explanation. The camera is not a limiting factor for the devices involved in this invention, and specific applications can be adapted according to the understanding of those skilled in the art. It is worth noting that, in the understanding of the scope of this invention, any "camera" in the specific embodiments can be replaced by "device".
[0053] To better understand the technical solution of this invention, the following technical terms are explained below.
[0054] Blockchain is a distributed ledger that links data blocks sequentially in chronological order, ensuring its immutability and tamper-proof nature through cryptography. Each block stores specific information. Blockchain has two core characteristics: data is difficult to tamper with, and it is decentralized. Based on these two characteristics, the information recorded by blockchain is more authentic and reliable, helping to solve the problem of information stored on a single server being easily tampered with.
[0055] A hash algorithm, also known as a hashing algorithm, is a type of encryption algorithm. It's a mathematical computer program that takes any input of arbitrary length and transforms the plaintext input into a fixed-length binary string. Hash algorithms possess collision resistance, concealment, or one-wayness. Collision resistance means the probability of different inputs producing the same output approaches zero. Concealment or one-wayness refers to the fact that a hash algorithm is a one-way cryptographic system; it's an irreversible mapping from plaintext to ciphertext, involving only encryption and no decryption.
[0056] like Figure 1 As shown, Figure 1 This is a flowchart of a device log verification method. The present invention provides a device log verification method, including the following steps:
[0057] S100, Obtain the published information about the equipment.
[0058] The published information includes first address information, first time information, first log event, and hash algorithm; the first address information includes first location information and first device area, and the first time information is extracted from the time the log occurred.
[0059] The hash algorithm is the encryption method selected by the camera used for information collection, and it is the same hash algorithm used when the log information is stored on the blockchain.
[0060] The first log event includes, but is not limited to, device offline events and online events.
[0061] Specifically, the information included in the first location information can vary depending on the first log event. For example, when the first log event is an online event, the first location information includes, but is not limited to, the device location; when the first log event is an offline event, the first location information includes, but is not limited to, the encrypted device ID and device location.
[0062] like Figure 2 As shown, Figure 2This is a diagram illustrating the information disclosed by a camera. When a camera needs to disclose its online and offline operation times to verify whether the camera is working within the query time range, the camera owner discloses the camera's location, the date to be verified, the hash-encrypted device ID, log events, the device's location, and the hash algorithm used.
[0063] The "area where the equipment is located" refers to the monitoring range of multiple surveillance devices, such as a kindergarten. The "camera location" refers to the specific location of the camera within a certain area, such as the "large class classroom" of the kindergarten, where the camera location is defined as the "large class classroom." The published hash algorithms include a hash algorithm for encrypting the device ID and a hash algorithm for storing the camera location on the blockchain. The date can be a specific date or a time range.
[0064] S200. Hash and encrypt the first location information and the first time information according to the first log event and the hash algorithm to obtain the encrypted first location information.
[0065] The first log event includes online or offline events, and the first location information is the encrypted camera location.
[0066] Specifically, determine whether the first log event the user needs to query is an offline event or an online event. If the first log event the user needs to query is an online event, the obtained first location information includes the camera location. Using the hash algorithm in the published information, that is, the encrypted hash algorithm used when the camera log information is uploaded to the blockchain, the hash algorithm encryption program is used to encrypt the "camera location + first time information" to obtain the encrypted first location information. Alternatively, the "first time information + camera location" can also be used as the input of the hash algorithm encryption program to obtain the encrypted first location information. The order of the first time information and the camera location is not limited, as long as the order is the same as the order used when the log information is uploaded to the blockchain for encryption.
[0067] If the first log event that the user needs to query is an offline event, the obtained first location information includes the encrypted device ID of the camera and the location of the camera. Using the hash algorithm in the information published by the camera, the encrypted device ID + camera location is used as the input of the hash algorithm encryption program to obtain the encrypted first location information. Alternatively, the encrypted device ID can be used as the input of the hash algorithm encryption program to obtain the encrypted first location information. The order of the camera location and the encrypted device ID is not limited, as long as the order is the same as the encryption order used when uploading the log information to the blockchain.
[0068] As can be seen from step S200, the information published in this application includes an encrypted device ID. Instead of directly publishing the device ID, the device ID is published as an encrypted device ID with time parameters. The non-repetition of time parameters is utilized to make the device ID hash value unique and non-repeating. Furthermore, the irreversibility of the hash algorithm is utilized so that even if the "camera location information" and the corresponding "device ID hash value" are announced multiple times, the location of the currently offline camera cannot be calculated.
[0069] Hash encryption includes, but is not limited to, MD2, MD4, MD5, SHA-1, and SHA256.
[0070] The SHA256 algorithm can convert an input of any length into a 256-bit hash value, represented by a 64-bit hexadecimal string. It is obtained through the following three steps: constant initialization, information preprocessing, and logical operation.
[0071] Constant initialization: Calculate the cube root of the eight initial hash values and the sixty-four hash constants, and take the first thirty-two digits of the decimal part of the cube root to obtain the initial constant.
[0072] Information preprocessing: Preprocessing includes adding padding bits and adding length, supplementing the original input binary code with the necessary information to ensure the entire original input binary code conforms to the specified structure. The padding process involves first adding a 1 after the target hash value. If the length does not meet the requirement that the remainder after taking the modulo of 512 is 448, then 0s are added after adding 1s, until the length meets the requirement that the remainder after taking the modulo of 512 is 448.
[0073] The additional length includes: calculating the length information of the binary code of the original input, and supplementing the binary code that satisfies the specified structure (i.e., the binary code after the addition of padding bits).
[0074] Logical operations: Logical operations mainly include bitwise AND, bitwise complement, bitwise XOR, right shift by n bits, right shift by n bits, and finally, calculating the hash value.
[0075] S300: Obtain the device's verification information based on the encrypted first location information, first device area, first time information, and first log event.
[0076] Specifically, the encrypted first location information, first device area, first time information, and first log event are used as the verification information of the camera. When it is necessary to verify the log information within a time period, such as the log information within the time period from October 1, 2020 to October 30, 2020, multiple encrypted first location information, first device area, first time information, and first log event are obtained by traversing them in chronological order. The multiple encrypted first location information, first device area, first time information, and first log event are arranged in chronological order to obtain the verification information.
[0077] S400: Match the encrypted first location information with the stored log information on the blockchain to obtain the device's real log information.
[0078] like Figure 3 As shown, Figure 3 This is a flowchart comparing the stored camera location with the encrypted first location information. In the flowchart, the camera location stored on the blockchain and the encrypted first location information are encrypted using the same hash algorithm and the same input.
[0079] Specifically, the encrypted first location information is matched with the camera location stored on the blockchain. If the encrypted first location information is the same as the camera location stored on the blockchain, the log information corresponding to the same camera location is used as the actual log information of the device.
[0080] The blockchain-based storage system first prepares log data for storage, distributing the log information data acquired from the camera to different modules for storage through a decentralized infrastructure. This mainly includes the following steps:
[0081] 1. Create data shards: The storage system divides the acquired log data into smaller fragments, decomposing the data into manageable blocks. These blocks can be distributed across multiple nodes, such as multiple different servers, based on the type of log data acquired.
[0082] 2. Encrypt each shard: After sharding, the storage system needs to encrypt each log data shard on the local system. The camera owner has complete control over the number of data shards and the encryption method. In this step, the encrypted first location information is matched with the stored log information on the blockchain, ensuring that the log information is not easily tampered with.
[0083] 3. Shard Replication: The storage system replicates each shard, thus providing sufficient redundancy to ensure availability and performance, and prevent performance degradation and data loss. The number of replicas for each shard and the location of these shards are determined by the content owner.
[0084] 4. Distributing replicated shards: P2P networks distribute replicated shards to distributed storage nodes on servers, whether regionally or globally.
[0085] S500: Compare the information to be verified with the actual log information to obtain the verification result.
[0086] Specifically, the encrypted first location information, first device area, first time information, and first log event are compared one by one with the camera location, camera area, log occurrence time, and log event in the real log information to obtain the verification result.
[0087] Verification results may include, but are not limited to, verification passed, verification failed, a device going online and / or going offline on a certain day, or a device going online and / or going offline within the time range of the query.
[0088] The method of the present invention may further include displaying the verification results and querying log information within the time range.
[0089] In some embodiments, if the first log event is an online event, the first location information includes the location of the first device. Step S200 hashes and encrypts the first location information and the first time information according to the first log event and a hash algorithm to obtain the encrypted first location information, specifically including:
[0090] S210. Substitute the first time information and the first device location into the variables of the hash algorithm to obtain the first hash value.
[0091] The hash algorithm mentioned is the one used in the published information and is also the hash algorithm used when encrypting the camera.
[0092] Specifically, "first time information + first device location" can be used as the variable in the hash algorithm, such as "20201210 large classroom". Alternatively, "first device location + first time information" can be used as the variable in the hash algorithm, such as "large classroom 20201210", to obtain the first hash value. The order of the first time information and the first device location is the same as the order in which the log information is uploaded to the chain.
[0093] In another embodiment, step S210 can be replaced by "substituting the first device region, the first time information, and the first device location into the variables of the hash algorithm to obtain the first hash value". The first device region, the first time information, and the first device location can be arranged and combined to obtain 6 possible orders, one of which is "first device region + first time information + first device location", such as "classroom of kindergarten 20201210 in a certain city". The specific arrangement method used as the variable is not limited, as long as the order of the log information when it is uploaded to the chain is the same.
[0094] S220. Use the first hash value as the first location information after encryption.
[0095] For example, if QyyHHz+miOWhHvJU4GEayr0mNMxNO1B5hf+Ot+Ftuz8= is obtained in step S210 as the first hash value, then QyyHHz+miOWhHvJU4GEayr0mNMxNO1B5hf+Ot+Ftuz8= is used as the encrypted first position information.
[0096] In some embodiments, if the first log event is an offline event, the first location information includes the first device identity encryption number and the first device location. Step S200 hashes and encrypts the first location information and the first time information according to the first log event and a hash algorithm to obtain the encrypted first location information, specifically including:
[0097] S230. Substitute the location of the first device and the encrypted identity number of the first device into the variables of the hash algorithm to obtain the second hash value.
[0098] The first device identity encryption number can be, but is not limited to, the device ID after hash encryption, or it can be obtained by encrypting the device ID and the first time information.
[0099] Specifically, the hash algorithm can use "first device identity encryption number + first device location" as the variable. For example, if the first device identity encryption number is "jRtsxjfcgHQfWI202i5l34QZtalV3SI8zwKYDpXMYu8=", then "jRtsxjfcgHQfWI202i5l34QZtalV3SI8zwKYDpXMYu8=" can be used as the first hash value. Alternatively, the hash algorithm can use "first device location + first device identity encryption number" as the variable, for example, "large classroom jRtsxjfcgHQfWI202i5l34QZtalV3SI8zwKYDpXMYu8=". The first hash value is obtained by combining the first time information and the first device identity encryption number in the same order as when the log information is uploaded to the chain.
[0100] In another embodiment, step S230 can be replaced by "substituting the first device region, the first device location, and the first device identity encryption number into the variables of the hash algorithm to obtain the first hash value". The first device region, the first device location, and the first device identity encryption number can be arranged and combined to obtain 6 possible orders, one of which is "first device region + first device location + first device identity encryption number", for example, "Classroom of Kindergarten Class of XX City XX jRtsxjfcgHQfWI202i5l34QZtalV3SI8zwKYDpXMYu8=". The specific arrangement method used as the variable is not limited, as long as the arrangement order is the same as the order when the log information is uploaded to the chain.
[0101] S240. Use the second hash value as the encrypted first position information.
[0102] For example, if 9OQgP4Dw5wCizJgezWWLWm1F0G11ChBMo2IjFUBAsg0= is obtained as the second hash value in step S230, then 9OQgP4Dw5wCizJgezWWLWm1F0G11ChBMo2IjFUBAsg0= is used as the encrypted first position information.
[0103] In some embodiments, such as Figure 4 As shown, Figure 4 This is a flowchart for updating stored log information on a blockchain. The method further includes: S600 updating stored log information on the blockchain, specifically including the following steps:
[0104] S610: Obtain the device's second time information, second log event, second device area, and second location information.
[0105] The information included in the second location information may vary depending on the second log event uploaded by the camera. When the second log event is an online event, the second location information includes, but is not limited to, the device location. When the second log event is an offline event, the second location information includes, but is not limited to, the device ID and the second device location.
[0106] Specifically, as shown in Table 1, Table 1 contains some parameter information used to implement log data uploading and verification. When a camera generates new logs, the camera can directly encrypt its device ID, time parameters (second time information), camera location (second location information), region (second device region), and log events in the form of traffic data and then upload them to the blockchain. Alternatively, it can temporarily cache its device ID, time parameters (second time information), camera location (second location information), region (second device region), and log events in the camera's cache area, and then encrypt and upload them to the blockchain when a network connection is available.
[0107] The area where the equipment is located includes the monitoring range of multiple monitoring devices, such as a certain kindergarten. The camera location is the specific location of the camera in a certain area, such as the senior classroom of a certain kindergarten, where the senior classroom is the camera location.
[0108] Table 1
[0109]
[0110]
[0111] S620. The second time information and the second location information are hashed and encrypted according to the second log event and the preset hash algorithm to obtain the encrypted second location information.
[0112] Specifically, the second location information used for encryption varies depending on the log events generated by the camera. Please refer to step S610 for details, which will not be repeated here.
[0113] The second location information and the second time information used for encryption are used as variables in a preset hash algorithm to encrypt the second location information.
[0114] S630: Update the log information on the blockchain based on the encrypted second location information, second time information, second log event, and second device area.
[0115] Specifically, as shown in Table 2, which is an example table of log information on the blockchain, the encrypted second location information, second time information, second log event, and second device area are stored in the blockchain.
[0116] Table 2
[0117]
[0118] Steps S610-S630 enable the storage of only the camera location log summary on the blockchain, reducing the amount of data stored on the blockchain. Furthermore, the camera location information stored on the blockchain is a hash value, which reduces the leakage of offline camera location information and improves security.
[0119] In some embodiments, the second time information and the second location information are hashed and encrypted according to the second log event and a preset hash algorithm to obtain the encrypted second location information, specifically including:
[0120] S621. If the second log event is an online event, the second location information includes the second device location. The second time information and the second device location of the device are encrypted using a preset hash algorithm to obtain the encrypted second location information.
[0121] The preset hash algorithm is the same as the hash algorithm used when encrypting the camera, and it is the same as the hash algorithm in the published information.
[0122] Specifically, such as Figure 5 As shown, Figure 5 This is an encrypted diagram of an online event log. In the diagram, when the second log event is an online event, the camera position is the second device position, and the time parameter is the second time information. The time parameter is obtained through the method shown in Table 1.
[0123] You can use "second time information + second device location" as the variable in the hash algorithm, such as "20211210 Kindergarten playground south wall", or you can use "second device location + second time information" as the variable in the hash algorithm, such as "Kindergarten playground south wall 20211210", to obtain the encrypted second location information.
[0124] In another embodiment, the step S621, "encrypting the second device area, second time information, and second device location using a preset hash algorithm to obtain encrypted second location information," can be replaced by "encrypting the second time information and second device location using a preset hash algorithm to obtain encrypted second location information." The second device area, second time information, and second device location can be arranged and combined to obtain six possible orders, and the specific arrangement method used as a variable is not limited.
[0125] S622. If the second log event is an offline event, the second location information includes the device's identification number and the second device location. The device's second time information and the device's identification number are encrypted using a preset hash algorithm to obtain the second device identification encrypted number. The second device identification encrypted number and the second device location are encrypted using a preset hash algorithm to obtain the encrypted second location information.
[0126] Specifically, such as Figure 6 As shown, Figure 6 This is a schematic diagram of an encrypted offline event log. In the diagram, when the second log event is an offline event, the camera position is the second device position, and the time parameter is the second time information. The time parameter is obtained through the method shown in Table 1.
[0127] When the second log event is an offline event, the log information after being encrypted twice is stored on the blockchain. The second time information and the device ID are used as inputs to the preset encryption algorithm for the first encryption to obtain the second device identity encryption number. The input of the preset encryption algorithm can be "second time information + device ID", such as "machine code 2211011530" or "device ID + second time information", such as "machine code 2211011530".
[0128] The second device identity encryption number and the second device location are used as inputs to a preset algorithm for a second encryption to obtain the encrypted second location information. The inputs to the preset algorithm can be either "second device identity encryption number + second device location" or "second device location + second device identity encryption number".
[0129] In another embodiment, the step S622, "encrypting the second device area, the second device identity encryption number, and the second device location using a preset hash algorithm to obtain encrypted second location information," can be replaced by "encrypting the second device identity encryption number and the second device location using a preset hash algorithm to obtain encrypted second location information." The second device area, the second device identity encryption number, and the second device location can be arranged and combined to obtain 6 possible orders, and the specific arrangement method used as a variable is not limited.
[0130] In some embodiments, such as Figure 7 As shown, Figure 7 This is a flowchart for obtaining the device's actual log information. The S400 matches the encrypted first location information with the stored log information on the blockchain to obtain the device's actual log information, specifically including:
[0131] S410. Perform region matching based on the first device region and the stored log information on the blockchain to obtain the first log information belonging to the first device region.
[0132] Specifically, as shown in Table 1, the log information stored on the blockchain is stored in the form of encrypted camera location, date, log event and region. First, the log information belonging to the first device region is found using the first device region, and the first log information of the first device region is obtained.
[0133] S420. Match the encrypted first location information with the first log information to obtain the device's real log information.
[0134] Specifically, such as Figure 3 As shown, the encrypted first location information obtained in step S200 is then matched with the first log information. Specifically, it is matched with the encrypted location information stored in the first log information. If the encrypted location information that is the same as the encrypted first location information is matched in the first log information, then the log information corresponding to the encrypted location information is used as the actual log information of the device.
[0135] In some embodiments, if in steps S621 and S622, the online logs are encrypted by "encrypting the second device area, second time information, and second device location of the device using a preset hash algorithm to obtain encrypted second location information," and the offline logs are encrypted by "encrypting the second device area, second device identity encryption number, and second device location of the device using a preset hash algorithm to obtain encrypted second location information," then step S410 can be omitted in step S400. Instead, step S420 can be replaced by "matching the encrypted first location information with the location of the stored log information on the blockchain to obtain the device's real log information." The specific matching method is similar to that in step S420.
[0136] In some embodiments, such as Figure 8 As shown, Figure 8 This is a flowchart for obtaining verification results. The S500 compares the information to be verified with the actual log information to obtain the verification results, which specifically include:
[0137] S510. Compare the information to be verified with the actual log information.
[0138] Specifically, the encrypted first location information, first device area, first time information, and first log event in the information to be verified are compared one by one with the encrypted camera location, area, time, and log event in the real log information.
[0139] S520. If the information to be verified is the same as the actual log information, the verification result shall be considered as passing the verification.
[0140] Specifically, if the encrypted first location information, the first device area, the first time information, and the first log event are all identical to the encrypted camera location, area, time, and log event in the real log information, then the verification result is considered to have passed the verification.
[0141] S530. If the information to be verified is different from the actual log information, the verification result shall be verification failure.
[0142] Specifically, if any of the encrypted first location information, first device area, first time information, and first log event differs from the encrypted camera location, area, time, and log event in the real log information, the verification result is considered to be verification failure.
[0143] This invention can be applied to "transparent kitchen" systems, kindergarten video surveillance projects, and nursing home video surveillance and analysis systems.
[0144] As an example, a specific application instance of the device log verification method of this application is as follows:
[0145] An investigation revealed a food safety incident at a kindergarten on November 6, 2022. The kindergarten claimed that the kitchen security camera had been broken for a month and could not provide any information about the kitchen. The public expressed skepticism and demanded verification of the camera logs. Table 3 shows the camera information released by the kindergarten.
[0146] Table 3
[0147] area Kindergarten in a certain district of a certain city Surveillance camera location Monitoring of raw food processing in kitchens Time parameters 20221003 Device ID hash value jRtsxjfcgHQfWI202i5l34QZtalV3SI8zwKYDpXMYu8= Hash encryption method SHA256
[0148] The device ID hash value was obtained by the kindergarten based on the camera ID: 00:1B:44:11:3A:B7, plus the "time parameter": 20221003, and calculated using SHA256 hash.
[0149] The public can obtain the encrypted location information of the surveillance cameras monitoring the processing of raw food in the kitchen using the SHA256 method described above. Based on the region, namely a certain kindergarten in a certain city and district, the log information is searched on the blockchain to obtain Table 4. Table 4 is the log information of all cameras in the region from when they went online (time range: October 2022 to November 30, 2022).
[0150] Table 4
[0151]
[0152]
[0153] Conclusion: On October 3, it was found that there was one offline camera log and three online camera logs in the area where the kindergarten is located.
[0154] Based on the calculation method of the encrypted first location information of the offline log, the camera position (encrypted first location information) is calculated using the SHA256 algorithm: "Camera position information" + "encrypted device ID", that is, "Kitchen raw food processing and production monitoring jRtsxjfcgHQfWI202i5l34QZtalV3SI8zwKYDpXMYu8=".
[0155] The SHA256 hash value is “Ab9xxPqoeeOyF8H6GucpMpPxHs / IfCxghunSlY9dL / w=”.
[0156] Comparing the calculated "Ab9xxPqoeeOyF8H6GucpMpPxHs / IfCxghunSlY9dL / w=", time, log event, and region with Table 4, we conclude that: after comparing with the blockchain log information, the camera had an offline alarm log on October 3, which means that there was an offline alarm log corresponding to the first log event within the query range.
[0157] Based on the calculation method of the encrypted first location information of the offline logs, the camera location (encrypted first location information) is calculated using the SHA256 algorithm and the time parameters published by the kindergarten. Table 5 is the online log information table obtained by querying.
[0158] Table 5
[0159]
[0160] Conclusion: The information regarding the online monitoring of raw food processing cameras in the kitchen on November 5, 2022, matches the information recorded on the blockchain.
[0161] Verification results: After checking the logs, the "Raw Food Processing and Production Monitoring" camera went offline on October 3 and came back online on November 5. The incident occurred on November 6, 2022. This camera is in normal working order. The conclusion that the kitchen camera at the kindergarten incident site had been damaged for a month has failed to be verified.
[0162] The verification results may include offline alarm logs corresponding to the first log event within the query range time period, online alarm logs corresponding to the first log event within the query range time period, whether the offline alarm logs and online alarm logs match the log information on the blockchain, and the aforementioned verification results.
[0163] In some embodiments, such as Figure 9 As shown, Figure 9 This is a schematic diagram of a device log verification system structure. The present invention provides a device log verification system structure, including a camera module, a verification module, and a blockchain module, wherein...
[0164] The camera module is used to generate device log information and store it in the blockchain module.
[0165] The verification module is used to implement the method described in the preceding claims;
[0166] The blockchain module is used to store encrypted log information from several devices.
[0167] Specifically, the camera module is used to generate online and offline logs of the device, and stores the device log information in the blockchain module after encryption. The blockchain module stores the encrypted log information of the device, and when querying, the verification module obtains the conclusion based on the information published by the camera module and the method described above.
[0168] In some embodiments, such as Figure 10 As shown, Figure 10 This is a schematic diagram of the structure of an electronic device provided by the present invention. The present invention also provides an electronic device, which includes a processor 100 and a memory 101. The memory 101 stores a computer program, and when the processor 100 executes the computer program, it implements any of the methods described in the above method embodiments.
[0169] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. The memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include remote memory located remotely relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0170] Furthermore, embodiments of this application also disclose a computer program product or computer program stored in a computer-readable storage medium. A processor of a computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the methods described above.
[0171] The present invention also provides a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the method of the above-described method embodiments.
[0172] Similarly, the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0173] It is understood that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0174] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A device log verification method, characterized by, Includes the following steps: Obtain the device's published information; the published information includes first address information, first time information, first log event, and hash algorithm; the first address information includes first location information and first device region; The first location information and the first time information are hashed and encrypted according to the first log event and the hash algorithm to obtain the encrypted first location information; the first log event includes an online event or an offline event; wherein, if the first log event is an online event, the first location information includes the first device location, and the first time information and the first device location are substituted into the variables of the hash algorithm to obtain a first hash value; the first hash value is used as the encrypted first location information; if the first log event is an offline event, the first location information includes the first device identity encryption number and the first device location, and the first device identity encryption number and the first device location are substituted into the variables of the hash algorithm to obtain a second hash value; the second hash value is used as the encrypted first location information; The device's verification information is obtained based on the encrypted first location information, the first device region, the first time information, and the first log event. The encrypted first location information is matched with the stored log information on the blockchain to obtain the actual log information of the device; The verification result is obtained by comparing the information to be verified with the actual log information.
2. The method according to claim 1, characterized in that, The method further includes: updating the storage log information on the blockchain, wherein updating the storage log information on the blockchain specifically includes the following steps: Acquire the device's second time information, second log events, second device region, and second location information; The second time information and the second location information are hashed and encrypted according to the second log event and the preset hash algorithm to obtain the encrypted second location information; The log information on the blockchain is updated based on the encrypted second location information, the second time information, the second log event, and the second device area.
3. The method according to claim 2, characterized in that, The step of hashing and encrypting the second time information and the second location information according to the second log event and a preset hash algorithm to obtain the encrypted second location information specifically includes: If the second log event is an online event, then the second location information includes the second device location. The second time information of the device and the second device location are encrypted using a preset hash algorithm to obtain the encrypted second location information. If the second log event is an offline event, the second location information includes the device's identification number and the second device location. The second time information and the device's identification number are encrypted using the preset hash algorithm to obtain the second device identification encrypted number. The second device identification encrypted number and the second device location are then encrypted using the preset hash algorithm to obtain the encrypted second location information.
4. The method according to any one of claims 1-3, characterized in that, The step of matching the encrypted first location information with the stored log information on the blockchain to obtain the actual log information of the device specifically includes: The first log information belonging to the first device region is obtained by matching the region with the stored log information on the blockchain. The device's actual log information is obtained by matching the encrypted first location information with the first log information.
5. The method according to any one of claims 1-3, characterized in that, The step of comparing the information to be verified with the actual log information to obtain the verification result specifically includes: Compare the information to be verified with the actual log information; If the information to be verified is the same as the actual log information, then passing the verification is the verification result; If the information to be verified is different from the actual log information, the verification result is verification failure.
6. A device log verification system, characterized in that, It includes a camera module, a verification module, and a blockchain module, among which, The camera module is used to generate device log information and store the device log information in the blockchain module; The verification module is used to implement the method described in any one of claims 1-5; The blockchain module is used to store encrypted log information from several devices.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It contains a processor-executable program, which, when executed by a processor, is used to perform the method as described in any one of claims 1-5.