Message tracking method and device, electronic equipment and nonvolatile storage medium
By building a multi-level hash chain in a wireless communication environment, tracking and verifying the message transmission path, the problem of message vulnerability in wireless communication is solved, and the integrity of the message and the reliability of the transmission path are achieved.
Patent Information
- Application Number
- CN202411867403.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
In a wireless communication environment, the delivery path of messages can be complex and vulnerable, resulting in message loss, tampering and replay attacks, which in turn threatens the integrity of the data.
By generating data blocks corresponding to communication messages in the transmission device and adding them to the end of the basic hash chain, a multi-level hash chain (base chain, aggregate chain, global chain) is built to track the message transmission path and verify the message integrity.
Through the multi-level hash chain structure, it increases the difficulty of fighting replay attacks and forgery attacks, ensures the integrity of the message and traceability of the transmission path, and solves the situation where the message is tampered with.
Smart Images

Figure CN119815295A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of network technology and security technology, and in particular to a message tracking method, device, electronic device and non-volatile storage medium. Background Art
[0002] Message tracking between wireless transmission devices refers to tracking and recording the transmission path and status information of messages between different devices in a wireless communication environment. In a wireless transmission environment, the transmission path of a message may pass through multiple devices and nodes. Tracking the transmission path and status of a message is very cumbersome and often faces security risks such as message loss, tampering, and replay attacks, which threatens data integrity.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a message tracking method, device, electronic device and non-volatile storage medium to at least solve the technical problem that the message tracking method in the related art may be subject to message tampering.
[0005] According to one aspect of an embodiment of the present application, a message tracking method is provided, including: when a transmission device sends a communication message, generating a data block corresponding to the communication message, and adding the data block to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, each data block contains a basic hash value, the basic hash value in the first data block is determined according to the message content of the corresponding communication message and the basic hash value in the second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; determining an aggregate hash value according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and determining an aggregate hash chain according to the aggregate hash value; determining a global hash value according to the aggregate hash value in the aggregate hash chain, and determining a global hash chain according to the global hash value, wherein the global hash chain is used to characterize the overall state of the system; when a transmission device in the system receives a communication message, tracing back and verifying the integrity of the received communication message according to the global hash chain and / or the aggregate hash chain.
[0006] Optionally, generating a data block corresponding to a communication message includes: determining basic information corresponding to the communication message, wherein the basic information includes at least one of the following: a message identifier, a source device identifier, a destination device identifier, a timestamp, and summary information corresponding to the message content of the communication message; obtaining a basic hash value in the last data block in a basic hash chain corresponding to the transmission device, and determining a new basic hash value based on the basic hash value and the summary information corresponding to the message content; determining a new data block based on the newly determined basic hash value and the basic information corresponding to the communication message, wherein the data block is used to characterize the transmission path of the communication message.
[0007] Optionally, determining the aggregate hash chain based on the aggregate hash value includes: after each first time period, obtaining the basic hash value in the last data block in the basic hash chain corresponding to the transmission device; performing an aggregation operation on the obtained multiple basic hash values to obtain an aggregate hash value, and determining the aggregation information corresponding to the aggregate hash value, wherein the aggregation information includes at least one of the following: an aggregation identifier, a source device identifier set, a destination device identifier set, and an aggregation time range; adding the aggregate hash value and the aggregation information to the end of the aggregate hash chain, wherein the aggregate hash chain contains multiple aggregate hash values arranged in sequence, and each aggregation operation corresponds to an aggregate hash value.
[0008] Optionally, determining the global hash chain based on the global hash value includes: when the global hash chain is empty, determining an initial global state value corresponding to the system, and determining a global hash value based on the initial global state value and all aggregate hash values in the aggregate hash chain; updating the global state value corresponding to the system based on the global hash value, and adding the global hash value and corresponding global information to the global hash chain, wherein the global information includes at least one of the following: a global snapshot identifier and an aggregate identifier set.
[0009] Optionally, determining the global hash chain based on the global hash value also includes: when the global hash chain is not empty, obtaining a newly added aggregate hash value in the aggregate hash chain every second time period, wherein the newly added aggregate hash value is the newly added aggregate hash value in the aggregate hash chain within the second time period after the last time the newly added aggregate hash value was obtained from the aggregate hash chain; determining a new global hash value based on the newly added aggregate hash value and the global state value corresponding to the system; updating the global state value corresponding to the system based on the global hash value, and adding the global hash value and the corresponding global information to the end of the global hash chain.
[0010] Optionally, tracking, tracing and integrity verification of the received communication message based on the global hash chain and / or the aggregate hash chain include: verifying the integrity of the received communication message based on the last global hash value in the global hash chain and the aggregate hash value corresponding to the global hash value in the aggregate hash chain, and determining the transmission path of the communication message; and / or verifying the integrity of the received communication message based on the last aggregate hash value in the aggregate hash chain and the aggregate hash value corresponding to the aggregate hash value in the basic hash chain, and determining the transmission path of the communication message.
[0011] Optionally, the transmission device includes: a sending end and a receiving end, wherein the sending end is used to encrypt the content of the communication message using the public key of the receiving end corresponding to the communication message when sending the communication message, and digitally sign the communication message using the private key of the sending end; the receiving end is used to verify the validity of the digital signature of the communication message when receiving the communication message, and decrypt the content of the communication message using the private key of the receiving end.
[0012] According to another aspect of an embodiment of the present application, a message tracking device is also provided, including: a basic chain update module, which is used to generate a data block corresponding to a communication message when a transmission device sends a communication message, and add the data block to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, and each data block contains a basic hash value, and the basic hash value in the first data block is determined according to the message content of the corresponding communication message and the basic hash value in the second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; an aggregate chain update module, which is used to determine an aggregate hash value according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and determine an aggregate hash chain according to the aggregate hash value; a global chain update module, which is used to determine a global hash value according to the aggregate hash value in the aggregate hash chain, and determine a global hash chain according to the global hash value, wherein the global hash chain is used to characterize the overall state of the system; a verification and tracking module, which is used to track, trace back and verify the integrity of the received communication message according to the global hash chain and / or the aggregate hash chain when a transmission device in the system receives a communication message.
[0013] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the message tracking method is executed when the program is run.
[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, wherein the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the message tracking method by running the computer program.
[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which implements the steps of the message tracking method when the computer program is executed by a processor.
[0016] In an embodiment of the present application, when a transmission device sends a communication message, a data block corresponding to the communication message is generated, and the data block is added to the end of the basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, and each data block contains a basic hash value, and the basic hash value in the first data block is determined according to the message content of the corresponding communication message and the basic hash value in the second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; the aggregate hash value is determined according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and the aggregate hash value is determined according to the aggregate hash value. Hash value, determine the aggregate hash chain; determine the global hash value according to the aggregate hash value in the aggregate hash chain, and determine the global hash chain according to the global hash value, wherein the global hash chain is used to characterize the overall state of the system; when the transmission device in the system receives the communication message, the received communication message is tracked, traced back and the integrity is verified according to the global hash chain and / or the aggregate hash chain, and the message data is divided into three levels: basic chain, aggregate chain and global chain by constructing a multi-level hash chain. The difficulty of resisting replay attack and forgery attack is increased based on the multi-level hash chain structure, thereby solving the technical problem that the message tracking method in the related technology may be tampered with. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a message tracking method provided in an embodiment of the present application;
[0019] Figure 2 It is a schematic diagram of a message tracking method flow provided according to an embodiment of the present application;
[0020] Figure 3 It is a schematic diagram of a message tracking system between wireless transmission devices based on a multi-level hash chain according to an embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of a method flow for a sending end device and a receiving end device to build a hash chain according to an embodiment of the present application;
[0022] Figure 5 It is a structural diagram of a message tracking device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] Message tracking between wireless transmission devices refers to tracking and recording the transmission path and status information of messages between different devices in a wireless communication environment. When multiple wireless transmission devices communicate with each other, messages may be forwarded and transmitted through multiple intermediate devices, and may face problems such as loss, delay or tampering during the transmission process. Therefore, in order to ensure the reliability, integrity and sequence of messages, message tracking is required. However, the message tracking method in the related art cannot effectively prevent the tampering or forgery of messages. Message tracking involves recording and transmitting relevant information of messages. How to ensure the integrity and security of this information and prevent the messages received by the receiving device from being tampered with is an issue that needs to be considered.
[0026] In order to solve the above problems, relevant solutions are provided in the embodiments of the present application, which are described in detail below.
[0027] According to an embodiment of the present application, a method embodiment of message tracking is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or electronic device) for implementing a message tracking method. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0029] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or electronic device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0030] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the message tracking method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned message tracking method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).
[0033] In the above operating environment, the embodiment of the present application provides a message tracking method. Figure 2 is a schematic diagram of a message tracking method flow provided according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0034] Step S202, when the transmission device sends a communication message, a data block corresponding to the communication message is generated, and the data block is added to the end of the basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, each data block contains a basic hash value, the basic hash value in the first data block is determined according to the message content of the corresponding communication message, and the basic hash value in the second data block is determined, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain;
[0035] Step S204, determining an aggregate hash value according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and determining an aggregate hash chain according to the aggregate hash value;
[0036] Step S206, determining a global hash value according to the aggregate hash value in the aggregate hash chain, and determining a global hash chain according to the global hash value, wherein the global hash chain is used to characterize the overall state of the system;
[0037] Step S208, when the transmission device in the system receives the communication message, the received communication message is tracked and verified for integrity according to the global hash chain and / or the aggregated hash chain.
[0038] Through the above steps, by building a multi-level hash chain, the message data is divided into three levels: basic chain, aggregation chain, and global chain. The multi-level hash chain structure increases the difficulty of resisting replay attacks and forgery attacks, thereby solving the technical problem that the message tracking method in the related technology may be tampered with.
[0039] The message tracking method in steps S202 to S208 of the embodiment of the present application is further introduced below.
[0040] In the embodiment of the present application, by constructing a multi-level hash chain during the message sending and receiving process, the message data is divided into three levels, including: basic hash chain L1, aggregated hash chain L2, and global hash chain L3. Among them, the basic hash chain L1 is mainly responsible for recording the basic information of each communication message in real time, including the sender ID (source device identification), the receiver ID (destination device identification), the timestamp and the content summary, and the basic message chain is formed by connecting the hash value; the aggregated chain hash chain L2 is responsible for periodically aggregating the L1 messages from different devices, generating the corresponding aggregated hash value, and recording the interaction relationship of the related devices; the global hash chain L3 maintains the global state snapshot and integrates all L2 aggregate information to facilitate the historical complete data backtracking. In this embodiment, the hash value in the hash chain is calculated based on the previous / previous level hash value. The attacker needs to control the entire chain to forge valid data, thereby increasing the difficulty of replay attacks and forgery attacks. In addition, the embodiment of the present application allows a large number of messages to be verified by fewer hash values, that is, the recipient of the message only needs to check the latest hash value and the hash value of the previous level to verify the integrity and propagation path of the message. The following is a detailed introduction.
[0041] In this embodiment, the present application solution can be Figure 3 Running in the system shown, Figure 3As shown, the system includes: an encryption authentication module, a hash chain generation module, a hash chain storage module, and a hash chain verification module, wherein the encryption authentication module is used to perform operations such as encryption and decryption and data signing during communication message transmission, as shown below.
[0042] In some embodiments of the present application, the transmission device includes: a sending end and a receiving end, wherein the sending end is used to encrypt the content of the communication message using the public key of the receiving end corresponding to the communication message when sending the communication message, and digitally sign the communication message using the private key of the sending end; the receiving end is used to verify the validity of the digital signature of the communication message when receiving the communication message, and decrypt the content of the communication message using the private key of the receiving end.
[0043] Specifically, during the message generation phase, the sending device (sender) can encrypt the message using a symmetric or asymmetric encryption algorithm through an encryption authentication module. For example, the sending device uses the public key of the receiving device to encrypt and uses its own private key to digitally sign. The receiving device uses its own private key to decrypt the message and uses the public key of the sending device to verify the validity of the digital signature.
[0044] The above-mentioned hash chain generation module is responsible for generating and maintaining a multi-level hash chain for message tracking; the hash chain storage module is used to store the generated hash chain and related inter-device communication messages; the hash chain verification module is used to verify the integrity of the received messages and ensure the accuracy and traceability of the communication information.
[0045] The following is a further introduction to the process of building a hash chain between the sending device and the receiving device. Figure 4 is a schematic diagram of a method flow for a sending end device and a receiving end device to construct a hash chain according to an embodiment of the present application, such as Figure 4 shown.
[0046] First, the basic hash chain is initialized. For example, when the sender generates a communication message, a basic hash chain is created to record the message content, calculate and generate the corresponding basic hash value, and fill in the information of other blocks to obtain the initial data block, which is added to the basic hash chain corresponding to the sender.
[0047] Afterwards, when a new communication message is generated at the sending end, a data block corresponding to the communication message is generated, and the data block is added to the end of the basic hash chain corresponding to the transmission device. The specific steps are as follows.
[0048] In some embodiments of the present application, generating a data block corresponding to a communication message includes: determining basic information corresponding to the communication message, wherein the basic information includes at least one of the following: a message identifier, a source device identifier, a destination device identifier, a timestamp, and summary information corresponding to the message content of the communication message; obtaining a basic hash value in the last data block in a basic hash chain corresponding to the transmission device, and determining a new basic hash value based on the basic hash value and the summary information corresponding to the message content; determining a new data block based on the newly determined basic hash value and the basic information corresponding to the communication message, wherein the data block is used to characterize the transmission path of the communication message.
[0049] Specifically, when calculating the basic hash value of the current data block, the basic hash value of the previous data block in the basic hash chain and the new data of the current communication message can be used to determine it. After determining the basic hash value corresponding to the current communication message, fill in other block information, including but not limited to: message ID (message identification), source device ID (source device identification), target device ID (destination device identification), timestamp, content summary, hash value of the previous node, etc., so as to obtain the current data block, and then add the data block to the end of the basic hash chain corresponding to the sending end.
[0050] For example, suppose there are multiple basic hash chains L1-1, L1-2, L1-3, ..., L1-n in the current system, and each chain contains a series of basic hash values, where each basic hash value is calculated by the previous basic hash value and new data, as shown below:
[0051] L1-1:H1_0, H1_1, H1_2,..., H1_m;
[0052] L1-2:H2_0, H2_1, H2_2,..., H2_m; ...
[0054] L1-n:Hn_0, Hn_1, Hn_2,..., Hn_m.
[0055] In an embodiment of the present application, newly generated hash values can also be extracted from multiple basic hash chains regularly or on demand to form nodes in an aggregated hash chain, that is, a hash algorithm is used to aggregate basic hash values from different basic hash chains to generate an aggregated hash value. The specific steps are as follows.
[0056] In some embodiments of the present application, determining an aggregate hash chain based on an aggregate hash value includes the following steps: after each first time period, obtaining a basic hash value in the last data block in a basic hash chain corresponding to a transmission device; performing an aggregation operation on the obtained multiple basic hash values to obtain an aggregate hash value, and determining aggregation information corresponding to the aggregate hash value, wherein the aggregation information includes at least one of the following: an aggregation identifier, a source device identifier set, a destination device identifier set, and an aggregation time range; adding the aggregate hash value and the aggregation information to the end of the aggregate hash chain, wherein the aggregate hash chain contains multiple aggregate hash values arranged in sequence, and each aggregation operation corresponds to an aggregate hash value.
[0057] Specifically, the messages in multiple L1 chains are aggregated to construct an aggregate hash chain to provide data integration and cross-device verification. For example, the final hash value (i.e., the hash value in the last data block) in each basic hash chain L1 can be merged (the merging method can be direct splicing), and then a hash aggregation operation is performed to obtain an aggregate hash value, such as: L1_Aggre = Hash (H1_m||H2_m||...Hn_m), and by recording and generating multiple aggregate hash values regularly or at a specific time, an aggregate hash chain L2 can be formed: L1_Aggre_0, L1_Aggre_1, L1_Aggre_2,..., L1_Aggre_n, wherein the aggregate hash chain can be used to provide data integration and cross-device verification, including: aggregate ID (aggregate identification), source device ID set list, target device ID set list, aggregate time range, aggregate hash value, and previous level hash value.
[0058] Furthermore, the aggregated hash value of the aggregated hash chain L2 can be regularly aggregated to the global hash chain L3, where the global hash chain is used to record the overall status and historical verification information of the entire system, and provide a global view, including a global snapshot ID (global snapshot identifier), an aggregated ID set, a system status summary, a global hash value, a previous level hash value, etc., as follows.
[0059] In some embodiments of the present application, determining a global hash chain based on a global hash value includes the following steps: when the global hash chain is empty, determining an initial global state value corresponding to the system, and determining a global hash value based on the initial global state value and all aggregate hash values in the aggregate hash chain; updating the global state value corresponding to the system based on the global hash value, and adding the global hash value and corresponding global information to the global hash chain, wherein the global information includes at least one of the following: a global snapshot identifier and an aggregate identifier set.
[0060] In some embodiments of the present application, determining the global hash chain based on the global hash value also includes the following steps: when the global hash chain is not empty, obtaining a newly added aggregate hash value in the aggregate hash chain every second time period, wherein the newly added aggregate hash value is the newly added aggregate hash value in the aggregate hash chain within the second time period after the last time the newly added aggregate hash value was obtained from the aggregate hash chain; determining a new global hash value based on the newly added aggregate hash value and the global state value corresponding to the system; updating the global state value corresponding to the system based on the global hash value, and adding the global hash value and the corresponding global information to the end of the global hash chain.
[0061] Specifically, when the global hash chain is empty, the global hash chain is initialized first. Specifically, the initial global state value initial_state is set, and the hash value corresponding to the global state value H_L3_inital=Hash(initial_state) is determined; the aggregate hash value on the aggregate hash chain L2 is combined with the hash value corresponding to the current global state to determine the global hash value, for example, L3_1=Hash(H_L3_inital||L1_Aggre_0||L1_Aggre_1||L1_Aggre_2).
[0062] After that, as time goes by, the aggregate hash chain L2 will continue to be updated. Each time the aggregate hash chain L2 is updated, the L3 chain will receive the new aggregate hash value and update its own state. For example, if the aggregate hash values of L2_4 and L2_5 are continued to be received, the state will be further updated: L3_2 = Hash (L3_1||Hash (L2_4)||Hash (L2_5)). In this way, the L3 chain continuously aggregates the aggregate hash values of all L2 chains and finally forms a comprehensive global state. Each time the state of the L2 chain is updated, the L3 chain aggregates these changes and generates a new global hash value.
[0063] When the sender sends communication information to the receiver, the encrypted chain information (multi-level hash chain) is also transmitted to the receiving segment device through the wireless channel, so that the receiving device can perform decryption and verification operations after receiving the communication information, as follows.
[0064] In some embodiments of the present application, tracking, tracing back and verifying the integrity of a received communication message based on a global hash chain and / or an aggregate hash chain includes the following steps: verifying the integrity of the received communication message and determining the transmission path of the communication message based on the last global hash value in the global hash chain and the aggregate hash value corresponding to the global hash value in the aggregate hash chain; and / or verifying the integrity of the received communication message and determining the transmission path of the communication message based on the last aggregate hash value in the aggregate hash chain and the aggregate hash value corresponding to the aggregate hash value in the basic hash chain.
[0065] Specifically, after the receiving device uses the public key of the sending device to verify the validity of the digital signature, it can verify the message hash value of the corresponding device ID based on the aggregation chain or the global chain. The recipient only needs to check the latest hash value and the hash value of the previous level to trace and verify the transmission order and integrity of the message.
[0066] In the multi-level hash chain of the embodiment of the present application, the hash value of each layer is generated based on the hash value of the previous layer and the current data. This dependency ensures that any change to the data will cause the hash values of all subsequent layers to become invalid. In wireless communications, transmitting integrity verification information for each file or data block usually requires additional bandwidth, while the design of the multi-level hash chain in the embodiment of the present application allows the integrity of multiple messages to be proven with less information. Through the scheme in the embodiment of the present application, the receiving device can independently verify the integrity of the message without relying on an external verification mechanism. This independence reduces dependence on external resources and trust, and improves the autonomy and reliability of the system. In addition, the multi-level hash chain can be continuously updated as new messages are added, and new messages can be added to the existing structure by calculating new hash values and updating the chain.
[0067] The present application provides a design and use method for constructing a multi-level hash chain structure. By constructing a multi-level hash chain, the transmission path and status of a message can be tracked, and the message can be tracked and traced. In addition, the integrity and authenticity of the message can be ensured through the algorithm and judgment mechanism of message integrity verification.
[0068] According to an embodiment of the present application, an embodiment of a message tracking device is also provided. Figure 5 Schematic diagram of a message tracking device provided according to an embodiment of the present application. Figure 5 As shown, the device comprises:
[0069] A basic chain update module 50, for generating a data block corresponding to a communication message when a transmission device sends a communication message, and adding the data block to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain comprises a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, each data block comprises a basic hash value, the basic hash value in the first data block is determined according to the message content of the corresponding communication message, and the basic hash value in the second data block is determined, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain;
[0070] The aggregation chain updating module 52 is used to determine the aggregation hash value according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and determine the aggregation hash chain according to the aggregation hash value;
[0071] A global chain update module 54, used to determine a global hash value according to an aggregate hash value in an aggregate hash chain, and to determine a global hash chain according to the global hash value, wherein the global hash chain is used to represent the overall state of the system;
[0072] The verification and tracking module 56 is used to track and verify the integrity of the received communication message according to the global hash chain and / or the aggregate hash chain when the transmission device in the system receives the communication message.
[0073] Optionally, generating a data block corresponding to a communication message includes: determining basic information corresponding to the communication message, wherein the basic information includes at least one of the following: a message identifier, a source device identifier, a destination device identifier, a timestamp, and summary information corresponding to the message content of the communication message; obtaining a basic hash value in the last data block in a basic hash chain corresponding to the transmission device, and determining a new basic hash value based on the basic hash value and the summary information corresponding to the message content; determining a new data block based on the newly determined basic hash value and the basic information corresponding to the communication message, wherein the data block is used to characterize the transmission path of the communication message.
[0074] Optionally, determining the aggregate hash chain based on the aggregate hash value includes: after each first time period, obtaining the basic hash value in the last data block in the basic hash chain corresponding to the transmission device; performing an aggregation operation on the obtained multiple basic hash values to obtain an aggregate hash value, and determining the aggregation information corresponding to the aggregate hash value, wherein the aggregation information includes at least one of the following: an aggregation identifier, a source device identifier set, a destination device identifier set, and an aggregation time range; adding the aggregate hash value and the aggregation information to the end of the aggregate hash chain, wherein the aggregate hash chain contains multiple aggregate hash values arranged in sequence, and each aggregation operation corresponds to an aggregate hash value.
[0075] Optionally, determining the global hash chain based on the global hash value includes: when the global hash chain is empty, determining an initial global state value corresponding to the system, and determining a global hash value based on the initial global state value and all aggregate hash values in the aggregate hash chain; updating the global state value corresponding to the system based on the global hash value, and adding the global hash value and corresponding global information to the global hash chain, wherein the global information includes at least one of the following: a global snapshot identifier and an aggregate identifier set.
[0076] Optionally, determining the global hash chain based on the global hash value also includes: when the global hash chain is not empty, obtaining a newly added aggregate hash value in the aggregate hash chain every second time period, wherein the newly added aggregate hash value is the newly added aggregate hash value in the aggregate hash chain within the second time period after the last time the newly added aggregate hash value was obtained from the aggregate hash chain; determining a new global hash value based on the newly added aggregate hash value and the global state value corresponding to the system; updating the global state value corresponding to the system based on the global hash value, and adding the global hash value and the corresponding global information to the end of the global hash chain.
[0077] Optionally, tracking, tracing and integrity verification of the received communication message based on the global hash chain and / or the aggregate hash chain include: verifying the integrity of the received communication message based on the last global hash value in the global hash chain and the aggregate hash value corresponding to the global hash value in the aggregate hash chain, and determining the transmission path of the communication message; and / or verifying the integrity of the received communication message based on the last aggregate hash value in the aggregate hash chain and the aggregate hash value corresponding to the aggregate hash value in the basic hash chain, and determining the transmission path of the communication message.
[0078] Optionally, the transmission device includes: a sending end and a receiving end, wherein the sending end is used to encrypt the content of the communication message using the public key of the receiving end corresponding to the communication message when sending the communication message, and digitally sign the communication message using the private key of the sending end; the receiving end is used to verify the validity of the digital signature of the communication message when receiving the communication message, and decrypt the content of the communication message using the private key of the receiving end.
[0079] It should be noted that the various modules in the above-mentioned message tracking device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0080] It should be noted that the message tracking device provided in this embodiment can be used to execute Figure 2The message tracking method shown, therefore, the relevant explanations and instructions on the above message tracking method are also applicable to the embodiments of the present application and will not be repeated here.
[0081] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following message tracking method by running the computer program: when a transmission device sends a communication message, a data block corresponding to the communication message is generated, and the data block is added to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain includes a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, and each data block includes a basic hash value, and the basic hash value in the first data block is determined according to the message content of the corresponding communication message and the basic hash value in the second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; according to the basic hash values in the basic hash chains corresponding to each transmission device in the system, an aggregate hash value is determined, and according to the aggregate hash value, an aggregate hash chain is determined; according to the aggregate hash value in the aggregate hash chain, a global hash value is determined, and according to the global hash value, a global hash chain is determined, wherein the global hash chain is used to characterize the overall state of the system; when a transmission device in the system receives a communication message, according to the global hash chain and / or the aggregate hash chain, the received communication message is tracked, traced back, and integrity verified.
[0082] The embodiment of the present application also provides a computer program product, including a computer program, which implements the steps of the message tracking method described in each embodiment of the present application when executed by a processor: when a transmission device sends a communication message, a data block corresponding to the communication message is generated, and the data block is added to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each data block corresponds to a communication message, each data block contains a basic hash value, the basic hash value in the first data block is determined according to the message content of the corresponding communication message and the basic hash value in the second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; according to the basic hash values in the basic hash chains corresponding to each transmission device in the system, an aggregate hash value is determined, and according to the aggregate hash value, an aggregate hash chain is determined; according to the aggregate hash value in the aggregate hash chain, a global hash value is determined, and according to the global hash value, a global hash chain is determined, wherein the global hash chain is used to characterize the overall state of the system; when a transmission device in the system receives a communication message, according to the global hash chain and / or the aggregate hash chain, the received communication message is tracked, traced back and integrity verified.
[0083] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0084] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0085] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0086] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0087] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program code.
[0089] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A message tracking method, characterized in that: include: In the case where a transmission device sends a communication message, a data block corresponding to the communication message is generated, and the data block is added to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each of the data blocks corresponds to a communication message, and each of the data blocks contains a basic hash value, and the basic hash value in a first data block is determined according to the message content of the corresponding communication message and the basic hash value in a second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; Determine an aggregate hash value according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and determine an aggregate hash chain according to the aggregate hash value; Determine a global hash value according to the aggregate hash value in the aggregate hash chain, and determine a global hash chain according to the global hash value, wherein the global hash chain is used to characterize the overall state of the system; When a transmission device in the system receives the communication message, the received communication message is tracked and traced back and integrity verified according to the global hash chain and / or the aggregate hash chain.
2. The message tracking method according to claim 1, characterized in that: Generating a data block corresponding to the communication message includes: Determine basic information corresponding to the communication message, wherein the basic information includes at least one of the following: a message identifier, a source device identifier, a destination device identifier, a timestamp, and summary information corresponding to the message content of the communication message; Obtaining the basic hash value in the last data block in the basic hash chain corresponding to the transmission device, and determining a new basic hash value according to the basic hash value and the summary information corresponding to the message content; A new data block is determined according to the newly determined basic hash value and the basic information corresponding to the communication message, wherein the data block is used to characterize a transmission path of the communication message.
3. The message tracking method according to claim 2, characterized in that: Determining the aggregate hash chain according to the aggregate hash value includes: After each first time period, obtaining the basic hash value in the last data block in the basic hash chain corresponding to the transmission device; Performing an aggregation operation on the obtained multiple basic hash values to obtain an aggregated hash value, and determining aggregation information corresponding to the aggregated hash value, wherein the aggregation information includes at least one of the following: an aggregation identifier, a source device identifier set, a destination device identifier set, and an aggregation time range; The aggregate hash value and the aggregate information are added to the end of the aggregate hash chain, wherein the aggregate hash chain includes a plurality of the aggregate hash values arranged in sequence, and each aggregation operation corresponds to one aggregate hash value.
4. The message tracking method according to claim 3, characterized in that: Determining a global hash chain according to the global hash value includes: When the global hash chain is empty, determining an initial global state value corresponding to the system, and determining a global hash value according to the initial global state value and all the aggregate hash values in the aggregate hash chain; According to the global hash value, the global state value corresponding to the system is updated, and the global hash value and corresponding global information are added to the global hash chain, wherein the global information includes at least one of the following: a global snapshot identifier and an aggregate identifier set.
5. The message tracking method according to claim 4, characterized in that: Determining the global hash chain according to the global hash value further includes: When the global hash chain is not empty, obtaining a newly added aggregate hash value in the aggregate hash chain every second time period, wherein the newly added aggregate hash value is the newly added aggregate hash value in the aggregate hash chain within the second time period after the newly added aggregate hash value was last obtained from the aggregate hash chain; Determine a new global hash value according to the newly added aggregate hash value and the global state value corresponding to the system; According to the global hash value, the global state value corresponding to the system is updated, and the global hash value and the corresponding global information are added to the end of the global hash chain.
6. The message tracking method according to claim 1, characterized in that: According to the global hash chain and / or the aggregated hash chain, tracking and tracing back and verifying the integrity of the received communication message includes: Verify the integrity of the received communication message according to the last global hash value in the global hash chain and the aggregate hash value corresponding to the global hash value in the aggregate hash chain, and determine the transmission path of the communication message; And / or verify the integrity of the received communication message based on the last aggregate hash value in the aggregate hash chain and the aggregate hash value corresponding to the aggregate hash value in the basic hash chain, and determine the transmission path of the communication message.
7. The message tracking method according to claim 1, characterized in that: The transmission device includes: a sending end and a receiving end, wherein the sending end is used to encrypt the content of the communication message using the public key of the receiving end corresponding to the communication message when sending the communication message, and digitally sign the communication message using the private key of the sending end; the receiving end is used to verify the validity of the digital signature of the communication message using the public key of the sending end when receiving the communication message, and decrypt the content of the communication message using the private key of the receiving end.
8. A message tracking device, characterized in that: include: A basic chain update module, used for generating a data block corresponding to a communication message when a transmission device sends a communication message, and adding the data block to the end of a basic hash chain corresponding to the transmission device, wherein the basic hash chain contains a plurality of data blocks arranged in sequence, each of which corresponds to a communication message, and each of which contains a basic hash value, and the basic hash value in a first data block is determined based on the message content of the corresponding communication message and the basic hash value in a second data block, and the second data block is the previous data block immediately adjacent to the first data block in the basic hash chain; An aggregation chain updating module, configured to determine an aggregation hash value according to the basic hash value in the basic hash chain corresponding to each transmission device in the system, and determine an aggregation hash chain according to the aggregation hash value; A global chain update module, configured to determine a global hash value according to the aggregate hash value in the aggregate hash chain, and to determine a global hash chain according to the global hash value, wherein the global hash chain is used to characterize the overall state of the system; The verification and tracking module is used to track and verify the integrity of the received communication message according to the global hash chain and / or the aggregate hash chain when the transmission device in the system receives the communication message.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the message tracking method according to any one of claims 1 to 7 when running.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the message tracking method according to any one of claims 1 to 7 by running the computer program.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the message tracking method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Message verification method and system of communication network system
CN121151895A
A message verification method and system for a communication network system
CN121151895B