Communication method, communication system, electronic equipment and computer readable storage medium
By setting up cache nodes in the wireless mesh network, cache and forward data packets sent by other nodes in the mesh network, the data loss problem caused by channel conflicts and other reasons is solved, and the reliability of data packet transmission is improved.
Patent Information
- Application Number
- CN202510317514.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-20
AI Technical Summary
Due to channel conflicts, electromagnetic interference and other factors in the wireless mesh network, the gateway cannot receive data packets sent by other nodes, resulting in data loss.
By setting up cache nodes in the mesh network, receiving and cache data packets sent by other nodes, and sending these data packets to the gateway when appropriate, the possibility of data packets being successfully sent to the gateway is improved.
It effectively alleviates data loss and improves the reliability and success rate of data packet transmission.
Smart Images

Figure CN120186684A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and more particularly, to a communication method, a communication system, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the continuous development of wireless networking technologies, mesh networks, such as wireless mesh networks, have become more and more widely used in fields such as smart homes, urban wireless network coverage, industrial Internet of Things, and emergency communications. Each mesh node in a wireless mesh network can directly communicate with other mesh nodes and access the Internet through a gateway. Therefore, it can effectively expand the coverage of the Internet and enhance the reliability of the Internet. However, it is possible that due to factors such as channel conflict and electromagnetic interference, the gateway cannot receive data sent by other mesh nodes, so data loss is likely to occur. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a communication method, a communication system, an electronic device, and a computer-readable storage medium, which can improve the possibility of successfully sending data packets to the gateway by having a caching node receive and cache data packets sent by other nodes in the mesh network, and thus can effectively alleviate the situation of data loss.
[0004] In a first aspect, an embodiment of the present invention provides a communication method applicable to a gateway that supports a local communication protocol and an Internet access protocol. The method includes:
[0005] Receiving a data packet to be processed through the local communication protocol, where the data packet to be processed is a data packet cached by a caching node in the mesh network;
[0006] Performing deduplication processing on the data packet to be processed based on processed data packets to obtain a target data packet;
[0007] Performing data processing on the target data packet.
[0008] Optionally, the performing deduplication processing on the data packet to be processed based on processed data packets to obtain a target data packet includes:
[0009] Obtaining a first data identifier of the processed data packets;
[0010] Obtaining a second data identifier of the data packet to be processed;
[0011] Determining a target data identifier according to the first data identifier, where the target data identifier is a data identifier to be removed from the second data identifiers;
[0012] Determining the target data packet according to the target data identifier.
[0013] Optionally, the first data identifier is the data identifier of the latest processed data packet, the first data identifier is incrementally generated by the source node of the processed data packet in the order of packet generation, and the second data identifier is incrementally generated by the source node of the data packet to be processed in the order of packet generation;
[0014] The determining the target data identifier according to the first data identifier includes:
[0015] Comparing the first data identifier corresponding to the same source node with each of the second data identifiers;
[0016] Determining the second data identifier less than or equal to the first data identifier as the target data identifier.
[0017] Optionally, the determining the target data packet according to the target data identifier includes:
[0018] Discarding the data packet to be processed corresponding to the target data identifier;
[0019] Determining the remaining data packets to be processed as the target data packets.
[0020] Optionally, the gateway includes a virtual relay module, and the data packet to be processed is received through the virtual relay module.
[0021] Optionally, the cache node is determined according to the memory of each node in the mesh network.
[0022] In a second aspect, an embodiment of the present invention provides a communication system, the system includes:
[0023] A cache device, the cache device is a cache node in a mesh network, and is configured to cache and send data packets to be processed;
[0024] A gateway, the gateway supports a local communication protocol and an Internet access protocol, and is configured to receive data packets to be processed through the local communication protocol, perform deduplication processing on the data packets to be processed based on the processed data packets, obtain target data packets, and perform data processing on the target data packets.
[0025] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, the memory is used to store one or more computer program instructions, wherein, the one or more computer program instructions are executed by the processor to implement the method according to any one of the first aspect.
[0026] Fourthly, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method described in any item of the first aspect is implemented.
[0027] Fifthly, an embodiment of the present invention provides a computer program product, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in any item of the first aspect is implemented.
[0028] The gateway in the embodiment of the present invention supports a local communication protocol and an Internet access protocol, and can receive the to-be-processed data packets cached and sent by the caching devices in the mesh network through the local communication protocol. After receiving the to-be-processed data packets, the gateway performs deduplication processing on the to-be-processed data packets sent by the caching devices according to the processed data packets to obtain target data packets, and then performs data processing on the target data packets. In the embodiment of the present invention, by means of the caching nodes receiving and caching the data packets sent by other nodes in the mesh network, the possibility of the data packets being successfully sent to the gateway is increased, so the situation of data loss can be effectively alleviated. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Through the following description of the embodiments of the present invention with reference to the drawings, the above and other objects, features, and advantages of the present invention will become clearer. In the drawings:
[0030] Figure 1 is a schematic diagram of a communication system according to an embodiment of the present invention;
[0031] Figure 2 is a schematic diagram of the software layer structure of a gateway according to an embodiment of the present invention;
[0032] Figure 3 is a flowchart of a communication method according to an embodiment of the present invention;
[0033] Figure 4 is a flowchart of a communication method according to an embodiment of the present invention;
[0034] Figure 5 is a schematic diagram of a communication device according to an embodiment of the present invention;
[0035] Figure 6 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] The present application will be described based on embodiments below, but the present application is not limited to these embodiments. In the following detailed description of the present application, some specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. In order to avoid obscuring the essence of the present application, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0037] In addition, those of ordinary skill in the art should understand that the drawings provided herein are for illustrative purposes only, and the drawings are not necessarily drawn to scale.
[0038] Unless the context clearly requires otherwise, the words "including", "comprising", and the like throughout the application should be construed in an inclusive sense rather than an exclusive or exhaustive sense; that is, the meaning of "including but not limited to".
[0039] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0040] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0041] Traditional wireless local area network technologies, such as WiFi (Wireless Fidelity), rely on centralized network infrastructure, such as base stations, routers, optical fibers, etc. However, the deployment cost of network infrastructure is relatively high, so the number is usually small, and the network infrastructure is usually set at fixed locations. If the device is too far from the network infrastructure or the signal is blocked, it cannot access the Internet, resulting in limited coverage of the Internet in some areas where network infrastructure is difficult to cover, such as remote areas and complex environments. The mesh network, such as the wireless mesh network, is a decentralized organizational structure. Nodes (i.e., devices) accessing the same wireless mesh network can communicate directly without relying on a central node. Moreover, the wireless mesh network supports multi-hop transmission, and data can be relayed through multiple nodes. At the same time, the wireless mesh network has self-organizing capabilities. Devices can automatically discover and join the wireless mesh network and access the Internet through the gateway accessing the wireless mesh network. This enables devices to complete data transmission and access the Internet through multi-hop transmission even without deploying a large number of network infrastructures. Therefore, the wireless mesh network can improve the coverage of the Internet at a relatively low infrastructure deployment cost. The embodiments of the present invention mainly describe the mesh network as an example of the wireless mesh network. It should be understood that the present embodiments are not limited thereto. Existing mesh networks that can support corresponding functions, such as wireless sensor networks (WSN, Wireless Sensor Networks), mobile ad-hoc networks (MANET, Mobile Ad-Hoc Network), etc., or storage devices that can support corresponding functions with the development of future technologies are all within the protection scope of the embodiments of the present invention.
[0042] The gateway can communicate with other nodes in the mesh network through local communication protocols such as Zigbee, Bluetooth, and Z-Wave (wireless networking grid), and communicate with the server or cloud through Internet access protocols such as WiFi and cellular networks. Taking the Bluetooth gateway as an example, the Bluetooth gateway can support both the WiFi protocol and the Bluetooth mesh network protocol simultaneously. However, the working frequency bands of both Bluetooth and WiFi are 2.4 GHz. If Bluetooth and WiFi work simultaneously, it is easy to cause frequency band conflicts. Therefore, to avoid this situation, some Bluetooth gateways use a time-division multiplexing method to switch the communication method, that is, the Bluetooth gateway can only select the Bluetooth mesh network protocol or the WiFi protocol for communication within the same time period. However, time-division multiplexing will cause the Bluetooth gateway to be unable to receive or send data (or data packets) through the mesh network protocol when using the WiFi protocol. If the scanning duty cycle of the Bluetooth gateway, that is, the ratio of the actual scanning time to the total time, is relatively low, the Bluetooth gateway cannot receive the data (or data packets) sent by other nodes in the mesh network during the working period of WiFi. At the same time, factors such as electromagnetic interference, relay node failures, and network congestion may also cause the gateway to be unable to receive the data packets sent by other nodes, so it is easy to cause data loss situations.
[0043] To solve the above problems, embodiments of the present invention propose a communication method, a communication system, an electronic device, and a computer-readable storage medium. Figure 1 It is a schematic diagram of the communication system according to an embodiment of the present invention. As Figure 1 shown, the hardware system architecture of the embodiment of the present invention includes at least one gateway and at least one device. Figure 1 Taking gateway 11 and device 12 as examples for illustration. Gateway 11 and device 12 can establish a communication connection through a wireless mesh network.
[0044] The gateway of the embodiment of the present invention supports both local communication protocols and Internet access protocols, and accesses the Internet through the Internet access protocol. Figure 2 It is a schematic diagram of the software layer structure of the gateway according to an embodiment of the present invention. As Figure 2 shown, the software layer of gateway 11 includes a virtual relay module 21, a network layer 22, a transport layer 23, and an application layer 24. Among them, the virtual relay module 21 is mainly used for relaying data packets and ensuring the orderliness of data packets, including sorting and deduplicating the data packets sent by device 12. The network layer 22 is used to ensure the physical connection and basic communication functions of the mesh network, including receiving the data packets of device 12 directly transmitted by the hardware layer ( Figure 2 not shown) or processed and transmitted by the virtual relay module 21. The transport layer 23 is mainly responsible for data routing, ensuring data transmission reliability, traffic control, etc. The application layer 24 is used to be responsible for specific application logics and data processing, including data format conversion, device control, security verification, etc.
[0045] Device 12 is a node in the wireless mesh network and can directly send data packets to the gateway 11 as a source node. At the same time, devices in the wireless mesh network can use communication modes such as broadcast mode and multicast (i.e., groupcast) mode to allow multiple nodes in the mesh network to receive data packets. Therefore, device 12 can also receive data packets sent by other nodes and act as a relay node and / or a cache node to send the received data packets of other nodes to the target node (i.e., gateway 11). When acting as a relay node for at least one device in the wireless mesh network, device 12 can forward the received data packets to gateway 11 after receiving the data packets sent by other devices in the wireless mesh network. When acting as a cache node in the wireless mesh network, device 12 can cache these data packets in the memory after receiving the data packets sent by other devices in the wireless mesh network and actively send these data packets to gateway 11, or can send the cached data packets to gateway 11 after receiving a data transmission instruction sent by gateway 11 for instructing device 12 to send the data packets cached in the memory.
[0046] In an embodiment of the present invention, gateway 11 can receive the to-be-processed data packets cached and sent by device 12 through a local communication protocol, perform deduplication processing on the to-be-processed data packets based on the processed data packets to obtain target data packets, and then process the target data packets. The embodiment of the present invention improves the possibility that the data packets are successfully sent to the gateway by receiving and caching the data packets sent by other nodes in the mesh network, and therefore can effectively alleviate the situation of data loss.
[0047] The following is illustrated by method embodiments. Figure 3 is a flowchart of the communication method according to an embodiment of the present invention. As Figure 3 shown, the method of this embodiment includes the following steps:
[0048] Step S100, receive the to-be-processed data packets through a local communication protocol.
[0049] In this embodiment, the gateway can communicate with each node in the wireless mesh network through a local communication protocol and communicate with a server or the cloud through an Internet access protocol. However, the gateway may fail to successfully receive the data packets sent by other nodes due to various factors. To reduce this situation, at least one node is selected as a cache node in the wireless mesh network, and the data packets received from other nodes are cached through the cache node.
[0050] After the device accesses the wireless mesh network, the gateway can obtain the memory of the device in various ways. For example, the device can report its own memory to the gateway through heartbeat information, or the gateway can send a memory query instruction to the device to obtain the memory of each device. To ensure the data caching ability of the storage node, in this embodiment, the caching node can be determined according to the memory of each node. For example, the device with the top n (n is a predetermined integer greater than or equal to 1) remaining memory sorted in descending order can be determined as the caching node; or the device with a memory capacity higher than the preset memory threshold can be determined as the caching node.
[0051] According to the actual settings, the gateway can also obtain the status information of each device, such as power consumption information, and select the caching node according to the memory and power consumption information of each device. For example, the node with the top n remaining memory sorted in descending order and the bottom m (m is a predetermined integer greater than or equal to 1) power consumption sorted in ascending order can be determined as the caching node; or the device with a remaining memory not less than the preset memory threshold and a power consumption not higher than the preset power consumption threshold can be determined as the caching node. According to the actual settings, the gateway can also obtain the status information of each device through various existing methods, and this embodiment does not limit this.
[0052] Therefore, in this step, the gateway can receive the data packets cached by the caching node of the mesh network during the working period of the local communication protocol. According to the actual settings, if the data transmission policy is that the caching node can actively send the data packets to be processed to the gateway through the local communication protocol, the gateway can directly receive the data packets to be processed; if the data transmission policy is that the caching node is controlled to send the data packets to be processed to the gateway, the gateway can send a data transmission instruction to the caching node so that after receiving the data transmission instruction, the caching node sends the data packets to be processed cached in the memory to the gateway.
[0053] Optionally, the data packets cached by the caching node can include the data packets sent by other nodes as the source node, or can include the data packets sent by the caching node as the source node. That is to say, the caching node can be used as the source node at the same time, and can cache the data packets to be processed while sending the data packets to be processed, so as to reduce the possibility of the gateway receiving the data packets to be processed unsuccessfully.
[0054] Step S200, perform deduplication processing on the data packets to be processed based on the processed data packets to obtain the target data packets.
[0055] The gateway can also receive the data packets sent by other nodes during the working period of the local communication protocol. After receiving the data packets sent by other nodes, the gateway will give priority to processing these data packets. Therefore, in this step, the gateway can perform deduplication processing on the data packets to be processed based on the processed data packets (i.e., the processed data packets) to obtain the target data packets, so as to reduce network redundancy.
[0056] Figure 4 is a flowchart of the communication method according to an embodiment of the present invention. As Figure 4 shown, in an alternative implementation of this embodiment, step S200 may include the following steps:
[0057] Step S210, obtain a first data identifier of the processed data packet.
[0058] To ensure the orderliness of data packets, for any data packet, each node may generate a data identifier of the data packet in an increasing manner according to its own node identifier and the generation order of each data packet generated by the node. For example, the node identifier of a device is Node1, and node Node1 generates 5 data packets. Then, according to the generation order of each data packet, node Node1 may incrementally generate data identifiers of each data packet as (Node1,Data1), (Node1,Data2), (Node1,Data3), (Node1,Data4), and (Node1,Data5). Therefore, in this step, the gateway may extract the corresponding first data identifier from the processed data packets.
[0059] Step S220, obtain a second data identifier of the data packet to be processed.
[0060] In this step, the gateway may also extract the second data identifier of the data packet to be processed from the data packet to be processed. The determination method of the second data identifier may refer to the generation method of the first data identifier, which will not be elaborated here.
[0061] Step S230, determine a target data identifier according to the first data identifier.
[0062] In a wireless mesh network, it is allowed that the same source node can send data packets to the target node through multiple transmission paths. That is, the wireless mesh network may include multiple relay nodes or cache nodes, and these relay nodes and cache nodes can all send data packets sent by the same source node to the gateway, which makes the order in which the data packets arrive at the gateway may be inconsistent with the order in which the source node sends the data packets, and the gateway may receive the same data packet repeatedly. The gateway's processing policy for data packets defaults that the arrival order of the data packets is the same as the sending order of the data packets. Therefore, it will consider the data packet received first as a new data packet and the data packet received later as an old data packet. To avoid the data of the old data packet overwriting the data of the new data packet, resulting in data inconsistency or errors, or wasting the gateway's data processing resources by repeatedly processing the same data packet, the gateway will discard the data packet that arrives later.
[0063] However, this method may cause some new data packets to be misidentified as old data packets and discarded because they arrive at the gateway later than the old data packets. Therefore, to avoid the above situation, in this step, the gateway can determine the target data identifier from the second data identifiers of the to-be-processed data packets according to the first data identifier of each processed data packet, so as to determine the to-be-processed data packets that need to be discarded according to the target data identifier.
[0064] After the gateway processes the data of the data packets, it usually only retains the data identifier of the most recently processed data packet. Therefore, in this embodiment, the first data identifier can be the data identifier of the most recently processed data packet. Further, the gateway can compare the first data identifier of the processed data packets corresponding to the same source node with the second data identifiers of each to-be-processed data packet. If the second data identifier is less than the first data identifier, it means that the to-be-processed data packet is an old data packet, so the second data identifier of the to-be-processed data packet can be determined as the target data identifier; if the second data identifier is equal to the first data identifier, it means that the to-be-processed data packet and the processed data packet are the same data packet, so the second data identifier of the to-be-processed data packet can also be determined as the target data identifier.
[0065] For example, the processed data packet that the gateway has most recently processed is the data packet sent by node Node2 with a first data identifier of 3. The gateway can compare the first data identifier with the second data identifiers of the to-be-processed data packets received from node Node2, that is, 1, 2, 5, and 7 respectively, and determine that 1 and 2 are the second data identifiers less than the first data identifier. Therefore, the gateway can determine 1 and 2 as the target data identifiers.
[0066] Step S240, determine the target data packets according to the target data identifier.
[0067] After determining the target data identifier, the gateway can discard the to-be-processed data packets corresponding to the target data identifier, and determine the remaining to-be-processed data packets, that is, the to-be-processed data packets that are not discarded, as the target data packets.
[0068] Step S300, perform data processing on the target data packets.
[0069] After determining the target data packets, the gateway can perform corresponding data processing on each target data packet. In the embodiment of the present invention, by means of caching nodes cooperating to receive data packets sent by other nodes, the gateway can receive at least some data packets that could not be received originally due to factors such as channel conflict and electromagnetic interference. Therefore, it can effectively increase the possibility that the data packets are successfully sent to the gateway, thereby alleviating the situation of data loss.
[0070] Taking the application scenario of the gateway time-division multiplexing switching communication mode as an example, during the period when the gateway communicates through the Internet access protocol, the cache node can still receive the data packets sent by other nodes in the mesh network through the local communication protocol, and during the period when the gateway communicates through the local communication protocol, send the received data packets to the gateway. Therefore, it can effectively alleviate the situation of data loss caused by the gateway being unable to receive the data packets sent by other nodes in the mesh network through the local communication protocol during the period of communicating through the Internet access protocol.
[0071] The gateway in the embodiment of the present invention supports the local communication protocol and the Internet access protocol, and can receive the to-be-processed data packets cached and sent by the cache device in the mesh network through the local communication protocol. After receiving the to-be-processed data packets, the gateway performs deduplication processing on the to-be-processed data packets sent by the cache device according to the processed data packets to obtain the target data packets, and then performs data processing on the target data packets. In the embodiment of the present invention, by means of the cache node receiving and caching the data packets sent by other nodes in the mesh network, the possibility of the data packets being successfully sent to the gateway is increased, so the situation of data loss can be effectively alleviated.
[0072] Figure 5 It is a schematic diagram of the communication device in the embodiment of the present invention, applicable to a gateway that supports the local communication protocol and the Internet access protocol. As Figure 5 shown, the communication device in this embodiment includes a data receiving unit 501, a data deduplication unit 502, and a data processing unit 503.
[0073] Among them, the data receiving unit 501 is used to receive the to-be-processed data packets through the local communication protocol, and the to-be-processed data packets are the data packets cached by the cache nodes in the mesh network; the data deduplication unit 502 is used to perform deduplication processing on the to-be-processed data packets based on the processed data packets to obtain the target data packets; the data processing unit 503 is used to perform data processing on the target data packets.
[0074] Further, the data deduplication unit 502 includes a first identifier obtaining subunit, a second identifier obtaining subunit, a first deduplication subunit, and a data packet determining subunit.
[0075] Among them, the first identifier obtaining subunit is used to obtain the first data identifier of the processed data packets; the second identifier obtaining subunit is used to obtain the second data identifier of the to-be-processed data packets; the first deduplication subunit is used to determine the target data identifier according to the first data identifier, and the target data identifier is the data identifier to be removed in the second data identifiers; the data packet determining subunit is used to determine the target data packets according to the target data identifier.
[0076] Further, the first data identifier is the data identifier of the latest processed data packet, which is incrementally generated by the source node of the processed data packet in the order of packet generation, and the second data identifier is incrementally generated by the source node of the data packet to be processed in the order of packet generation;
[0077] The first duplicate removal subunit includes an identifier comparison module and an identifier determination module.
[0078] Among them, the identifier comparison module is used to compare the first data identifier corresponding to the same source node with each second data identifier; the identifier determination module is used to determine the second data identifier less than or equal to the first data identifier as the target data identifier.
[0079] Further, the data packet determination subunit includes a data packet discard module and a data packet determination module.
[0080] Among them, the data packet discard module is used to discard the data packet to be processed corresponding to the target data identifier; the data packet determination module is used to determine the remaining data packets to be processed as the target data packets.
[0081] Further, the gateway includes a virtual relay module, and the data packet to be processed is received through the virtual relay module.
[0082] Further, the cache node is determined according to the memory of each node in the mesh network.
[0083] The gateway in the embodiment of the present invention supports the local communication protocol and the Internet access protocol, and can receive the data packet to be processed cached and sent by the cache device in the mesh network through the local communication protocol. After receiving the data packet to be processed, the gateway performs duplicate removal processing on the data packet to be processed sent by the cache device according to the processed data packet, obtains the target data packet, and then performs data processing on the target data packet. In the embodiment of the present invention, by receiving and caching the data packets sent by other nodes in the mesh network through the cache node, the possibility of the data packet being successfully sent to the gateway is increased, so the situation of data loss can be effectively alleviated.
[0084] Figure 6 It is a schematic diagram of the electronic device in the embodiment of the present invention. In this embodiment, the electronic device 6 includes a server, a terminal, etc. As Figure 6As shown, the electronic device 6 includes at least one processor 601; and a memory 602 communicatively connected to the at least one processor 601; and a communication component 603 communicatively connected to the scanning device, the communication component 603 receiving and transmitting data under the control of the processor 601; wherein, the memory 602 stores instructions executable by the at least one processor 601, and the instructions are executed by the at least one processor 601 to implement the above communication method.
[0085] Specifically, the electronic device includes one or more processors 601 and a memory 602. Figure 6 Here, one processor 601 is taken as an example. The processor 601 and the memory 602 may be connected by a bus or other means. Figure 6 Here, taking the connection by bus as an example. The memory 602, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor 601 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in the memory 602, that is, to implement the above communication method.
[0086] The memory 602 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store an option list, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 602 may optionally include a memory remotely provided with respect to the processor 601, and these remote memories can be connected to external devices through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0087] One or more modules are stored in the memory 602 and, when executed by one or more processors 601, implement the communication method in any of the above method embodiments.
[0088] The above product can execute the method provided in the embodiments of the present application, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the method provided in the embodiments of the present application.
[0089] The gateway according to the embodiment of the present invention supports local communication protocols and Internet access protocols, and can receive the to-be-processed data packets cached and sent by the caching devices in the mesh network through the local communication protocols. After receiving the to-be-processed data packets, the gateway performs deduplication processing on the to-be-processed data packets sent by the caching devices according to the processed data packets to obtain the target data packets, and then performs data processing on the target data packets. In the embodiment of the present invention, by means of the caching nodes receiving and caching the data packets sent by other nodes in the mesh network, the possibility of the data packets being successfully sent to the gateway is increased, so the situation of data loss can be effectively alleviated.
[0090] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, and the computer-readable program is used for a computer to execute the above-mentioned partial or all method embodiments.
[0091] That is, those skilled in the art can understand that all or part of the steps of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs and other various media that can store program codes.
[0092] The foregoing are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, various modifications and changes can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A communication method, applicable to a gateway supporting a local communication protocol and an Internet access protocol, characterized in that: The method comprises: Receiving a data packet to be processed through a local communication protocol, wherein the data packet to be processed is a data packet cached by a cache node in the mesh network; Deduplication processing is performed on the data packet to be processed based on the processed data packet to obtain the target data packet; Perform data processing on the target data packet.
2. The method according to claim 1, characterized in that The deduplication processing of the data packet to be processed based on the processed data packet to obtain the target data packet comprises: Acquire a first data identifier of the processed data packet; Obtaining a second data identifier of the data packet to be processed; Determine a target data identifier according to the first data identifier, where the target data identifier is a data identifier to be removed from the second data identifier; The target data packet is determined according to the target data identifier.
3. The method according to claim 2, characterized in that The first data identifier is the latest data identifier of the processed data packet, the first data identifier is generated incrementally by the source node of the processed data packet according to the generation order of the data packets, and the second data identifier is generated incrementally by the source node of the data packet to be processed according to the generation order of the data packets; Determining the target data identifier according to the first data identifier includes: Compare the first data identifier corresponding to the same source node with each of the second data identifiers; The second data identifier that is less than or equal to the first data identifier is determined as the target data identifier.
4. The method according to claim 2, characterized in that: Determining the target data packet according to the target data identifier comprises: discarding the data packet to be processed corresponding to the target data identifier; The remaining data packets to be processed are determined as the target data packets.
5. The method according to claim 1, characterized in that The gateway comprises a virtual relay module through which the data packet to be processed is received.
6. The method according to claim 1, characterized in that The cache node is determined according to the memory of each of the nodes in the mesh network.
7. A communication system, characterized in that: The system comprises: A cache device, which is a cache node in the mesh network and is configured to cache and send data packets to be processed; A gateway supports a local communication protocol and an Internet access protocol, and is configured to receive a data packet to be processed through the local communication protocol, perform deduplication processing on the data packet to be processed based on the processed data packet, obtain a target data packet, and perform data processing on the target data packet.
8. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program / instructions, which implement the method according to any one of claims 1 to 6 when executed by a processor.