Decentralized offline message caching and retrieval method, system and apparatus
Patent Information
- Application Number
- CN202611345919.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-03
AI Technical Summary
In decentralized social systems, existing offline message transmission solutions suffer from high resource consumption and high message latency, especially high node storage pressure, high bandwidth consumption, and long message retrieval delays.
By building a list of neighboring nodes, targeted sending and caching are performed only within the range of neighboring nodes of the message receiving user. A confirmation threshold is set to stop sending, and neighboring nodes are accurately located when the message is retrieved, and messages are marked as deletable to free up storage.
It significantly reduces the computational overhead and storage usage of non-target nodes in the network, shortens message retrieval latency, improves the efficiency and confidentiality of offline message transmission, and ensures message timeliness and redundant backup.
Smart Images

Figure CN123035511A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of mobile communication and Internet technology, and specifically to a decentralized offline message caching and retrieval method, system and device. Background Technology
[0002] In mobile internet social systems, when users send messages to each other, if the recipient is offline, the common practice is to cache the message on a central server operated by the company. When the recipient comes online, the client retrieves the message from the central server's cache, thus achieving offline message sending. However, in decentralized social systems, where there is no central server, the mainstream solutions for offline message transmission when the recipient is offline include: Bitmessage encrypts offline messages using the receiving user's public key and then broadcasts them across the network, ensuring all user nodes receive the message. When the receiving user comes online, the client retrieves the message from other nodes in the network and decrypts it using its private key, thus processing the offline message. However, this scheme requires each node in the network to receive the message and attempt to decrypt it, placing significant demands on network, storage, and computation.
[0003] SSB (Secure Scuttlebutt) is a decentralized peer-to-peer social networking protocol. The message sender creates, signs, and stores the message on their local client. Regardless of whether the message receiver is online, the message is immediately appended to the sender's local, append-only log chain. The message propagates automatically along the social attention graph via the Gossip protocol, being copied and cached by multiple nodes, including the sender's followers and those they follow, forming a distributed storage network. Once the message receiver comes online, they pull, verify, and decrypt the message from any node in the network that holds a copy, ultimately obtaining the message sent by the sender, thus achieving offline communication based on social relationship replication.
[0004] However, in SSB, each node in the network needs to store the complete historical logs of all followers. The data volume grows linearly over time, resulting in high storage pressure on the user client's device and consuming a large amount of bandwidth during message synchronization. Furthermore, the nodes use the Gossip protocol for message discovery. To retrieve a message, a user must first query a seed node. If the message is not found there, the user queries the nodes whose routing table is saved in the seed node's connection list, repeating this process until the message is retrieved or a timeout occurs. While this protocol can effectively retrieve messages, it incurs significant time costs. Requests to find offline messages require sequentially traversing multiple nodes. In multi-hop propagation scenarios, message retrieval latency can increase linearly with the number of hops. Message latency is greatly affected by the number of nodes, and message timeliness cannot be guaranteed. Summary of the Invention
[0005] The purpose of this invention is to provide a decentralized offline message caching and retrieval method, system, and apparatus to solve the technical problems of high resource consumption and high message latency in existing offline message transmission processes.
[0006] In a first aspect, the present invention provides a decentralized offline message caching method, comprising the following steps: Send a message to the message receiving user, obtain the confirmation message returned by the message receiving user, and determine whether the message receiving user has received the message based on the confirmation message returned by the message receiving user; If the message receiving user does not receive the message, obtain the list of neighboring nodes of the message receiving user; send messages to the neighboring nodes of the message receiving user in turn according to the list of neighboring nodes, and obtain the confirmation messages returned by the neighboring nodes; When the number of acknowledgment messages returned by neighboring nodes exceeds the acknowledgment threshold, sending messages to neighboring nodes stops, and offline message caching is completed; otherwise, sending messages to the neighboring nodes of the message receiving user continues.
[0007] The significant effects of this invention are: This invention abandons the Bitmessage scheme's transmission mode of broadcasting messages to the entire network and having all nodes receive and attempt to decrypt them. Instead, it targets and sends messages only within a limited range of nodes defined by the recipient's list of neighboring nodes. By restricting messages to a range of neighboring nodes and caching them, it effectively avoids irrelevant nodes participating in message reception and decryption operations, significantly reducing the computational overhead, storage usage, and network bandwidth consumption of non-target nodes in the network, and solving the resource waste problem caused by network-wide broadcasting in existing technologies.
[0008] Furthermore, this invention uses an acknowledgment threshold as the criterion for stopping transmission. Transmission ceases when the number of acknowledgment messages returned by neighboring nodes exceeds the threshold. This mechanism ensures that a sufficient number of neighboring nodes successfully cache the message, providing ample redundancy for message retrieval after the receiving user comes online, while avoiding excessive redundancy and resource waste caused by sending messages to all neighboring nodes without limit. Given the highly random nature of node online and offline events in P2P networks, this threshold setting effectively balances message reachability with network load.
[0009] Furthermore, offline messages are stored in encrypted form on neighboring nodes. Throughout the caching process, neighboring nodes are only responsible for storing and forwarding messages and cannot decrypt or retrieve the message content. This ensures that the confidentiality of offline messages can still be effectively guaranteed even if neighboring nodes are untrusted or attacked.
[0010] Secondly, this invention provides a decentralized offline message extraction method for extracting offline messages sent using a decentralized offline message caching method, comprising the following steps: Check the list of neighboring nodes to see if there are any messages to be extracted. If the message exists, retrieve it from the neighboring node, mark it as deletable, and send a notification message to the neighboring node to delete the message cache.
[0011] In message retrieval, this invention allows the message receiving user to simply search within their own neighborhood node range using a pre-built list of neighboring nodes to obtain the offline message. Compared to the multi-hop search method in the SSB scheme, which requires using the Gossip protocol to query nodes in the routing table level by level until the message is found or a timeout occurs, this invention precisely limits the search range to the list of neighboring nodes, significantly shortening the message search path, reducing message retrieval latency, and improving the efficiency of offline message retrieval.
[0012] In this invention, the message extraction method marks the acquired message as deletable and sends a notification message to neighboring nodes to delete the cached message. This ensures that neighboring nodes promptly clear the cached message copy after the message is successfully extracted. This mechanism avoids the continuous increase in storage pressure on neighboring nodes due to the long-term accumulation of read messages, effectively solving the technical problems of linear data growth over time and high storage pressure on user clients in the SSB scheme.
[0013] This invention uses a deletion notification mechanism to ensure that extracted message copies are promptly cleared from neighboring nodes, preventing message recipients from receiving the same offline message multiple times when logging in or querying repeatedly. This avoids message confusion and a decline in user experience caused by duplicate message retrieval.
[0014] Furthermore, offline messages are stored in encrypted form on neighboring nodes. During the retrieval process, neighboring nodes only provide storage and forwarding services and cannot decrypt and retrieve the message content. After the message receiving user retrieves the message, only the user can decrypt and recover the original message content using their private key, ensuring that the confidentiality of offline messages is effectively guaranteed throughout the entire message retrieval process.
[0015] Thirdly, the present invention provides a decentralized offline message caching system for implementing the decentralized offline message caching method described above, including: The neighboring node list building module is used to build a list of neighboring nodes based on the node where the message receiving user is located; The message sending module is used to send messages to the message receiving user and neighboring nodes in the neighboring node list; The message receiving judgment module is used to determine whether the message receiving user has received the message based on the confirmation message returned by the message receiving user, and to determine whether the neighboring nodes have received the message based on the confirmation messages returned by the neighboring nodes in the neighboring node list. The message sending module also includes: The message sending selection unit is used to send an instruction to the message sending module to send the message to the neighboring nodes in the neighboring node list based on the judgment result of whether the message receiving user has received the message; The message sending control unit is used to issue an instruction to the message sending module to stop sending messages based on the number of messages received by neighboring nodes.
[0016] Fourthly, the present invention provides a decentralized offline message extraction system for implementing the above-mentioned decentralized offline message extraction method, comprising: The message to be extracted judgment module is used to check whether there are any messages to be extracted in the neighboring nodes based on the neighboring node list; The message extraction module is used to extract messages from neighboring nodes of the message to be extracted; The message deletion module is used to send a notification message to neighboring nodes to delete the message cache.
[0017] Fifthly, the present invention provides a decentralized offline message caching device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described decentralized offline message caching method.
[0018] In a sixth aspect, the present invention provides a decentralized offline message extraction device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described decentralized offline message extraction method. Attached Figure Description
[0019] Figure 1 This is a flowchart of a decentralized offline message caching method in an embodiment of the present invention; Figure 2 This is a flowchart of a decentralized offline message extraction method in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, a clear and complete description will be provided below in conjunction with the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.
[0021] See appendix Figure 1 The decentralized offline message caching method shown includes the following steps: S1. The message sender sends a message to the message receiver and receives a confirmation message from the message receiver. Based on the confirmation message, the sender determines whether the message receiver has received the message. Specifically, the sender encrypts the data using the message receiver's public key. Then, the sender establishes a direct streaming channel with the message receiver over the network. The sender sends the message through this channel and waits for a confirmation message. If the sender receives a confirmation message within a preset time, the message receiver has received the message. Otherwise, the sender resends the message a preset number of times. If the sender does not receive a confirmation message within the preset time, the message receiver has not received the message.
[0022] Preferably, in this embodiment, the message sender uses the message receiver's public key to perform asymmetric encryption on the sent data. Then, the message sender establishes a peer-to-peer (P2P) direct connection with the message receiver via the network. After the message sender sends a message to the message receiver through this direct connection, the message receiver returns an acknowledgment packet (ACK) to the message sender through the same direct connection. Upon receiving this acknowledgment packet, the message sender indicates that the message has been received, completing the transmission of the encrypted message. If the message sender does not receive an acknowledgment packet from the message receiver 20 seconds after sending the message, the message transmission has failed. In this case, the message sender will retry sending the message to the message receiver two more times. If the message sender does not receive an acknowledgment packet after three attempts, it means that the message receiver is currently unable to receive the information. The specific protocols for encrypting the sent data and sending the encrypted message to the message receiver are existing technologies and will not be described in detail here.
[0023] S2. When the message receiving user does not receive the message, the message sending user obtains the list of neighboring nodes of the message receiving user. The message sending user sends messages to the neighboring nodes of the message receiving user in sequence according to the list of neighboring nodes, and obtains the acknowledgment messages returned by the neighboring nodes. Specifically, the message sending user sends messages to the neighboring nodes in sequence according to the distance of each neighboring node in the list of neighboring nodes, in order of distance from the neighboring node to the node where the message receiving user is located, from closest to farthest. The specific content of sending messages to neighboring nodes and receiving acknowledgment messages returned by neighboring nodes is the same as the content of the message sending user sending messages to the message receiving user and receiving acknowledgment messages in step S1, and will not be repeated here.
[0024] Constructing a list of neighboring nodes involves the following steps: The message sender retrieves multiple candidate nodes. When retrieving candidate nodes, the message sender reads a set of nodes from its local DHT (Distributed Hash Table) as candidate nodes. The DHT stores information about nodes in the P2P network. This node information is returned by the P2P network protocol during node search and stored in the DHT. The node information includes the node ID, node multi-address information, and the delay information for this node search. The specific details of retrieving nodes from the DHT are existing technology and will not be elaborated here. For the retrieved candidate nodes, the following steps are executed sequentially: The distance between the candidate node and the node where the message receiving user is located is calculated. In calculating the distance between the candidate node and the node where the message receiving user is located, the node identifiers of the candidate node and the message receiving user are mapped to 256-bit binary values. The distance between the candidate node and the node where the message receiving user is located is obtained by XORing the binary values of the candidate node and the message receiving user. The specific details of mapping the node identifier to binary values and XORing the binary values are existing technologies and will not be elaborated here.
[0025] When the distance between a candidate node and the node where the message receiving user is located is less than a distance threshold, the candidate node is considered a neighboring node of the message receiving user, and the node information of the candidate node is added to the neighboring node list. The distance threshold can be configured according to the search time, and preferably, the distance threshold is 20 in this embodiment.
[0026] For example, if the node identifier of the message receiving user is AGCRR8cUetWNYhUnuSo8S, it can be mapped to a 256-bit binary value, such as 01100110..., which is 256 bits and occupies 32 bytes. Find two candidate nodes, a and b, where the node identifier of candidate node a is mapped to binary 01000011..., and the node identifier of candidate node b is mapped to binary 01100111...; calculate the distances of candidate nodes a and b to the node where the message receiving user resides: The distance between candidate node a and the node where the message receiving user is located is: 01000011 xor 01100110 =00100101= 37; The distance between candidate node b and the node where the message receiving user is located is: 01100111 xor 01100110 =00000001 = 1; Therefore, it can be seen that the distance between candidate node b and the node where the message receiving user is located is less than the distance threshold. Thus, candidate node b is considered a neighboring node of the message receiving user and is added to the neighboring node list.
[0027] The system determines whether the number of nodes in the neighboring node list equals the target number of nodes. If so, the neighboring node list is constructed; otherwise, the distance between the next candidate node and the node where the message receiving user is located is calculated. Preferably, in this embodiment, the target number of nodes is 16. After the neighboring node list is constructed, the message sending user saves the neighboring node list to its own database. After all candidate nodes have been traversed, if the number of nodes in the neighboring node list still does not reach the target number of nodes, the actual number of nodes obtained is used as the neighboring node list.
[0028] S3. When the number of acknowledgment messages returned by neighboring nodes exceeds the acknowledgment threshold, the message sender stops sending messages to neighboring nodes; otherwise, continue with step S2. The acknowledgment threshold is half the number of nodes in the neighboring node list. In P2P networks, node online and offline events are unpredictable random events. Setting the acknowledgment threshold to half the number of neighboring nodes ensures that more than half of the neighboring nodes closest to the message receiver have received and cached the message, effectively improving the success rate of message retrieval when the message receiver comes online.
[0029] When the message sender and receiver are not contacts of each other, the process also includes establishing a contact relationship between them. When establishing this relationship, if the receiver is online, the message sender sends a contact establishment request to the receiver by sending its node identifier. Upon receiving the request, the receiver can choose to add the receiver as a contact or not. When the receiver is offline, the steps for establishing the contact relationship include: The message sending user obtains multiple candidate nodes and constructs a list of neighboring nodes based on the distance between the candidate nodes and the node where the message receiving user is located. The neighboring node list when establishing contact relationships is the same as the step of constructing the neighboring node list when sending offline information in step S2, and will not be described again here.
[0030] The message sending user sends a contact establishment request to the neighboring nodes of the message receiving user in turn according to the list of neighboring nodes; the specific content of the contact establishment request to the neighboring nodes is the same as the step of sending a message to the neighboring nodes in steps S2-S3, and will not be repeated here.
[0031] Compared to existing technologies, this solution abandons the Bitmessage approach's transmission mode of broadcasting messages across the entire network, where all nodes receive and attempt to decrypt them. Instead, it targets messages only within a limited range of nodes defined by the recipient's list of neighboring nodes. By restricting messages to a range of neighboring nodes and caching them, irrelevant nodes are effectively prevented from participating in message reception and decryption, significantly reducing the computational overhead, storage usage, and network bandwidth consumption of non-target nodes in the network. This also solves the resource waste problem caused by network-wide broadcasting in existing technologies.
[0032] This scheme uses an acknowledgment threshold as the criterion for stopping message transmission. When the number of acknowledgment messages returned by neighboring nodes exceeds the threshold, transmission ceases. This mechanism ensures that a sufficient number of neighboring nodes successfully cache the message, providing ample redundancy for message retrieval after the receiving user comes online, while avoiding excessive redundancy and resource waste caused by sending messages to all neighboring nodes without limit. Given the highly random nature of node online and offline events in P2P networks, this threshold setting effectively balances message reachability with network load.
[0033] This solution also extends the offline message caching method to scenarios involving establishing contact relationships. When a message sender and receiver have not yet established a contact relationship, and the receiver is offline, the sender can cache the contact relationship establishment request information in the receiver's neighboring nodes through a list of nearby nodes. Once the receiver comes online, they can retrieve the request through the neighboring nodes and complete the contact relationship establishment. This enables offline transmission of contact relationship establishment requests in a decentralized social system, expanding the asynchronous communication capabilities of decentralized networks.
[0034] Furthermore, this scheme constructs a neighboring node list based on node distance, selecting nodes that are close to the node where the message receiving user is located as cache nodes, ensuring the topological proximity of cache nodes to the message receiving user. When the message receiving user comes online, they can retrieve offline cached messages from neighboring nodes with lower communication latency and fewer hops. This effectively avoids the high latency problem caused by the need for multi-hop propagation along the social attention graph and traversing and querying nodes in the SSB scheme, improving the timeliness and reliability of offline message transmission.
[0035] This invention also aims to provide a decentralized offline message extraction method for receiving the aforementioned decentralized offline message caching method, see appendix. Figure 2 As shown, the specific steps include: The message receiving user retrieves messages from its own list of neighboring nodes and sends notifications to each neighboring node to delete the messages. Specifically, after logging in, the message receiving user establishes P2P connections with its neighboring nodes sequentially. Once a neighboring node is online and a connection is successfully established, the message receiving user checks its neighboring nodes for messages sent to it by other nodes. If a message is found, the user retrieves it from that neighboring node, marks it as deletable, and sends notifications to each neighboring node to delete its cached message. Each neighboring node then determines whether it stores the cached message and deletes it accordingly. If none of the neighboring nodes have stored the message to be retrieved, it means there are currently no offline messages sent to the message receiving user.
[0036] When sending a notification message to delete the message cache, the message receiving user acts as the message sender and sends the notification message using the same steps as in steps S1-S3.
[0037] The offline message extraction method also includes receiving a contact relationship establishment request. Specifically, after the message receiving user comes online, the contact relationship establishment request is obtained through neighboring nodes, and a contact relationship is established with the message sending user based on the contact relationship establishment request.
[0038] In practice, each message contains a unique identification code. When a message receiving user retrieves a message from a neighboring node, the user can use this identification code to check for duplicate messages, ensuring that the user does not receive duplicate messages from neighboring nodes.
[0039] Compared to existing technologies, the decentralized offline message extraction method provided by this invention allows message-receiving users to retrieve messages simply by searching within their own neighboring node range based on a pre-built list of neighboring nodes. This is in contrast to the multi-hop search method in the SSB scheme, which requires using the Gossip protocol to query nodes in the routing table level by level until a message is found or a timeout occurs. This invention precisely limits the search scope to the list of neighboring nodes, significantly shortening the message search path, reducing message retrieval latency, and substantially improving the efficiency of offline message extraction.
[0040] In this message retrieval method, the acquired messages are marked as deletable, and a notification message to neighboring nodes is sent to delete the cached messages. This ensures that neighboring nodes promptly clear cached message copies after successful message retrieval. On one hand, this mechanism prevents message recipients from receiving the same offline message multiple times or making repeated queries, improving user experience. On the other hand, by promptly releasing the retrieved cached resources in neighboring nodes, it avoids the continuous increase in storage pressure caused by the long-term accumulation of read messages, effectively controlling the problem of linear data growth over time in the SSB scheme.
[0041] This solution extends the offline message extraction method to the offline extraction of contact relationship establishment requests. After the message receiving user comes online, they obtain the contact relationship establishment request information through neighboring nodes and can establish a contact relationship with the message sending user based on this request. This mechanism frees contact management in decentralized social systems from the online status of the communicating parties, enabling offline transmission and automatic processing of contact establishment requests, thus improving the usability and user experience of decentralized social networks.
[0042] Furthermore, offline messages are stored in encrypted form on neighboring nodes. Throughout the caching and retrieval process, neighboring nodes are only responsible for storing and forwarding messages and cannot decrypt them to obtain the message content. After the message receiving user retrieves the message, only that user can decrypt it using their private key to obtain the original message content. This scheme ensures that even if neighboring nodes are untrusted or attacked, the confidentiality of offline messages can still be effectively guaranteed, solving the information leakage risk that may arise from multi-hop replication in existing decentralized offline message transmission.
[0043] This invention also aims to provide a decentralized offline message caching system for implementing the decentralized offline message caching method described above, including: The neighboring node list building module is used to build a list of neighboring nodes based on the node where the message receiving user is located; The message sending module is used to send messages to the message receiving user and neighboring nodes in the neighboring node list; The message receiving judgment module is used to determine whether the message receiving user has received the message based on the confirmation message returned by the message receiving user, and to determine whether the neighboring nodes have received the message based on the confirmation messages returned by the neighboring nodes in the neighboring node list. The message sending module also includes: The message sending selection unit is used to send an instruction to the message sending module to send the message to the neighboring nodes in the neighboring node list based on the judgment result of whether the message receiving user has received the message; The message sending control unit is used to issue an instruction to the message sending module to stop sending messages based on the number of messages received by neighboring nodes.
[0044] This invention also aims to provide a decentralized offline message extraction system for implementing the decentralized offline message extraction method described above, including: The message to be extracted judgment module is used to check whether there are any messages to be extracted in the neighboring nodes based on the neighboring node list; The message extraction module is used to extract messages from neighboring nodes of the message to be extracted; The message deletion module is used to send a notification message to neighboring nodes to delete the message cache.
[0045] The present invention also aims to provide a decentralized offline message caching device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described decentralized offline message caching method.
[0046] The present invention also aims to provide a decentralized offline message extraction device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described decentralized offline message extraction method.
[0047] In some embodiments, the processor may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor is the control unit of the offline message caching device or offline message extraction device, connecting various components of the device via various interfaces and lines. It executes programs or modules stored in the memory and calls data stored in the memory to perform various functions and process data within the offline message caching device or offline message extraction device.
[0048] The memory includes at least one type of readable storage medium, including flash memory, portable hard drives, multimedia cards, card-type memory (e.g., SD or DX memory), magnetic storage, magnetic disks, optical disks, etc. In some embodiments, the memory can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory can be an external storage device of the electronic device, such as a plug-in portable hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard. Furthermore, the memory can include both internal and external storage units of the electronic device. The memory can be used not only to store application software and various types of data installed on the electronic device, such as code for decentralized offline message caching methods or decentralized offline message extraction methods, but also to temporarily store data that has been output or will be output.
[0049] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the scope of the present invention should be included within the protection scope of the present invention.
Claims
1. A decentralized offline message caching method, characterized in that, Includes the following steps: Send a message to the message receiving user, obtain the confirmation message returned by the message receiving user, and determine whether the message receiving user has received the message based on the confirmation message returned by the message receiving user; If the message receiving user does not receive the message, retrieve the list of neighboring nodes of the message receiving user; Based on the list of neighboring nodes, messages are sent sequentially to the neighboring nodes of the message receiving user, and confirmation messages are obtained from the neighboring nodes. When the number of acknowledgment messages returned by neighboring nodes exceeds the acknowledgment threshold, sending messages to neighboring nodes stops, and offline message caching is completed; otherwise, sending messages to the neighboring nodes of the message receiving user continues.
2. The decentralized offline message caching method according to claim 1, characterized in that, The step of determining whether the message receiving user has received the message based on the returned confirmation message includes: If a confirmation message is received from the message receiving user within the preset time, it means that the message receiving user has received the message. Otherwise, the message is resent to the message receiving user a preset number of times. If no confirmation message is received from the message receiving user within the preset time, it is determined that the message receiving user has not received the message.
3. The decentralized offline message caching method according to claim 1, characterized in that, The steps for constructing the list of neighboring nodes for the message receiving user include: Obtain multiple candidate nodes, and execute the following steps on each candidate node in turn: Calculate the distance between the candidate node and the node where the message receiving user is located; When the distance between a candidate node and the node where the message receiving user is located is less than the distance threshold, the candidate node is considered a neighboring node of the message receiving user and is added to the neighboring node list. Determine if the number of nodes in the neighboring node list is equal to the number of target nodes. If so, complete the construction of the neighboring node list; otherwise, calculate the distance between the next candidate node and the node where the message receiving user is located.
4. The decentralized offline message caching method according to claim 1, characterized in that, The offline message caching method further includes sending an offline message requesting the establishment of a contact relationship, including: Obtain multiple candidate nodes and construct a list of neighboring nodes based on the distance between the candidate nodes and the node where the message receiving user is located; Based on the list of neighboring nodes, send contact relationship requests to the neighboring nodes of the message receiving user in sequence, and obtain confirmation messages returned by the neighboring nodes; When the number of confirmation messages returned by neighboring nodes exceeds the confirmation threshold, message sending to neighboring nodes is stopped, and offline message caching of contact relationship establishment messages is completed; otherwise, contact relationship establishment request information continues to be sent to the neighboring nodes of the message receiving user.
5. A decentralized offline message extraction method, used to extract offline messages sent by the decentralized offline message caching method as described in any one of claims 1-4, characterized in that, Includes the following steps: Check the list of neighboring nodes to see if there are any messages to be extracted. If the message exists, retrieve it from the neighboring node, mark it as deletable, and send a notification message to the neighboring node to delete the message cache.
6. The decentralized offline message extraction method according to claim 5, characterized in that, The offline message extraction method further includes extracting offline messages related to establishing contact relationships, including: Obtain contact relationship request information from neighboring nodes, and establish contact relationship with the message sender based on the contact relationship request.
7. A decentralized offline message caching system, used to implement the decentralized offline message caching method as described in any one of claims 1-4, characterized in that, include: The neighboring node list building module is used to build a list of neighboring nodes based on the node where the message receiving user is located; The message sending module is used to send messages to the message receiving user and neighboring nodes in the neighboring node list; The message receiving judgment module is used to determine whether the message receiving user has received the message based on the confirmation message returned by the message receiving user, and to determine whether the neighboring nodes have received the message based on the confirmation messages returned by the neighboring nodes in the neighboring node list. The message sending module also includes: The message sending selection unit is used to send an instruction to the message sending module to send the message to the neighboring nodes in the neighboring node list based on the judgment result of whether the message receiving user has received the message; The message sending control unit is used to issue an instruction to the message sending module to stop sending messages based on the number of messages received by neighboring nodes.
8. A decentralized offline message extraction system, used to implement the decentralized offline message extraction method as described in any one of claims 5-6, characterized in that, include: The message to be extracted judgment module is used to check whether there are any messages to be extracted in the neighboring nodes based on the neighboring node list; The message extraction module is used to extract messages from neighboring nodes of the message to be extracted; The message deletion module is used to send a notification message to neighboring nodes to delete the message cache.
9. A decentralized offline message caching device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the decentralized offline message caching method as described in any one of claims 1-4.
10. A decentralized offline message extraction device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the decentralized offline message extraction method as described in any one of claims 5-6.
